SQLAlchemy Extensions, Plug-ins and Related Libraries

SQLAlchemy is a Python library for interacting with databases either through SQL or with an object-relational mapper (ORM).

The following projects augment SQLAlchemy's capabilities by providing functionality not included with the library itself. For example, the Alembic project makes it easier to perform database schema migrations, which is frequently needed as applications evolve and need to store additional data.

Alembic

Alembic (project documentation and PyPI information) is a data migrations tool used with SQLAlchemy to make database schema changes. The Alembic project is open sourced under the MIT license.

Amazon Redshift SQLAlchemy Dialect

Amazon Redshift SQLAlchemy Dialect is a SQLAlchemy Dialect that can communicate with the AWS Redshift data store. The SQL is essentially PostgreSQL and requires psycopg2 to properly operate. This project and its code are open sourced under the MIT license.

flask-base

flask-base (project documentation) provides boilerplate code for new Flask web apps. The purpose of the boilerplate is to stitch together disparate libraries that are commonly used in Flask projects, such as Redis for fast caching and transient data storage, SendGrid for transactional email, SQLAlchemy for persistent data storage through a relational database back end, Flask-WTF for form handling, and many others.

flask-base is provided as open source under the MIT license.

flask-sqlalchemy

flask-sqlalchemy (project documentation and PyPI information) is a Flask extension that makes it easier to use SQLAlchemy when building Flask apps. flask-sqlalchemy provides helper functions that reduce the amount of common boilerplate code that you have to frequently write yourself if you did not use this library when combining Flask with SQLAlchemy.

flask-sqlalchemy is provided as open source under the BSD 3-Clause "New" or "Revised" License.

GeoAlchemy2

GeoAlchemy2 (project documentation and PyPI package information) extends SQLAlchemy with new data types for working with geospatial databases, particularly PostGIS, which is a spatial database extender for PostgreSQL. The project is provided as open source under the MIT license.

GINO

GINO (project documentation and PyPI package information) is an object-relational mapper (ORM) built on SQLAlchemy that is non-blocking and therefore designed to work properly with asynchronously-run code, for example, an application written with asyncio.

GINO is open sourced under the BSD License.

graphene-sqlalchemy

graphene-sqlalchemy (project documentation and PyPI package information) is a SQLAlchemy integration for Graphene, which makes it easier to build GraphQL-based APIs into Python web applications. The package allows you to subclass SQLAlchemy classes and build queries around them with custom code to match the backend queries with the GraphQL-based request queries. The project is provided as open source under the MIT license.

marshmallow-sqlalchemy

marshmallow-sqlalchemy (project documentation and PyPI package information) is a code library that makes it easier to use SQLAlchemy with the Marshmallow data serialization tool.

The marshmallow-sqlalchemy project is provided as open source under the MIT license.

PyHive

PyHive (PyPI package information) is a set of DB-API and SQLAlchemy interfaces that make it easier to use Presto and Apache Hive with Python. Dropbox's engineering team created this code library, open sourced it and put it out under the Apache 2.0 license.

sqlacodegen

sqlacodegen (PyPI package information) is a tool for reading from an existing relational database to generate code to create SQLAlchemy models based on that database. The project is primarily written and maintained by Alex Grönholm (agronholm) and it is open sourced under the MIT license.

sqlalchemy-clickhouse

sqlalchemy-clickhouse is a SQLAlchemy Dialect for communicating with the open source ClickHouse database management system. ClickHouse is column-oriented and therefore better for some use cases and worse for others compared to a traditional relational database.

The code for this project is open sourced under the MIT license while ClickHouse is provided as open source under the Apache License 2.0.

sqlalchemy-datatables

sqlalchemy-datatables (PyPI package information) is a helper library that makes it easier to use SQLAlchemy with the jQuery JavaScript DataTables plugin. This library is designed to be web framework agnostic and provides code examples for both Flask and Pyramid.

The project is built and maintained by Michel Nemnom (Pegase745) and is open sourced under the MIT license.

SQLAlchemy filters

SQLAlchemy filters provides filtering, sorting and pagination for SQLAlchemy query objects, which is particularly useful when building web APIs. SQLAlchemy filters is open sourced under the Apache License version 2.0.

SQLAlchemy Mixins

SQLAlchemy Mixins (PyPI package information) is a collection of mixins useful for extending SQLAlchemy and simplifying your database-interacting code for some common use cases. SQLAlchemy Mixins is open sourced under the MIT license.

sqlalchemy-utils

sqlalchemy-utils (project documentation and PyPI package information) is a code library with various helper functions and new data types that make it easier to use SQLAlchemy when building projects that involve more specific storage requirements such as currency. The wide array of data types includes ranged values and aggregated attributes.

SQLAthanor

SQLAthanor (PyPI package information and project documentation) is a SQLAlchemy extension that provides serialization and deserialization support for JSON, CSV, YAML and Python dictionaries. This project is similar to Marshmallow with one major difference: SQLAthanor works through SQLAlchemy models while Marshmallow is less coupled to SQLAlchemy because it requires separate representations of the serialization objects. Both libraries have their uses depending on whether the project plans to use SQLAlchemy for object representations or would prefer to avoid that couping. SQLAthanor is open sourced under the MIT license.

wtforms-alchemy

wtforms-alchemy (documentation and PyPI package information) is a WTForms extension toolkit for easier creation of SQLAlchemy model based forms. While this project primarily focuses on proper form handling, it also has many good examples of how to use various parts of SQLAlchemy in its code base. The project is provided as open source under the MIT license.