sqlalchemy 2.0.41


pip install sqlalchemy

  Latest version

Released: May 14, 2025


Meta
Author: Mike Bayer
Requires Python: >=3.7

Classifiers

Development Status
  • 5 - Production/Stable

Intended Audience
  • Developers

Operating System
  • OS Independent

Programming Language
  • Python
  • Python :: 3
  • Python :: 3.7
  • Python :: 3.8
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: Implementation :: CPython
  • Python :: Implementation :: PyPy

Topic
  • Database :: Front-Ends

PyPI PyPI - Python Version 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.

  • All primary and foreign key constraints are assumed to 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.

Getting Help / Development / Bug reporting

Please refer to the SQLAlchemy Community Guide.

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.

License

SQLAlchemy is distributed under the MIT license.

2.0.41 May 14, 2025
2.0.40 Mar 27, 2025
2.0.39 Mar 11, 2025
2.0.38 Feb 06, 2025
2.0.37 Jan 09, 2025
2.0.36 Oct 15, 2024
2.0.35 Sep 16, 2024
2.0.34 Sep 04, 2024
2.0.33 Sep 03, 2024
2.0.32 Aug 05, 2024
2.0.31 Jun 18, 2024
2.0.30 May 05, 2024
2.0.29 Mar 23, 2024
2.0.28 Mar 04, 2024
2.0.27 Feb 13, 2024
2.0.26 Feb 11, 2024
2.0.25 Jan 03, 2024
2.0.24 Dec 28, 2023
2.0.23 Nov 02, 2023
2.0.22 Oct 12, 2023
2.0.21 Sep 18, 2023
2.0.20 Aug 15, 2023
2.0.19 Jul 15, 2023
2.0.18 Jul 05, 2023
2.0.17 Jun 23, 2023
2.0.16 Jun 10, 2023
2.0.15 May 20, 2023
2.0.14 May 18, 2023
2.0.13 May 10, 2023
2.0.12 Apr 30, 2023
2.0.11 Apr 27, 2023
2.0.10 Apr 21, 2023
2.0.9 Apr 05, 2023
2.0.8 Mar 31, 2023
2.0.7 Mar 18, 2023
2.0.6 Mar 13, 2023
2.0.5.post1 Mar 06, 2023
2.0.5 Mar 06, 2023
2.0.4 Feb 17, 2023
2.0.3 Feb 10, 2023
2.0.2 Feb 07, 2023
2.0.1 Feb 01, 2023
2.0.0 Jan 26, 2023
2.0.0rc3 Jan 19, 2023
2.0.0rc2 Jan 09, 2023
2.0.0rc1 Dec 28, 2022
2.0.0b4 Dec 05, 2022
2.0.0b3 Nov 04, 2022
2.0.0b2 Oct 20, 2022
2.0.0b1 Oct 13, 2022
1.4.54 Sep 05, 2024
1.4.53 Jul 29, 2024
1.4.52 Mar 04, 2024
1.4.51 Jan 03, 2024
1.4.50 Oct 29, 2023
1.4.49 Jul 05, 2023
1.4.48 Apr 30, 2023
1.4.47 Mar 18, 2023
1.4.46 Jan 03, 2023
1.4.45 Dec 10, 2022
1.4.44 Nov 12, 2022
1.4.43 Nov 04, 2022
1.4.42 Oct 16, 2022
1.4.41 Sep 07, 2022
1.4.40 Aug 08, 2022
1.4.39 Jun 24, 2022
1.4.38 Jun 23, 2022
1.4.37 May 31, 2022
1.4.36 Apr 26, 2022
1.4.35 Apr 06, 2022
1.4.34 Mar 31, 2022
1.4.33 Mar 31, 2022
1.4.32 Mar 06, 2022
1.4.31 Jan 21, 2022
1.4.30 Jan 19, 2022
1.4.29 Dec 23, 2021
1.4.28 Dec 09, 2021
1.4.27 Nov 11, 2021
1.4.26 Oct 19, 2021
1.4.25 Sep 23, 2021
1.4.24 Sep 22, 2021
1.4.23 Aug 18, 2021
1.4.22 Jul 22, 2021
1.4.21 Jul 14, 2021
1.4.20 Jun 28, 2021
1.4.19 Jun 23, 2021
1.4.18 Jun 10, 2021
1.4.17 May 29, 2021
1.4.16 May 28, 2021
1.4.15 May 11, 2021
1.4.14 May 06, 2021
1.4.13 May 03, 2021
1.4.12 Apr 29, 2021
1.4.11 Apr 22, 2021
1.4.10 Apr 21, 2021
1.4.9 Apr 17, 2021
1.4.8 Apr 15, 2021
1.4.7 Apr 09, 2021
1.4.6 Apr 06, 2021
1.4.5 Apr 02, 2021
1.4.4 Mar 31, 2021
1.4.3 Mar 25, 2021
1.4.2 Mar 19, 2021
1.4.1 Mar 17, 2021
1.4.0 Mar 15, 2021
1.4.0b3 Feb 15, 2021
1.4.0b2 Feb 03, 2021
1.4.0b1 Nov 02, 2020
1.3.24 Mar 30, 2021
1.3.23 Feb 01, 2021
1.3.22 Dec 18, 2020
1.3.21 Dec 17, 2020
1.3.20 Oct 12, 2020
1.3.19 Aug 17, 2020
1.3.18 Jun 25, 2020
1.3.17 May 13, 2020
1.3.16 Apr 08, 2020
1.3.15 Mar 11, 2020
1.3.14 Mar 10, 2020
1.3.13 Jan 22, 2020
1.3.12 Dec 16, 2019
1.3.11 Nov 11, 2019
1.3.10 Oct 10, 2019
1.3.9 Oct 04, 2019
1.3.8 Aug 27, 2019
1.3.7 Aug 14, 2019
1.3.6 Jul 21, 2019
1.3.5 Jun 17, 2019
1.3.4 May 28, 2019
1.3.3 Apr 15, 2019
1.3.2 Apr 02, 2019
1.3.1 Mar 09, 2019
1.3.0 Mar 04, 2019
1.3.0b3 Feb 08, 2019
1.3.0b2 Jan 26, 2019
1.3.0b1 Nov 17, 2018
1.2.19 Apr 15, 2019
1.2.18 Feb 15, 2019
1.2.17 Jan 26, 2019
1.2.16 Jan 11, 2019
1.2.15 Dec 11, 2018
1.2.14 Nov 10, 2018
1.2.13 Oct 31, 2018
1.2.12 Sep 19, 2018
1.2.11 Aug 20, 2018
1.2.10 Jul 13, 2018
1.2.9 Jun 29, 2018
1.2.8 May 28, 2018
1.2.7 Apr 20, 2018
1.2.6 Mar 30, 2018
1.2.5 Mar 06, 2018
1.2.4 Feb 22, 2018
1.2.3 Feb 16, 2018
1.2.2 Jan 25, 2018
1.2.1 Jan 15, 2018
1.2.0 Dec 27, 2017
1.2.0b3 Oct 13, 2017
1.2.0b2 Jul 24, 2017
1.2.0b1 Jul 10, 2017
1.1.18 Mar 06, 2018
1.1.17 Feb 22, 2018
1.1.16 Feb 16, 2018
1.1.15 Nov 03, 2017
1.1.14 Sep 05, 2017
1.1.13 Aug 03, 2017
1.1.12 Jul 24, 2017
1.1.11 Jun 19, 2017
1.1.10 May 19, 2017
1.1.9 Apr 04, 2017
1.1.8 Mar 31, 2017
1.1.7 Mar 27, 2017
1.1.6 Feb 28, 2017
1.1.5 Jan 17, 2017
1.1.4 Nov 15, 2016
1.1.3 Oct 27, 2016
1.1.2 Oct 17, 2016
1.1.1 Oct 07, 2016
1.1.0 Oct 05, 2016
1.1.0b3 Jul 26, 2016
1.1.0b2 Jul 01, 2016
1.1.0b1 Jun 16, 2016
1.0.19 Aug 03, 2017
1.0.18 Jul 24, 2017
1.0.17 Jan 17, 2017
1.0.16 Nov 15, 2016
1.0.15 Sep 01, 2016
1.0.14 Jul 06, 2016
1.0.13 May 16, 2016
1.0.12 Feb 15, 2016
1.0.11 Dec 23, 2015
1.0.10 Dec 11, 2015
1.0.9 Oct 20, 2015
1.0.8 Jul 23, 2015
1.0.7 Jul 20, 2015
1.0.6 Jun 25, 2015
1.0.5 Jun 07, 2015
1.0.4 May 08, 2015
1.0.3 May 01, 2015
1.0.2 Apr 24, 2015
1.0.1 Apr 23, 2015
1.0.0 Apr 16, 2015
1.0.0b5 Apr 03, 2015
1.0.0b4 Mar 29, 2015
1.0.0b3 Mar 20, 2015
1.0.0b2 Mar 20, 2015
1.0.0b1 Mar 13, 2015
0.9.10 Jul 22, 2015
0.9.9 Mar 10, 2015
0.9.8 Oct 13, 2014
0.9.7 Jul 22, 2014
0.9.6 Jun 23, 2014
0.9.5 Jun 23, 2014
0.9.4 Mar 28, 2014
0.9.3 Feb 20, 2014
0.9.2 Feb 03, 2014
0.9.1 Jan 06, 2014
0.9.0 Dec 30, 2013
0.8.7 Jul 22, 2014
0.8.6 Mar 28, 2014
0.8.5 Feb 20, 2014
0.8.4 Dec 08, 2013
0.8.3 Oct 26, 2013
0.8.2 Jul 03, 2013
0.8.1 Apr 27, 2013
0.8.0 Mar 10, 2013
0.8.0b2 Dec 14, 2012
0.7.10 Feb 08, 2013
0.7.9 Oct 02, 2012
0.7.8 Jun 17, 2012
0.7.7 May 06, 2012
0.7.6 Mar 15, 2012
0.7.5 Jan 28, 2012
0.7.4 Dec 09, 2011
0.7.3 Oct 16, 2011
0.7.2 Aug 01, 2011
0.7.1 Jun 05, 2011
0.7.0 May 21, 2011
0.6.9 May 06, 2012
0.6.8 Jun 05, 2011
0.6.7 Apr 14, 2011
0.6.6 Jan 08, 2011
0.6.5 Oct 24, 2010
0.6.4 Sep 07, 2010
0.6.3 Jul 15, 2010
0.6.2 Jul 06, 2010
0.6.1 May 31, 2010
0.6.0 Apr 19, 2010
0.6b3 Mar 28, 2010
0.6b2 Mar 20, 2010
0.6b1 Feb 03, 2010
0.5.8 Jan 16, 2010
0.5.7 Dec 27, 2009
0.5.6 Sep 13, 2009
0.5.5 Jul 13, 2009
0.5.4 May 18, 2009
0.5.3 Mar 25, 2009
0.5.2 Jan 24, 2009
0.5.1 Jan 17, 2009
0.5.0 Jan 06, 2009
0.5.0rc4 Nov 14, 2008
0.5.0rc3 Nov 07, 2008
0.5.0rc2 Oct 12, 2008
0.5.0rc1 Sep 11, 2008
0.5.0b3 Aug 04, 2008
0.5.0b2 Jul 14, 2008
0.5.0b1 Jun 12, 2008
0.4.8 Oct 12, 2008
0.4.7 Jul 26, 2008
0.4.6 May 14, 2008
0.4.5 Apr 04, 2008
0.4.4 Mar 12, 2008
0.4.3 Feb 14, 2008
0.4.2 Jan 02, 2008
0.4.2b0 Jan 07, 2008
0.4.2a0 Jan 05, 2008
0.4.1 Nov 18, 2007
0.4.0 Oct 17, 2007
0.4.0b6 Sep 27, 2007
0.4.0b5 Sep 02, 2007
0.4.0b4 Aug 22, 2007
0.4.0b3 Aug 16, 2007
0.4.0b2 Aug 14, 2007
0.4.0b1 Aug 12, 2007
0.3.11 Oct 14, 2007
0.3.10 Jul 20, 2007
0.3.9 Jul 15, 2007
0.3.8 Jun 02, 2007
0.3.7 Apr 30, 2007
0.3.6 Mar 23, 2007
0.3.5 Feb 22, 2007
0.3.4 Jan 23, 2007
0.3.3 Dec 15, 2006
0.3.2 Dec 10, 2006
0.3.1 Nov 12, 2006
0.3.0 Oct 22, 2006
0.2.8 Sep 05, 2006
0.2.7 Aug 12, 2006
0.2.6 Jul 20, 2006
0.2.5 Jul 08, 2006
0.2.4 Jun 28, 2006
0.2.3 Jun 17, 2006
0.2.2 Jun 05, 2006
0.2.1 May 29, 2006
0.2.0 May 27, 2006
0.1.7 May 05, 2006
0.1.6 Apr 12, 2006
0.1.5 Mar 27, 2006
0.1.4 Mar 13, 2006
0.1.3 Mar 02, 2006
0.1.2 Feb 24, 2006
0.1.1 Feb 23, 2006
0.1.0 Feb 14, 2006
0.0rc0 Feb 23, 2006

Wheel compatibility matrix

Platform CPython 3.7 CPython 3.8 CPython 3.9 CPython 3.10 CPython 3.11 CPython 3.12 CPython 3.13 Python 3
any
macosx_10_13_x86_64
macosx_10_9_x86_64
macosx_11_0_arm64
manylinux2014_aarch64
manylinux2014_x86_64
manylinux_2_17_aarch64
manylinux_2_17_x86_64
musllinux_1_2_aarch64
musllinux_1_2_x86_64
win32
win_amd64

Files in release

SQLAlchemy-2.0.41-cp37-cp37m-macosx_10_9_x86_64.whl (2.0MiB)
SQLAlchemy-2.0.41-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.9MiB)
SQLAlchemy-2.0.41-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.9MiB)
SQLAlchemy-2.0.41-cp37-cp37m-musllinux_1_2_aarch64.whl (2.8MiB)
SQLAlchemy-2.0.41-cp37-cp37m-musllinux_1_2_x86_64.whl (2.9MiB)
SQLAlchemy-2.0.41-cp37-cp37m-win32.whl (2.0MiB)
SQLAlchemy-2.0.41-cp37-cp37m-win_amd64.whl (2.0MiB)
sqlalchemy-2.0.41-cp310-cp310-macosx_10_9_x86_64.whl (2.0MiB)
sqlalchemy-2.0.41-cp310-cp310-macosx_11_0_arm64.whl (2.0MiB)
sqlalchemy-2.0.41-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.0MiB)
sqlalchemy-2.0.41-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.0MiB)
sqlalchemy-2.0.41-cp310-cp310-musllinux_1_2_aarch64.whl (3.0MiB)
sqlalchemy-2.0.41-cp310-cp310-musllinux_1_2_x86_64.whl (3.0MiB)
sqlalchemy-2.0.41-cp310-cp310-win32.whl (2.0MiB)
sqlalchemy-2.0.41-cp310-cp310-win_amd64.whl (2.0MiB)
sqlalchemy-2.0.41-cp311-cp311-macosx_10_9_x86_64.whl (2.0MiB)
sqlalchemy-2.0.41-cp311-cp311-macosx_11_0_arm64.whl (2.0MiB)
sqlalchemy-2.0.41-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.1MiB)
sqlalchemy-2.0.41-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1MiB)
sqlalchemy-2.0.41-cp311-cp311-musllinux_1_2_aarch64.whl (3.1MiB)
sqlalchemy-2.0.41-cp311-cp311-musllinux_1_2_x86_64.whl (3.1MiB)
sqlalchemy-2.0.41-cp311-cp311-win32.whl (2.0MiB)
sqlalchemy-2.0.41-cp311-cp311-win_amd64.whl (2.0MiB)
sqlalchemy-2.0.41-cp312-cp312-macosx_10_13_x86_64.whl (2.0MiB)
sqlalchemy-2.0.41-cp312-cp312-macosx_11_0_arm64.whl (2.0MiB)
sqlalchemy-2.0.41-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.1MiB)
sqlalchemy-2.0.41-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2MiB)
sqlalchemy-2.0.41-cp312-cp312-musllinux_1_2_aarch64.whl (3.1MiB)
sqlalchemy-2.0.41-cp312-cp312-musllinux_1_2_x86_64.whl (3.1MiB)
sqlalchemy-2.0.41-cp312-cp312-win32.whl (2.0MiB)
sqlalchemy-2.0.41-cp312-cp312-win_amd64.whl (2.0MiB)
sqlalchemy-2.0.41-cp313-cp313-macosx_10_13_x86_64.whl (2.0MiB)
sqlalchemy-2.0.41-cp313-cp313-macosx_11_0_arm64.whl (2.0MiB)
sqlalchemy-2.0.41-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.1MiB)
sqlalchemy-2.0.41-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1MiB)
sqlalchemy-2.0.41-cp313-cp313-musllinux_1_2_aarch64.whl (3.0MiB)
sqlalchemy-2.0.41-cp313-cp313-musllinux_1_2_x86_64.whl (3.0MiB)
sqlalchemy-2.0.41-cp313-cp313-win32.whl (2.0MiB)
sqlalchemy-2.0.41-cp313-cp313-win_amd64.whl (2.0MiB)
sqlalchemy-2.0.41-cp38-cp38-macosx_10_9_x86_64.whl (2.0MiB)
sqlalchemy-2.0.41-cp38-cp38-macosx_11_0_arm64.whl (2.0MiB)
sqlalchemy-2.0.41-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.1MiB)
sqlalchemy-2.0.41-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1MiB)
sqlalchemy-2.0.41-cp38-cp38-musllinux_1_2_aarch64.whl (3.0MiB)
sqlalchemy-2.0.41-cp38-cp38-musllinux_1_2_x86_64.whl (3.0MiB)
sqlalchemy-2.0.41-cp38-cp38-win32.whl (2.0MiB)
sqlalchemy-2.0.41-cp38-cp38-win_amd64.whl (2.0MiB)
sqlalchemy-2.0.41-cp39-cp39-macosx_10_9_x86_64.whl (2.0MiB)
sqlalchemy-2.0.41-cp39-cp39-macosx_11_0_arm64.whl (2.0MiB)
sqlalchemy-2.0.41-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.0MiB)
sqlalchemy-2.0.41-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.0MiB)
sqlalchemy-2.0.41-cp39-cp39-musllinux_1_2_aarch64.whl (3.0MiB)
sqlalchemy-2.0.41-cp39-cp39-musllinux_1_2_x86_64.whl (3.0MiB)
sqlalchemy-2.0.41-cp39-cp39-win32.whl (2.0MiB)
sqlalchemy-2.0.41-cp39-cp39-win_amd64.whl (2.0MiB)
sqlalchemy-2.0.41-py3-none-any.whl (1.8MiB)
sqlalchemy-2.0.41.tar.gz (9.2MiB)
Extras:
Dependencies:
typing-extensions (>=4.6.0)
greenlet and ( or ( or ( or ( or ( or ( or )))))) (>=1)
importlib-metadata