A curated list of awesome tools for SQLAlchemy

Awesome SQLAlchemy

A curated list of awesome extra libraries and resources for SQLAlchemy. Inspired by awesome-python. (See also other awesome lists__!)

Licensed under a Creative Commons Attribution-ShareAlike 4.0 International License__.

.. _SQLAlchemy: .. _awesome-python: __ __

.. contents:: Table of Contents :backlinks: none :depth: 3

Data Structures

SQLAlchemy-Continuum_ Versioning and auditing extension for SQLAlchemy.

  • Creates versions for inserts, deletes and updates.
  • Does not store updates which don’t change anything.
  • Supports alembic migrations.
  • Can revert objects data as well as all object relations at given transaction even if the object was deleted.
  • Transactions can be queried afterwards using SQLAlchemy query syntax.
  • Query for changed records at given transaction.
  • Temporal relationship reflection. Version object’s relationship show the parent objects relationships as they where in that point in time.
  • Supports native versioning for PostgreSQL database (trigger based versioning).

sqlalchemymptt Library for implementing MPTT (modified preorder tree traversal) with SQLAlchemy models and working with trees of model instances, like django-mptt_.

SQLAlchemy-ORM-tree_ An implementation for SQLAlchemy-based applications of the nested-sets/modified-pre-order-tree-traversal technique for storing hierarchical data in a relational database.

vdm_ Versioned domain model. Python library for revisioning/versioning of databases.

.. _django-mptt: .. _SQLAlchemy-Continuum: .. _sqlalchemy_mptt: .. _SQLAlchemy-ORM-tree: .. _vdm:

Data Types

SQLAlchemy-Utils_ Various utility functions, new data types and helpers for SQLAlchemy

  • Listeners
  • Data types: {…, ChoiceType, CountryType, JSONType, URLType, UUIDType, …}
  • Range data types
  • Aggregated attributes
  • Generates decorator
  • Generic relationships
  • Database helpers: create_database, drop_database
  • Foreign key helpers
  • ORM helpers
  • Utility classes
  • Model mixins: Timestamp (created, updated times)

.. _SQLAlchemy-Utils:

Database Migration Tools

Alembic_ Alembic is a lightweight database migration tool for usage with the SQLAlchemy Database Toolkit for Python.

sqlalchemy-migrate_ Inspired by Ruby on Rails’ migrations, SQLAlchemy Migrate provides a way to deal with database schema changes in SQLAlchemy projects.

.. _Alembic: .. _sqlalchemy-migrate:


redshiftsqlalchemy Amazon Redshift_ dialect for SQLAlchemy.

sphinxalchemy_ SQLAlchemy dialect for iterfacing with Sphinx_ (search engine) via SphinxQL.

.. _Amazon Redshift: .. _redshift_sqlalchemy: .. _Sphinx: .. _sphinxalchemy:


File and Image Attachments

SQLAlchemy-ImageAttach_ SQLAlchemy-ImageAttach is a SQLAlchemy extension for attaching images to entity objects.

.. _SQLAlchemy-ImageAttach:

Forms and Data Validations

ColanderAlchemy_ ColanderAlchemy helps you to auto-generate Colander_ schemas that are based on SQLAlchemy mapped classes.

Such Colander schemas can be used with libraries like Deform_ and helps remove the need for duplication of schema definitions.

FormAlchemy_ FormAlchemy eliminates boilerplate by autogenerating HTML input fields from a given model. FormAlchemy will try to figure out what kind of HTML code should be returned by introspecting the model’s properties and generate ready-to-use HTML code that will fit the developer’s application.

WTForms-Alchemy_ WTForms-Alchemy is a WTForms_ extension toolkit for easier creation of model based forms. Strongly influenced by Django ModelForm.

.. _Colander: .. _ColanderAlchemy: .. _Deform: .. _FormAlchemy: .. _WTForms: .. _WTForms-Alchemy:

Full-text Searching

SQLAlchemy-Searchable_ Full-text searchable models for SQLAlchemy. Only supports PostgreSQL.

.. _SQLAlchemy-Searchable:

SQLAlchemy-FullText-Search_ Fulltext search support with MySQL & SQLAlchemy.

.. _SQLAlchemy-FullText-Search:

GIS and Spatial Databases

GeoAlchemy_ GeoAlchemy provides extensions to SQLAlchemy to work with spatial databases.

The current supported spatial database systems are PostGIS, Spatialite, MySQL, Oracle, and MS SQL Server 2008.

GeoAlchemy 2_ GeoAlchemy 2 provides extensions to SQLAlchemy for working with spatial databases.

GeoAlchemy 2 focuses on PostGIS_. PostGIS 1.5 and PostGIS 2 are supported.

GeoAlchemy 2 aims to be simpler than its predecessor, GeoAlchemy_. Simpler to use, and simpler to maintain.

.. _GeoAlchemy: .. _GeoAlchemy 2: .. _PostGIS: .. _Spatialite:


SQLAlchemy-i18n_ Internationalization extension for SQLAlchemy models.

  • Stores translations in separate tables.
  • Reflects translation table structures based on parent model table structure.
  • Supports forcing of given locale.
  • Good performance (uses proxy dicts and other advanced SQLAlchemy concepts for performance optimization).

.. _SQLAlchemy-i18n:


flaskdebugtoolbar Debug toolbar with SQLAlchemy query information for Flask.

pyramiddebugtoolbar Debug toolbar with SQLAlchemy query information for Pyramid.

SQLTap_ SQLTap is a library that allows you to profile and introspect the queries that your application makes using SQLAlchemy.

SQLTap helps you understand:

  • how many times a sql query is executed
  • how much time your sql queries take
  • where your application is issuing sql queries from

.. _flask_debugtoolbar: .. _pyramid_debugtoolbar: .. _SQLTap:


Serialization and deserialization

marshmallow-sqlalchemy_ SQLAlchemy integration with the marshmallow_ (de)serialization library.

.. _marshmallow: .. _marshmallow-sqlalchemy:


charlatan_ Fixtures management for SQLAlchemy and other systems.

factoryboy Generate fake data and create random fixtures for testing in SQLAlchemy and many other Python ORM systems.

mixer_ Generate fake data and create random fixtures for testing in SQLAlchemy and many other Python ORM systems.

.. _charlatan: .. _factory_boy: .. _mixer:

Thin Abstractions

Dataset_ Easy-to-use data handling for SQL data stores in Python with support for implicit table creation, bulk loading, and transaction. Dataset also includes support for freezing data to CSV and JSON flat files.

rdflib-sqlalchemy_ RDFLib_ store using SQLAlchemy dbapi as back-end.

SQLSoup_ SQLSoup provides a convenient way to map Python objects to relational database tables, with no declarative code of any kind. It’s built on top of the SQLAlchemy ORM and provides a super-minimalistic interface to an existing database.

.. _Dataset: .. _RDFLib: .. _rdflib-sqlalchemy: .. _SQLSoup:

Vendor-specific Extensions

PostgreSQL ……….

sqlalchemy-crosstab-postgresql_ New grammar for SQLAlchemy to make handling the crosstab() tablefunc (i.e. pivot tables) in PostgreSQL easy peasy.

.. _sqlalchemy-crosstab-postgresql:


sadisplay_ Simple package for describing SQLAlchemy schema and display raw database tables by reflecting feature.

sqlalchemyschemadisplay This module generates images from SQLAlchemy models.

eralchemy_ ERAlchemy generates Entity Relation (ER) diagram from databases or from SQLAlchemy models.

.. _sadisplay: .. _sqlalchemy_schemadisplay: .. _eralchemy:


Framework Integrations ………………….

bottle-sqlalchemy_ A Bottle_ plugin to manage SQLAlchemy session to your application.

Flask-SQLAlchemy_ Flask-SQLAlchemy is an extension for Flask_ that adds support for SQLAlchemy to your application.

Flask-Admin_ The admin interface framework for Flask_. With scaffolding for SQLAlchemy, MongoEngine, pymongo and Peewee.

pyramidsqlalchemy pyramidsqlalchemy provides everything needed to use SQLAlchemy in Pyramid applications.

pyramidrestler pyramid_restler is a somewhat-opinionated toolkit for building RESTful Web services and applications on top of the Pyramid framework (with SQLAlchemy models).

sacrud_ SACRUD will solve your problem of CRUD interface for SQLAlchemy, by providing extension for Pyramid_ (yet) or use it in pure form. Unlike classical CRUD interface, pyramidsacrud allows override and flexibly customize interface (that is closer to django.contrib.admin).

SQLAlchemy-Wrapper_ A light and framework-independent wrapper for SQLAlchemy that makes it really easy to setup and use.

- Doesn't change the SQLAlchemy syntax.
- Can paginate the results of the queries.
- Support for muliple databases at the same time.

zope.sqlalchemy_ The aim of this package is to unify the plethora of existing packages integrating SQLAlchemy with Zope_’s transaction management. As such it seeks only to provide a data manager and makes no attempt to define a zopeish way to configure engines.

.. _Bottle: .. _bottle-sqlalchemy: .. _Flask: .. _Flask-SQLAlchemy: .. _Flask-Admin: .. _Pyramid: .. _pyramid_restler: .. _pyramid_sacrud: .. _pyramid_sqlalchemy: .. _sacrud: .. _SQLAlchemy-Wrapper: .. _Zope: .. _zope.sqlalchemy:

Other …..

paginatesqlalchemy This module helps dividing large lists of items into pages. The user is shown one page at a time and can navigate to other pages.

sandman_ Generate a curl-able REST HTTP API with searching and filtering for all tables in a database and an admin UI with Flask-SQLAlchemy and HTTP Basic Authentication.

.. _paginate_sqlalchemy: .. _sandman:

Related Repositories



A curated list of awesome tools for SQLAlchemy ...



A curated list of awesome tools for SQLAlchemy ...



A curated list of awesome extra libraries for SQLAlchemy ...



A curated list of awesome tools for SQLAlchemy ...

Top Contributors

dahlia westurner yoloseem AEAMcNett charlax meoooh uralbash Alexis-benoist dhamaniasad cvrebert geonu iurisilvio jpscaletti klen nathancahill wichert