SQLAlchemy
Contents
Introduction
Data Types
Database Migration Tools
Dialects
Amazon Redshift_ dialect for SQLAlchemy.
SQLAlchemy dialect for interfacing 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.
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.
Forms and Data Validations
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.
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.
Full-text Searching
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 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.
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.
Profilers
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.
Serialization and deserialization
Testing
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.
Loading and execution of parameterized queries stored in files.
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.
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. SQLModel is based on Python type annotations, and powered by Pydantic and SQLAlchemy.
Zillion is a free, open data warehousing and dimensional modeling tool that allows combining and analyzing data from multiple datasources through a simple API. It writes SQL so you don't have to, and it easily bolts onto existing database infrastructure via SQLAlchemy.
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.
Loading and execution of parameterized queries stored in files.
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 <https://github.com/shawalli/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.
Visualizations
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.
CLI and Library that generates Mermaid and DOT Diagrams from SQLAlchemy models and injects them into documentation.
Web
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, pyramidsacrud 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 multiple 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.
Provides a convenient way to work with sessions in asynchronous applications using context. It handles the lifecycle management of the engine, sessions, and transactions. The main goal is to provide quick and easy access to a session, without worrying about opening or closing it when it’s not necessary.
Flask-SQLAlchemy is an extension for Flask_ that adds support for SQLAlchemy to your application.
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`).
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.
Other
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.