SQLViz
SQLViz is a Python library that allows you to query SQL databases and visualize the results directly using Plotly charts.
Installation
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
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
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
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
Metadata
Release files for sqlviz 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sqlviz-0.0.1.tar.gz | 4.5 kB | Without provenance | Details for sqlviz-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sqlviz-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for sqlviz-0.0.1-py3-none-any.whl |
Total release size: 7.9 kB
Release files / sqlviz-0.0.1.tar.gz
| Download URL | sqlviz-0.0.1.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
753d025ce15e0f4a5aa6ef59f53b4350aab0fffca25c38d7dacbc7975921a59c
|
|
BLAKE2b-256 checksum How to use checksums |
b030eafd847e511c321d9cc1925361b46a741c4c84e265c8f60ac2452d979e29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / sqlviz-0.0.1-py3-none-any.whl
| Download URL | sqlviz-0.0.1-py3-none-any.whl |
|---|---|
| Size | 3.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6f5681df3c24a06d62adaa6ef18c92a1cb1677ac74bc5a3dc6decc93891642c0
|
|
BLAKE2b-256 checksum How to use checksums |
6d496d07e7329ba93ad35bf85baef56a5835a1c445e5a19d49f6e044e8467651
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Security for sqlviz 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.