Registry / database / jupysql

jupysql

JSON →
library0.11.1pypypiunverified

JupySQL (version 0.11.1) enhances SQL interaction within Jupyter notebooks, allowing users to connect to various databases and execute queries directly using IPython magic commands. It supports advanced features like variable interpolation, caching, and data visualization. The project is actively maintained with frequent releases, typically every few weeks.

pip install jupysql
INSTALL
IMPORT
SIG · JUPYSQL
J
jupysql
databasepythonv0.11.1
Install
6.0s avg
Import
Disk
65MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.11.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 66.9MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 6.0s · import 0.000s · 66MB
65MB installed
● package 65MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

sql
import jupysql
import sql

This quickstart demonstrates how to load the JupySQL extension, connect to an in-memory SQLite database, create a table, insert data, and execute a simple SQL query using the `%sql` and `%%sql` magic commands.

# Load the JupySQL extension %load_ext sql # Connect to an in-memory SQLite database %sql sqlite:///:memory: # Create a table and insert some data %%sql CREATE TABLE employees ( id INTEGER PRIMARY KEY, name TEXT, department TEXT, salary INTEGER ); INSERT INTO employees (id, name, department, salary) VALUES (1, 'Alice', 'Sales', 50000), (2, 'Bob', 'Marketing', 60000), (3, 'Charlie', 'Sales', 55000); # Query the data %sql SELECT * FROM employees WHERE department = 'Sales';
Debug
Known issues
breakingThe `jupysql.configure` function's arguments `display_limit` and `style` were changed. `display_limit` was renamed to `result_limit`, and `style` was moved to `jupysql.plot.configure_styles`.
fix
Update your `jupysql.configure` calls:
- Replace `display_limit` with `result_limit`.
- For style configuration, use `from jupysql import plot; plot.configure_styles(...)`.
affects: Prior to 0.10.0
gotchaJupySQL's primary functionality relies on IPython magic commands (`%sql`, `%%sql`). These require `%load_ext sql` to be run at the beginning of each new notebook or IPython session.
fix
Always include `%load_ext sql` as the first line in your Jupyter notebooks or when starting an interactive IPython session where you intend to use JupySQL magic commands.
affects: All versions
gotchaJupySQL uses `{{variable}}` syntax for Python variable interpolation within SQL queries, which differs from standard f-strings or `.format()` methods.
fix
When embedding Python variables into SQL queries, use the double curly brace syntax: `my_var = 'Sales'; %sql SELECT * FROM employees WHERE department = '{{my_var}}'`.
affects: All versions
Upgrade
Version history
0.11.1latest on PyPI · released Mar 25, 2025
Audit
Dependencies
sqlalchemyrequiredCore ORM and SQL toolkit used for database connectivity.
psycopg2optionalPostgreSQL driver. Install via `jupysql[postgres]` extra.
pymysqloptionalMySQL driver. Install via `jupysql[mysql]` extra.
Agent activity
11 hits · last 30 days
node
10
Amazon
1
Resources
jupysql — pip install jupysql · libregistry