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.

Data Structures


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).
Library for implementing MPTT (modified preorder tree traversal) with SQLAlchemy models and working with trees of model instances, like django-mptt.
An implementation for SQLAlchemy-based applications of the nested-sets/modified-pre-order-tree-traversal technique for storing hierarchical data in a relational database.
Versioned domain model. Python library for revisioning/versioning of databases.

Data Types

SQLAlchemy type to store standard enum.Enum values.
SQLAlchemy type to store aware datetime.datetime values.

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)

Database Migration Tools

Alembic is a lightweight database migration tool for usage with the SQLAlchemy Database Toolkit for Python.
Inspired by Ruby on Rails' migrations, SQLAlchemy Migrate provides a way to deal with database schema changes in SQLAlchemy projects.



Amazon Redshift dialect for SQLAlchemy.
SQLAlchemy dialect for iterfacing with Sphinx (search engine) via SphinxQL.
An asynchronous PostgreSQL dialect for asyncpg, providing SQLAlchemy core support and its own asynchronous ORM interface.


File and Image Attachments

DEPOT is a framework for easily storing and serving files in web applications. Depot features simple integration with SQLAlchemy by providing customized model field types for storing files attached to your ORM document.
SQLAlchemy-ImageAttach is a SQLAlchemy extension for attaching images to entity objects.
Based on SQLAlchemy-ImageAttach but using JSON type instead of relation, and SqlAlchemy's mutable facility, Also supports multiple stores per context.

Forms and Data Validations


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.

Data validator for Flask and SQL-Alchemy, working at Model component with events, preventing invalid data in the columns. The extension works with event listeners from SQLAlchemy.
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 is a WTForms extension toolkit for easier creation of model based forms. Strongly influenced by Django ModelForm.
Sprox provides an easy way to create forms for web content which are: automatically generated, easy to customize, and validated. Sprox also has powerful tools to help you display your content the way you want to with table and record viewers. Sprox provides a way to fill your widgets, whether they are forms or other content with customizable data.

Full-text Searching

Full-text searchable models for SQLAlchemy. Only supports PostgreSQL.
Fulltext search support with MySQL & SQLAlchemy.

GIS and Spatial Databases


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. Spatialite is also supported, but using GeoAlchemy 2 with Spatialite requires some specific configuration on the application side.

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



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).


Debug toolbar with SQLAlchemy query information for Flask.
Debug toolbar with SQLAlchemy query information for Pyramid.

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

Auto-detect the n+1 queries problem in SQLAlchemy (and other Python ORMs)

nplusone detects unnecessary queries caused by lazy loading and unused eager loading. Integrates with Flask-SQLAlchemy.

Query helpers


This library implements keyset-based paging for SQLAlchemy (both ORM and core).

This library has been tested with PostgreSQL and MariaDB/MySQL. It should work with other SQLAlchemy-supported databases to provided they support row( syntax.


Serialization and deserialization

SQLAlchemy integration with the marshmallow (de)serialization library.
SQLAlchemy extension for interacting models with python dictionary.


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

Thin Abstractions

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 store using SQLAlchemy dbapi as back-end.
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.

Vendor-specific Extensions


Flask extension that uses SQLAlchemy and psycopg2-pgevents to enable event listeners tied into database-layer triggers.
New grammar for SQLAlchemy to make handling the crosstab() tablefunc (i.e. pivot tables) in PostgreSQL easy peasy.
Wrapper for using PostgreSQL COPY with SQLAlchemy for efficient bulk data imports and exports.


Simple package for describing SQLAlchemy schema and display raw database tables by reflecting feature.
This module generates images from SQLAlchemy models.
ERAlchemy generates Entity Relation (ER) diagram from databases or from SQLAlchemy models.


Framework Integrations

A Bottle plugin to manage SQLAlchemy session to your application.
Declarative query builder that auto-generates filter parameters from models and parses request parameters using marshmallow-sqlalchemy and webargs.
Flask-SQLAlchemy is an extension for Flask that adds support for SQLAlchemy to your application.
The admin interface framework for Flask. With scaffolding for SQLAlchemy, MongoEngine, pymongo and Peewee.
pyramid_sqlalchemy provides everything needed to use SQLAlchemy in Pyramid applications.
pyramid_restler is a somewhat-opinionated toolkit for building RESTful Web services and applications on top of the Pyramid framework (with SQLAlchemy models).
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, pyramid_sacrud allows override and flexibly customize interface (that is closer to django.contrib.admin).

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.
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.


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.
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.
A set of well-tested mixins that brings Active Record, Django-like queries, nested eager load and beauty __repr__ to your SQLAlchemy.
  • File/Image Attachments section link is broken

    File/Image Attachments section link is broken

    I think reStructuredText or github can't recognize slash charater when it is became hyperlink. So I try to use and instead of using slash character.

    opened by meoooh 5
  • Add Visualization section with sadisplay, sqlalchemy_schemadisplay.

    Add Visualization section with sadisplay, sqlalchemy_schemadisplay.

    Added sqlalchemy_schemadisplay into Other section. Would it be better if it has separated to another section for graphing/documenting tools?

    opened by yoloseem 4
  • Add charlatan

    Add charlatan

    opened by charlax 3
  • Added Flask-Validator

    Added Flask-Validator

    opened by xeBuz 3
  • Add filedepot

    Add filedepot


    opened by tonthon 3
  • Add SQLAlchemy-Wrapper

    Add SQLAlchemy-Wrapper

    opened by ghost 1
  • Validate pull requests with Travis

    Validate pull requests with Travis

    Hello, I wrote a tool that can validate README links (valid URLs, not duplicate). It can be run when someone submits a pull request.

    It is currently being used by

    • https://github.com/vsouza/awesome-ios
    • https://github.com/matteocrippa/awesome-swift
    • https://github.com/dkhamsing/open-source-ios-apps


    • https://travis-ci.org/matteocrippa/awesome-swift/builds/96526196 ok ✅
    • https://travis-ci.org/matteocrippa/awesome-swift/builds/96722421 link redirected / rename 🔴
    • https://travis-ci.org/dkhamsing/open-source-ios-apps/builds/96763135 bad link / project deleted 🔴
    • https://travis-ci.org/dkhamsing/open-source-ios-apps/builds/95754715 dupe 🔴

    If you are interested, connect this repo to https://travis-ci.org/ and add a .travis.yml file to the project.

    See https://github.com/dkhamsing/awesome_bot for options, more information Feel free to leave a comment :smile:

    opened by awesome-bot 1
  • Add PugSQL to thin abstractions

    Add PugSQL to thin abstractions


    opened by mwhite 0
  • Add Zillion to README.rst

    Add Zillion to README.rst

    opened by totalhack 0
  • FastAlchemy - Testing and Prototyping tool

    FastAlchemy - Testing and Prototyping tool


    I'm the author of https://github.com/maarten-dp/fast-alchemy which is a tool to create SQLA models and instances using YAML.

    Its main goals are:

    • Building fast testcases for libraries that build on, or extend, SQLA, but don't necessarily have a fixed model implementation.
    • Preventing hundreds of lines of test models clutter in your testfiles.
    • Building and instantiating models that cater to your specific usecases, instead of forcing you to "work with what you have"
    • Being a good prototyping tool for PoCs, as datamodels are often subject to a lot of change in these projects.

    I'm not sure where you draw the line between nice libraries and useful libraries. Hence me opening this issue to ask for your feedback. I'd be honored to have FastAlchemy included in this list, but understand and accept if it doesn't fit the scope.

    Thanks for your time.

    Kind regards, Maarten

    opened by maarten-dp 0
  • MongoSQL


    I suggest adding this one:

    Query Helper:

    MongoSQL is a JSON query engine that lets you execute MongoDB-like queries on your SQL database. The primary goal is to save the time you will spend implementing APIs for all those mundane filters, sortings, and pagination.

    Currently tested with PostgreSQL. Because it relies on SqlAlchemy, should work with other databases as well.

    opened by kolypto 0
  • Elastic search integration help?

    Elastic search integration help?

    Elastic search integration help? I'm looking for a good integration with elasticsearch but have not found it anywhere. Do you guys know of a good tutorial or example?

    I'm looking for an approach where I'm able to use similar way of persistence described in https://github.com/elastic/elasticsearch-dsl-py but none so far have shown up ...

    opened by rlam3 0
  • sqlacodegen


    I'm not sure which section sqlacodegen should go in, but I would like to think it deserves a mention.

    opened by agronholm 0
Hong Minhee (洪 民憙)
A software engineer from Seoul. An advocate of F/OSS, Open Web, and Cypherpunk. Hack into East Asian languages.
Hong Minhee (洪 民憙)
The ormar package is an async mini ORM for Python, with support for Postgres, MySQL, and SQLite.

python async mini orm with fastapi in mind and pydantic validation

null 674 Oct 23, 2021
SQLModel is a library for interacting with SQL databases from Python code, with Python objects.

SQLModel is a library for interacting with SQL databases from Python code, with Python objects. It is designed to be intuitive, easy to use, highly compatible, and robust.

Sebastián Ramírez 5.5k Oct 24, 2021
An async ORM. 🗃

ORM The orm package is an async ORM for Python, with support for Postgres, MySQL, and SQLite. ORM is built with: SQLAlchemy core for query building. d

Encode 1.4k Oct 11, 2021
A very simple CRUD class for SQLModel! ✨

Base SQLModel A very simple CRUD class for SQLModel! ✨ Inspired on: Full Stack FastAPI and PostgreSQL - Base Project Generator FastAPI Microservices I

Marcelo Trylesinski 12 Oct 22, 2021
Rich Python data types for Redis

Created by Stephen McDonald Introduction HOT Redis is a wrapper library for the redis-py client. Rather than calling the Redis commands directly from

Stephen McDonald 273 Sep 2, 2021
a small, expressive orm -- supports postgresql, mysql and sqlite

peewee Peewee is a simple and small ORM. It has few (but expressive) concepts, making it easy to learn and intuitive to use. a small, expressive ORM p

Charles Leifer 8.7k Oct 25, 2021
A Python Library for Simple Models and Containers Persisted in Redis

Redisco Python Containers and Simple Models for Redis Description Redisco allows you to store objects in Redis. It is inspired by the Ruby library Ohm

sebastien requiem 434 Oct 1, 2021
The Orator ORM provides a simple yet beautiful ActiveRecord implementation.

Orator The Orator ORM provides a simple yet beautiful ActiveRecord implementation. It is inspired by the database part of the Laravel framework, but l

Sébastien Eustace 1.3k Oct 17, 2021
Beanie - is an Asynchronous Python object-document mapper (ODM) for MongoDB

Beanie - is an Asynchronous Python object-document mapper (ODM) for MongoDB, based on Motor and Pydantic.

Roman 277 Oct 18, 2021
A Python Object-Document-Mapper for working with MongoDB

MongoEngine Info: MongoEngine is an ORM-like layer on top of PyMongo. Repository: https://github.com/MongoEngine/mongoengine Author: Harry Marr (http:

MongoEngine 3.6k Oct 24, 2021