--- id: ipython-sql version: "0.5.0" license: MIT license_treatment: permissive maintenance: dormant --- # ipython-sql — RDBMS access via IPython License: permissive · Maintenance: dormant · Downloads: 387.7K/mo ## What it is and what it does ipython-sql is a magic command extension for IPython and Jupyter notebooks that lets you write and execute SQL queries directly in notebook cells. It connects to any database supported by SQLAlchemy—PostgreSQL, MySQL, SQLite, Oracle, and others—using standard SQLAlchemy connection strings. Once connected, you can issue queries with %sql (single-line) or %%sql (multi-line) magic, and results are returned as objects you can iterate over, access by column name, or convert to Pandas DataFrames. The package handles multiple simultaneous database connections, supports variable substitution and bind parameters, and lets you capture query results into Python variables for further analysis. It's designed for exploratory data work and ad-hoc querying in notebooks, where switching between SQL and Python would otherwise require separate tools or boilerplate connection code. Use it for: - Exploratory data analysis in Jupyter: query a database and immediately plot or analyze results in the same notebook. - Prototyping SQL queries interactively without leaving the notebook environment. - Teaching SQL or databases in a classroom setting where students can write and test queries live. - Combining SQL queries with Python data processing: fetch data, transform it, and visualize it in one workflow. - Quick ad-hoc reporting from a database without setting up a separate reporting tool. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Adds SQL magic commands to IPython and Jupyter notebooks, letting you query databases directly from cells using SQLAlchemy connection strings. Yes, if you work regularly in Jupyter or IPython and need to query databases interactively. The low install friction and permissive license make it a low-risk addition. However, the dormant maintenance status (last release over a year ago, Alpha classification) means you should verify compatibility with your Python and IPython versions before relying on it for production workflows. No known security vulnerabilities. ## Install pip install ipython-sql uv add ipython-sql poetry add ipython-sql ## Installing ipython-sql Before you install: Low install friction with a pure-Python wheel and six runtime dependencies. Maintenance is dormant—last release was 2023-02-27, over a year ago, though the repository remains active with 1797 stars and no archived status. License in practice: MIT license is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions. Quickstart: pip install ipython-sql In IPython or Jupyter: %load_ext sql %%sql postgresql://user:password@localhost/dbname SELECT * FROM table LIMIT 5; Requires IPython or Jupyter to be installed and running; database driver for your target database (e.g., psycopg2 for PostgreSQL) must be installed separately. Verify before relying: - Whether the package works with modern Python versions (3.9+) given its Alpha status and dormant maintenance. - Current compatibility with recent IPython and SQLAlchemy versions. - Whether all six runtime dependencies are actively maintained and free of vulnerabilities. ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 387.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags sql in jupyter notebook, ipython database query, sql magic command, query postgresql from notebook, interactive sql shell, sqlalchemy ipython integration, database access jupyter, jupyter-integration, sql-query-tool, interactive-analysis [View on SkillFed](https://skillfed.io/packages/ipython-sql) · [View on PyPI](https://pypi.org/project/ipython-sql/)