jupysql
Better SQL in Jupyter
Decision gist · record as of 2026-08-14
Yes, if you work regularly in Jupyter and need to query databases. Low install friction, active maintenance, permissive license, and no known vulnerabilities make it a straightforward addition. The Alpha status means the API may shift, but 848 stars and ongoing commits suggest it is stable enough for exploratory and development work. Not necessary if you already have a preferred SQL IDE or if your workflow rarely involves database queries from notebooks.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Jupyter or IPython environment; a database connection string must be configured before queries will execute.
- Low install friction with a pure-Python wheel.
- Active maintenance (last commit 2026-06-29) and 848 repository stars suggest ongoing community use.
License · maintenance · safety
permissive license (permissive) — Permissive Apache license allows commercial and private use without restriction, making it suitable for any deployment context.
last release 2025-03-25 (507 days) · last repo commit 2026-06-29 · 848 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 156,088 downloads/mo, #10,793 on PyPI
Alternatives
Verify before relying
pip install jupysql
In Jupyter:
%load_ext sql
%sql SELECT * FROM table_name- Whether all advertised integrations (Pandas, DuckDB, plotting) are included in version 0.11.1 or require additional setup.
- Minimum Python version and compatibility with recent Jupyter/IPython releases.
- Performance characteristics when querying large datasets despite the advertised memory-efficient plotting.
What it is and what it does
JupySQL is a Jupyter/IPython extension that lets you write and execute SQL queries directly in notebook cells using `%sql` (single-line) and `%%sql` (multi-line) magic commands. It acts as a SQL client for Jupyter, bridging the gap between notebook Python code and external databases. The package depends on sqlalchemy for database abstraction, sqlparse for SQL parsing, jinja2 for templating, and several IPython utilities to integrate seamlessly into the notebook environment.
The package is designed to make exploratory data analysis and SQL development more natural in notebooks by eliminating the need to switch between tools. It supports multiple database backends (PostgreSQL, MySQL, DuckDB, and others via SQLAlchemy) and offers features like Pandas integration for downstream Python processing, SQL composition helpers, and memory-efficient plotting of large result sets. It is currently in Alpha status (Development Status 3), indicating active development but potential API changes.
Use it for
- Run ad-hoc SQL queries against production or analytical databases directly from a Jupyter notebook without leaving your analysis environment.
- Compose and debug complex SQL queries using templating and composition features, then pass results to Pandas for further Python-based analysis.
- Visualize query results without loading entire datasets into memory by using the built-in plotting capabilities.
- Prototype data pipelines in notebooks by mixing SQL queries with Python logic in a single, reproducible document.
- Explore DuckDB or other SQLAlchemy-supported databases interactively without writing boilerplate connection code.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you work regularly in Jupyter and need to query databases.
Low install friction, active maintenance, permissive license, and no known vulnerabilities make it a straightforward addition. The Alpha status means the API may shift, but 848 stars and ongoing commits suggest it is stable enough for exploratory and development work. Not necessary if you already have a preferred SQL IDE or if your workflow rarely involves database queries from notebooks.
Install
jupysql on PyPI
Before you install
Low install friction with a pure-Python wheel. Active maintenance (last commit 2026-06-29) and 848 repository stars suggest ongoing community use. Ten runtime dependencies are manageable and well-established (sqlalchemy, ipython, jinja2, sqlparse, prettytable, sqlglot, and others).
Requires Jupyter or IPython environment; a database connection string must be configured before queries will execute.
License in practice
Permissive Apache license allows commercial and private use without restriction, making it suitable for any deployment context.
Quickstart
pip install jupysql
In Jupyter:
%load_ext sql
%sql SELECT * FROM table_name
Verify before relying
- Whether all advertised integrations (Pandas, DuckDB, plotting) are included in version 0.11.1 or require additional setup.
- Minimum Python version and compatibility with recent Jupyter/IPython releases.
- Performance characteristics when querying large datasets despite the advertised memory-efficient plotting.
Package facts
| License | permissive license permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 10 packagesprettytableipythonsqlalchemysqlparseipython-genutilsjinja2sqlglotimportlib-metadatajupysql-pluginploomber-core |
| Maintenance | Actively maintained 507 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 156,088 / month, #10,793 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 3 - AlphaEnvironment :: ConsoleLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3Topic :: DatabaseTopic :: Database :: Front-Ends |
Evidence: jupysql-0.11.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “sql in jupyter notebooks”
- jupysqlAdds SQL execution to Jupyter and IPython notebooks via `%sql` and…
- ipython-sqlAdds SQL magic commands to IPython and Jupyter notebooks, letting you…
- bigquery-magicsProvides IPython magic commands to query Google BigQuery directly…
Give your agent the search over MCP, or paste the wish link into any chat.
More Database packages
psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.
Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.
Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.
YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.
Install it if you need to connect Python applications to YDB databases.
Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.
sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.
Install it if you need to manipulate, format, or analyze SQL text programmatically.
Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.
See also ipython-sql · jupysql-plugin · bigquery-magics · pgspecial · duckdb-engine · fastlite · emr-notebooks-magics · jupyter-dash · duckdb · ipython