Pythie
CategoriesTrending
An open index of Python tools.Pythie’s IndexLegal noticePrivacyData: PyPI (package metadata; download statistics under CC BY 4.0, via ClickHouse), deps.dev (CC BY 4.0), GitHub, OSV.

SQLAlchemy

2.1.9ActivePythie’s Index: 88

Database Abstraction Library

Actively maintained. Last release 13 days ago, commits in 26 of the last 26 weeks. A safe choice.

Databases & ORMs
$pip install sqlalchemy
sqlalchemy/sqlalchemyHomepageDocsPyPI
SQLAlchemy ========== |PyPI| |Python| |Downloads| .. |PyPI| image:: https://img.shields.io/pypi/v/sqlalchemy :target: https://pypi.org/project/sqlalchemy :alt: PyPI .. |Python| image:: https://img.shields.io/pypi/pyversions/sqlalchemy :target: https://pypi.org/project/sqlalchemy :alt: PyPI - Python Version .. |Downloads| image:: https://static.pepy.tech/badge/sqlalchemy/month :target: https://pepy.tech/project/sqlalchemy :alt: PyPI - Downloads The Python SQL Toolkit and Object Relational Mapper Introduction ------------- SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL. SQLAlchemy provides a full suite of well known enterprise-level persistence patterns, designed for efficient and high-performing database access, adapted into a simple and Pythonic domain language. Major SQLAlchemy features include: * An industrial strength ORM, built from the core on the identity map, unit of work, and data mapper patterns. These patterns allow transparent persistence of objects using a declarative configuration system. Domain models can be constructed and manipulated naturally, and changes are synchronized with the current transaction automatically. * A relationally-oriented query system, exposing the full range of SQL's capabilities explicitly, including joins, subqueries, correlation, and most everything else, in terms of the object model. Writing queries with the ORM uses the same techniques of relational composition you use when writing SQL. While you can drop into literal SQL at any time, it's virtually never needed. * A comprehensive and flexible system of eager loading for related collections and objects. Collections are cached within a session, and can be loaded on individual access, all at once using joins, or by query per collection across the full result set. * A Core SQL construction system and DBAPI interaction layer. The SQLAlchemy Core is separate from the ORM and is a full database abstraction layer in its own right, and includes an extensible Python-based SQL expression language, schema metadata, connection pooling, type coercion, and custom types. * Primary and foreign key constraints may be composite and natural. Surrogate integer primary keys are of course still the norm, but SQLAlchemy never assumes or hardcodes to this model. * Database introspection and generation. Database schemas can be "reflected" in one step into Python structures representing database metadata; those same structures can then generate CREATE statements right back out - all within the Core, independent of the ORM. SQLAlchemy's philosophy: * SQL databases behave less and less like object collections the more size and performance start to matter; object collections behave less and less like tables and rows the more abstraction starts to matter. SQLAlchemy aims to accommodate both of these principles. * An ORM doesn't need to hide the "R". A relational database provides rich, set-based functionality that should be fully exposed. SQLAlchemy's ORM provides an open-ended set of patterns that allow a developer to construct a custom mediation layer between a domain model and a relational schema, turning the so-called "object relational impedance" issue into a distant memory. * The developer, in all cases, makes all decisions regarding the design, structure, and naming conventions of both the object model as well as the relational schema. SQLAlchemy only provides the means to automate the execution of these decisions. * With SQLAlchemy, there's no such thing as "the ORM generated a bad query" - you retain full control over the structure of queries, including how joins are organized, how subqueries and correlation is used, what columns are requested. Everything SQLAlchemy does is ultimately the result of a developer-initiated decision. * Don't use an ORM if the problem doesn't need one. SQLAlchemy consists of a Core and separate ORM component. The Core offers a full SQL expression language that allows Pythonic construction of SQL constructs that render directly to SQL strings for a target database, returning result sets that are essentially enhanced DBAPI cursors. * Transactions should be the norm. With SQLAlchemy's ORM, nothing goes to permanent storage until commit() is called. SQLAlchemy encourages applications to create a consistent means of delineating the start and end of a series of operations. * Never render a literal value in a SQL statement. Bound parameters are used to the greatest degree possible, allowing query optimizers to cache query plans effectively and making SQL injection attacks a non-issue. Documentation ------------- Latest documentation is at: https://www.sqlalchemy.org/docs/ Installation / Requirements --------------------------- Full documentation for installation is at `Installation <https://www.sqlalchemy.org/docs/intro.html#installation>`_. Getting Help / Development / Bug reporting ------------------------------------------ Please refer to the `SQLAlchemy Community Guide <https://www.sqlalchemy.org/support.html>`_. Code of Conduct --------------- Above all, SQLAlchemy places great emphasis on polite, thoughtful, and constructive communication between users and developers. Please see our current Code of Conduct at `Code of Conduct <https://www.sqlalchemy.org/codeofconduct.html>`_. License ------- SQLAlchemy is distributed under the `MIT license <https://www.opensource.org/licenses/mit-license.php>`_.

Popularity

Downloads / month
429.4M
GitHub stars
12.3K
Downloads, last 7 days
101.9M-2%
Stars, last 7 days
–
Direct dependents
10.5K
All dependents
23.6K

Pythie’s Index

How it works
88

Healthy

Maintenance, out of 100

  • Recent release

    last release 12 days ago

  • Commit activity

    26/26 weeks with commits

  • Release cadence

    29 releases in 12 months

  • Issues & PRs handled

    95% closed in the past year

  • Contributor spread

    12 authors in last 100 commits

  • OpenSSF Scorecard

    5.2/10

Commits, last 26 weeks453

Releases

Latest
2.1.9
Released
Nov 16, 2026
Releases, 12 months
29
First release
Feb 14, 2006

Compatibility

Requires Python
>=3.11
Tested on
3.11 · 3.12 · 3.13 · 3.14 · 3.15
License
MIT (Permissive)

Keywords

sqlalchemysqlpython

Alternatives

Use instead of SQLAlchemy: tools that do the same job, closest first.

Compare with tortoise-orm →Compare with PyPika →Compare with pony →Compare all 4 →

  • tortoise-orm1.1.9ActivePythie’s Index: 87

    Easy async ORM for python, built with relations in mind

    Databases & ORMs5.6K700.4K/moReleased Oct 14, 2026
  • PyPika0.51.1ActivePythie’s Index: 61

    A SQL query builder API for Python

    Databases & ORMs2.9K9.7M/moReleased Feb 4, 2026
  • pony0.7.20ActivePythie’s Index: 45

    Pony Object-Relational Mapper

    Databases & ORMs3.8K939K/moReleased Aug 9, 2026
  • peewee4.5.3ActivePythie’s Index: 84

    a little orm

    Databases & ORMs12K41M/moReleased Oct 7, 2026
  • prisma0.15.0ArchivedPythie’s Index: 4

    Prisma Client Python is an auto-generated and fully type-safe database client

    Databases & ORMsValidation & Serialization2.1K1.5M/moReleased Aug 16, 2024
  • piccolo1.39.0ActivePythie’s Index: 78

    A fast, user friendly ORM and query builder which supports asyncio.

    Databases & ORMsWeb Frameworks2K706.7K/moReleased Oct 28, 2026

Works well with

Use together with SQLAlchemy: extensions, drivers, servers and companion tools.

  • alembicPythie’s Index: 87A database migration tool for SQLAlchemy.240.6M downloads/mo
  • PyMySQLPythie’s Index: 88Pure Python MySQL Driver84.8M downloads/mo
  • psycopgPythie’s Index: 84PostgreSQL database adapter for Python230.9M downloads/mo
  • sqlmodelPythie’s Index: 88SQLModel, SQL databases in Python, designed for simplicity, compatibility, and robustness.28.7M downloads/mo
  • psycopg2Pythie’s Index: 52psycopg2 - Python-PostgreSQL Database Adapter60.4M downloads/mo
  • pyodbcPythie’s Index: 69DB API module for ODBC31M downloads/mo