sqlviz


Namesqlviz JSON
Version 0.0.1 PyPI version JSON
download
home_pageNone
SummaryA Python library for SQL query visualization with interactive charts using Plotly
upload_time2025-08-13 16:19:23
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords sql visualization plotly data database
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # SQLViz

SQLViz is a Python library that allows you to query SQL databases and visualize the results directly using Plotly charts.

---

## Installation

```bash
pip install sqlviz
```

---

## Features

* Query any SQL database supported by SQLAlchemy.
* Generate charts (bar, line, scatter, etc.) from SQL queries.
* CLI utility to quickly visualize SQL results.
* Auto-detect x/y columns when not provided.

---

## CLI Usage

You can use SQLViz from the command line to generate charts directly from your database.

### Syntax

```bash
sqlviz-cli --db-uri <DATABASE_URI> --sql "<SQL_QUERY>" --chart-type <CHART_TYPE> [--x <X_COLUMN>] [--y <Y_COLUMN>] [--show False]
```

### Parameters

* `--db-uri`: SQLAlchemy database URI (e.g., `sqlite:///mydata.db`).
* `--sql`: SQL query to fetch data.
* `--chart-type`: Type of chart (`bar`, `line`, `scatter`, etc.).
* `--x`: (Optional) Column name for X-axis.
* `--y`: (Optional) Column name for Y-axis.
* `--show`: Whether to display the chart immediately (default: True).

### Example

```bash
sqlviz-cli --db-uri sqlite:///test.db --sql "SELECT * FROM t" --chart-type bar --x x --y y --show False
```

This will generate a bar chart from the `t` table in `test.db`, mapping `x` to X-axis and `y` to Y-axis, without displaying it immediately.

---

## Python Usage

```python
from sqlviz.core import visualize_sql_cli

fig = visualize_sql_cli(
    db_uri="sqlite:///test.db",
    sql="SELECT * FROM t",
    chart_type="bar",
    show=True,
    kwargs_str='{"x": "x", "y": "y"}'
)
```

`fig` is a Plotly Figure object and can be further customized or saved.

---

## License

MIT License

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "sqlviz",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "sql, visualization, plotly, data, database",
    "author": null,
    "author_email": "Sai Krishna <eegasaikrishna.ai@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/b0/30/eafd847e511c321d9cc1925361b46a741c4c84e265c8f60ac2452d979e29/sqlviz-0.0.1.tar.gz",
    "platform": null,
    "description": "# SQLViz\r\n\r\nSQLViz is a Python library that allows you to query SQL databases and visualize the results directly using Plotly charts.\r\n\r\n---\r\n\r\n## Installation\r\n\r\n```bash\r\npip install sqlviz\r\n```\r\n\r\n---\r\n\r\n## Features\r\n\r\n* Query any SQL database supported by SQLAlchemy.\r\n* Generate charts (bar, line, scatter, etc.) from SQL queries.\r\n* CLI utility to quickly visualize SQL results.\r\n* Auto-detect x/y columns when not provided.\r\n\r\n---\r\n\r\n## CLI Usage\r\n\r\nYou can use SQLViz from the command line to generate charts directly from your database.\r\n\r\n### Syntax\r\n\r\n```bash\r\nsqlviz-cli --db-uri <DATABASE_URI> --sql \"<SQL_QUERY>\" --chart-type <CHART_TYPE> [--x <X_COLUMN>] [--y <Y_COLUMN>] [--show False]\r\n```\r\n\r\n### Parameters\r\n\r\n* `--db-uri`: SQLAlchemy database URI (e.g., `sqlite:///mydata.db`).\r\n* `--sql`: SQL query to fetch data.\r\n* `--chart-type`: Type of chart (`bar`, `line`, `scatter`, etc.).\r\n* `--x`: (Optional) Column name for X-axis.\r\n* `--y`: (Optional) Column name for Y-axis.\r\n* `--show`: Whether to display the chart immediately (default: True).\r\n\r\n### Example\r\n\r\n```bash\r\nsqlviz-cli --db-uri sqlite:///test.db --sql \"SELECT * FROM t\" --chart-type bar --x x --y y --show False\r\n```\r\n\r\nThis will generate a bar chart from the `t` table in `test.db`, mapping `x` to X-axis and `y` to Y-axis, without displaying it immediately.\r\n\r\n---\r\n\r\n## Python Usage\r\n\r\n```python\r\nfrom sqlviz.core import visualize_sql_cli\r\n\r\nfig = visualize_sql_cli(\r\n    db_uri=\"sqlite:///test.db\",\r\n    sql=\"SELECT * FROM t\",\r\n    chart_type=\"bar\",\r\n    show=True,\r\n    kwargs_str='{\"x\": \"x\", \"y\": \"y\"}'\r\n)\r\n```\r\n\r\n`fig` is a Plotly Figure object and can be further customized or saved.\r\n\r\n---\r\n\r\n## License\r\n\r\nMIT License\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python library for SQL query visualization with interactive charts using Plotly",
    "version": "0.0.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/saikrishna4348/sqlviz/issues",
        "Homepage": "https://github.com/saikrishna4348/sqlviz",
        "Repository": "https://github.com/saikrishna4348/sqlviz"
    },
    "split_keywords": [
        "sql",
        " visualization",
        " plotly",
        " data",
        " database"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "6d496d07e7329ba93ad35bf85baef56a5835a1c445e5a19d49f6e044e8467651",
                "md5": "42499c9f279af4e205c53a73d1ed8a84",
                "sha256": "6f5681df3c24a06d62adaa6ef18c92a1cb1677ac74bc5a3dc6decc93891642c0"
            },
            "downloads": -1,
            "filename": "sqlviz-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "42499c9f279af4e205c53a73d1ed8a84",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 3360,
            "upload_time": "2025-08-13T16:19:22",
            "upload_time_iso_8601": "2025-08-13T16:19:22.626541Z",
            "url": "https://files.pythonhosted.org/packages/6d/49/6d07e7329ba93ad35bf85baef56a5835a1c445e5a19d49f6e044e8467651/sqlviz-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b030eafd847e511c321d9cc1925361b46a741c4c84e265c8f60ac2452d979e29",
                "md5": "4ec71d037a6399052a197167fed27ca2",
                "sha256": "753d025ce15e0f4a5aa6ef59f53b4350aab0fffca25c38d7dacbc7975921a59c"
            },
            "downloads": -1,
            "filename": "sqlviz-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "4ec71d037a6399052a197167fed27ca2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 4492,
            "upload_time": "2025-08-13T16:19:23",
            "upload_time_iso_8601": "2025-08-13T16:19:23.939091Z",
            "url": "https://files.pythonhosted.org/packages/b0/30/eafd847e511c321d9cc1925361b46a741c4c84e265c8f60ac2452d979e29/sqlviz-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-13 16:19:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "saikrishna4348",
    "github_project": "sqlviz",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "sqlviz"
}
        
Elapsed time: 0.54375s