--- id: jupysql version: "0.11.1" license: unclear license_treatment: permissive maintenance: active --- # jupysql — Better SQL in Jupyter License: permissive · Maintenance: active · Downloads: 156.1K/mo ## 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 above — verify before relying. Adds SQL execution to Jupyter and IPython notebooks via `%sql` and `%%sql` magic commands, letting you query databases directly in cells and integrate results with Python. 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 pip install jupysql uv add jupysql poetry add jupysql ## Installing jupysql 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). 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 Requires Jupyter or IPython environment; a database connection string must be configured before queries will execute. 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: not declared (permissive) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 156.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags sql in jupyter notebooks, ipython sql magic, query databases from jupyter, sql jupyter integration, run sql in notebooks, jupyter database client, sql magic commands, jupyter-extension, sql-client, notebook-integration [View on SkillFed](https://skillfed.io/packages/jupysql) · [View on PyPI](https://pypi.org/project/jupysql/)