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://img.shields.io/pypi/dm/sqlalchemy :target: https://pypi.org/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. * 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 <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>`_.

Release History

Subscribe above to receive notifications when new versions are released.
Version Date Stability
2.0.7 Mar 18, 2023 stable
1.4.47 Mar 18, 2023 stable
2.0.6 Mar 13, 2023 stable
2.0.5 Mar 6, 2023 stable
2.0.5.post1 Mar 6, 2023 unknown
2.0.4 Feb 17, 2023 stable
2.0.3 Feb 10, 2023 stable
2.0.2 Feb 7, 2023 stable
2.0.1 Feb 1, 2023 stable
2.0.0 Jan 26, 2023 stable
2.0.0rc3 Jan 19, 2023 rc
2.0.0rc2 Jan 9, 2023 rc
1.4.46 Jan 3, 2023 stable
2.0.0rc1 Dec 28, 2022 rc
1.4.45 Dec 10, 2022 stable
2.0.0b4 Dec 5, 2022 unknown
1.4.44 Nov 12, 2022 stable
2.0.0b3 Nov 4, 2022 unknown
1.4.43 Nov 4, 2022 stable
2.0.0b2 Oct 20, 2022 unknown
1.4.42 Oct 16, 2022 stable
2.0.0b1 Oct 13, 2022 unknown
1.4.41 Sep 7, 2022 stable
1.4.40 Aug 8, 2022 stable
1.4.39 Jun 24, 2022 stable
1.4.38 Jun 23, 2022 stable
1.4.37 May 31, 2022 stable
1.4.36 Apr 26, 2022 stable
1.4.35 Apr 6, 2022 stable
1.4.34 Mar 31, 2022 stable
1.4.33 Mar 31, 2022 stable
1.4.32 Mar 6, 2022 stable
1.4.31 Jan 21, 2022 stable
1.4.30 Jan 19, 2022 stable
1.4.29 Dec 23, 2021 stable
1.4.28 Dec 9, 2021 stable
1.4.27 Nov 11, 2021 stable
1.4.26 Oct 19, 2021 stable
1.4.25 Sep 23, 2021 stable
1.4.24 Sep 22, 2021 stable
1.4.23 Aug 18, 2021 stable
1.4.22 Jul 22, 2021 stable
1.4.21 Jul 14, 2021 stable
1.4.20 Jun 28, 2021 stable
1.4.19 Jun 23, 2021 stable
1.4.18 Jun 10, 2021 stable
1.4.17 May 29, 2021 stable
1.4.16 May 28, 2021 stable
1.4.15 May 11, 2021 stable
1.4.14 May 6, 2021 stable
1.4.13 May 3, 2021 stable
1.4.12 Apr 29, 2021 stable
1.4.11 Apr 22, 2021 stable
1.4.10 Apr 21, 2021 stable
1.4.9 Apr 17, 2021 stable
1.4.8 Apr 15, 2021 stable
1.4.7 Apr 9, 2021 stable
1.4.6 Apr 6, 2021 stable
1.4.5 Apr 2, 2021 stable
1.4.4 Mar 31, 2021 stable
1.3.24 Mar 30, 2021 stable
1.4.3 Mar 25, 2021 stable
1.4.2 Mar 19, 2021 stable
1.4.1 Mar 17, 2021 stable
1.4.0 Mar 15, 2021 stable
1.4.0b3 Feb 15, 2021 unknown
1.4.0b2 Feb 3, 2021 unknown
1.3.23 Feb 1, 2021 stable
1.3.22 Dec 18, 2020 stable
1.3.21 Dec 17, 2020 stable
1.4.0b1 Nov 2, 2020 unknown
1.3.20 Oct 12, 2020 stable
1.3.19 Aug 17, 2020 stable
1.3.18 Jun 25, 2020 stable
1.3.17 May 13, 2020 stable
1.3.16 Apr 8, 2020 stable
1.3.15 Mar 11, 2020 stable
1.3.14 Mar 10, 2020 stable
1.3.13 Jan 22, 2020 stable
1.3.12 Dec 16, 2019 stable
1.3.11 Nov 11, 2019 stable
1.3.10 Oct 10, 2019 stable
1.3.9 Oct 4, 2019 stable
1.3.8 Aug 27, 2019 stable
1.3.7 Aug 14, 2019 stable
1.3.6 Jul 21, 2019 stable
1.3.5 Jun 17, 2019 stable
1.3.4 May 28, 2019 stable
1.3.3 Apr 15, 2019 stable
1.2.19 Apr 15, 2019 stable
1.3.2 Apr 2, 2019 stable
1.3.1 Mar 9, 2019 stable
1.3.0 Mar 4, 2019 stable
1.2.18 Feb 15, 2019 stable
1.3.0b3 Feb 8, 2019 unknown
1.3.0b2 Jan 26, 2019 unknown
1.2.17 Jan 26, 2019 stable
1.2.16 Jan 11, 2019 stable
1.2.15 Dec 11, 2018 stable
1.3.0b1 Nov 17, 2018 unknown
1.2.14 Nov 10, 2018 stable
1.2.13 Oct 31, 2018 stable
1.2.12 Sep 19, 2018 stable
1.2.11 Aug 20, 2018 stable
1.2.10 Jul 13, 2018 stable
1.2.9 Jun 29, 2018 stable
1.2.8 May 28, 2018 stable
1.2.7 Apr 20, 2018 stable
1.2.6 Mar 30, 2018 stable
1.2.5 Mar 6, 2018 stable
1.1.18 Mar 6, 2018 stable
1.2.4 Feb 22, 2018 stable
1.1.17 Feb 22, 2018 stable
1.2.3 Feb 16, 2018 stable
1.1.16 Feb 16, 2018 stable
1.2.2 Jan 25, 2018 stable
1.2.1 Jan 15, 2018 stable
1.2.0 Dec 27, 2017 stable
1.1.15 Nov 3, 2017 stable
1.2.0b3 Oct 13, 2017 unknown
1.1.14 Sep 5, 2017 stable
1.1.13 Aug 3, 2017 stable
1.0.19 Aug 3, 2017 stable
1.2.0b2 Jul 24, 2017 unknown
1.1.12 Jul 24, 2017 stable
1.0.18 Jul 24, 2017 stable
1.2.0b1 Jul 10, 2017 unknown
1.1.11 Jun 19, 2017 stable
1.1.10 May 19, 2017 stable
1.1.9 Apr 4, 2017 stable
1.1.8 Mar 31, 2017 stable
1.1.7 Mar 27, 2017 stable
1.1.6 Feb 28, 2017 stable
1.1.5 Jan 17, 2017 stable
1.0.17 Jan 17, 2017 stable
1.1.4 Nov 15, 2016 stable
1.0.16 Nov 15, 2016 stable
1.1.3 Oct 27, 2016 stable
1.1.2 Oct 17, 2016 stable
1.1.1 Oct 7, 2016 stable
1.1.0 Oct 5, 2016 stable
1.0.15 Sep 1, 2016 stable
1.1.0b3 Jul 26, 2016 unknown
1.0.14 Jul 6, 2016 stable
1.1.0b2 Jul 1, 2016 unknown
1.1.0b1 Jun 16, 2016 unknown
1.0.13 May 16, 2016 stable
1.0.12 Feb 15, 2016 stable
1.0.11 Dec 23, 2015 stable
1.0.10 Dec 11, 2015 stable
1.0.9 Oct 20, 2015 stable
1.0.8 Jul 23, 2015 stable
0.9.10 Jul 22, 2015 stable
1.0.7 Jul 20, 2015 stable
1.0.6 Jun 25, 2015 stable
1.0.5 Jun 7, 2015 stable
1.0.4 May 8, 2015 stable
1.0.3 May 1, 2015 stable
1.0.2 Apr 24, 2015 stable
1.0.1 Apr 23, 2015 stable
1.0.0 Apr 16, 2015 stable
1.0.0b5 Apr 3, 2015 unknown
1.0.0b4 Mar 29, 2015 unknown
1.0.0b3 Mar 20, 2015 unknown
1.0.0b2 Mar 20, 2015 unknown
1.0.0b1 Mar 13, 2015 unknown
0.9.9 Mar 10, 2015 stable
0.9.8 Oct 13, 2014 stable
0.9.7 Jul 22, 2014 stable
0.8.7 Jul 22, 2014 stable
0.9.6 Jun 23, 2014 stable
0.9.5 Jun 23, 2014 stable
0.9.4 Mar 28, 2014 stable
0.8.6 Mar 28, 2014 stable
0.9.3 Feb 20, 2014 stable
0.8.5 Feb 20, 2014 stable
0.9.2 Feb 3, 2014 stable
0.9.1 Jan 6, 2014 stable
0.9.0 Dec 30, 2013 stable
0.8.4 Dec 8, 2013 stable
0.8.3 Oct 26, 2013 stable
0.8.2 Jul 3, 2013 stable
0.8.1 Apr 27, 2013 stable
0.8.0 Mar 10, 2013 stable
0.7.10 Feb 8, 2013 stable
0.8.0b2 Dec 14, 2012 unknown
0.7.9 Oct 2, 2012 stable
0.7.8 Jun 17, 2012 stable
0.7.7 May 6, 2012 stable
0.6.9 May 6, 2012 stable
0.7.6 Mar 15, 2012 stable
0.7.5 Jan 28, 2012 stable
0.7.4 Dec 9, 2011 stable
0.7.3 Oct 16, 2011 stable
0.7.2 Aug 1, 2011 stable
0.7.1 Jun 5, 2011 stable
0.6.8 Jun 5, 2011 stable
0.7.0 May 21, 2011 stable
0.6.7 Apr 14, 2011 stable
0.6.6 Jan 8, 2011 stable
0.6.5 Oct 24, 2010 stable
0.6.4 Sep 7, 2010 stable
0.6.3 Jul 15, 2010 stable
0.6.2 Jul 6, 2010 stable
0.6.1 May 31, 2010 stable
0.6.0 Apr 19, 2010 stable
0.6beta3 Mar 28, 2010 beta
0.6beta2 Mar 20, 2010 beta
0.6beta1 Feb 3, 2010 beta
0.5.8 Jan 16, 2010 stable
0.5.7 Dec 27, 2009 stable
0.5.6 Sep 13, 2009 stable
0.5.5 Jul 13, 2009 stable
0.5.4 May 18, 2009 stable
0.5.3 Mar 25, 2009 stable
0.5.2 Jan 24, 2009 stable
0.5.1 Jan 17, 2009 stable
0.5.0 Jan 6, 2009 stable
0.5.0rc4 Nov 14, 2008 rc
0.5.0rc3 Nov 7, 2008 rc
0.5.0rc2 Oct 12, 2008 rc
0.4.8 Oct 12, 2008 stable
0.5.0rc1 Sep 11, 2008 rc
0.5.0beta3 Aug 4, 2008 beta
0.4.7 Jul 26, 2008 stable
0.5.0beta2 Jul 14, 2008 beta
0.5.0beta1 Jun 12, 2008 beta
0.4.6 May 14, 2008 stable
0.4.5 Apr 4, 2008 stable
0.4.4 Mar 12, 2008 stable
0.4.3 Feb 14, 2008 stable
0.4.2b Jan 7, 2008 unknown
0.4.2a Jan 5, 2008 unknown
0.4.2 Jan 2, 2008 stable
0.4.1 Nov 18, 2007 stable
0.4.0 Oct 17, 2007 stable
0.3.11 Oct 14, 2007 stable
0.4.0beta6 Sep 27, 2007 beta
0.4.0beta5 Sep 2, 2007 beta
0.4.0beta4 Aug 22, 2007 beta
0.4.0beta3 Aug 16, 2007 beta
0.4.0beta2 Aug 14, 2007 beta
0.4.0beta1 Aug 12, 2007 beta
0.3.10 Jul 20, 2007 stable
0.3.9 Jul 15, 2007 stable
0.3.8 Jun 2, 2007 stable
0.3.7 Apr 30, 2007 stable
0.3.6 Mar 23, 2007 stable
0.3.5 Feb 22, 2007 stable
0.3.4 Jan 23, 2007 stable