advanced-alchemy
Ready-to-go SQLAlchemy concoctions.
What it is and what it does
Advanced Alchemy is a companion library that wraps SQLAlchemy to provide higher-level abstractions for common database patterns. It offers sync and async repository classes that handle CRUD operations and optimized bulk inserts/updates, eliminating boilerplate code for typical web application data access layers. The library integrates directly with popular frameworks like Litestar, FastAPI, Starlette, and Sanic, and includes utilities for audit columns, composite primary keys, and read/write replica routing.
The package is built on top of SQLAlchemy, alembic, greenlet, and typing utilities. It targets developers building web applications who want to reduce repetitive repository and service layer code while maintaining full SQLAlchemy flexibility. The library supports modern Python versions (3.9 through 3.14) and is actively maintained, with an MIT license allowing use in any project type.
Use it for:
- Build a FastAPI or Litestar application with pre-built async repository classes for common CRUD operations without writing boilerplate.
- Implement read/write database replica routing with automatic query distribution and sticky-primary mode for high-traffic applications.
- Store file objects in the database using a unified interface across different storage backends (fsspec or obstore).
- Add audit columns and composite primary key support to your SQLAlchemy models with utility base classes.
- Cache frequently-accessed query results using Dogpile integration without modifying existing repository code.
- Perform optimized bulk insert and update operations on large datasets with repository bulk methods.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Advanced Alchemy provides sync and async SQLAlchemy repositories with CRUD and bulk operations, plus integration with web frameworks like Litestar, FastAPI, and Starlette.
Yes. Advanced Alchemy is actively maintained, has low install friction, carries no known vulnerabilities, and is MIT-licensed. It's well-suited for web frameworks (FastAPI, Litestar, Starlette) where reducing repository boilerplate is valuable. Install it if you're building a data-driven web application and want structured, tested patterns for database access; skip it if you prefer minimal abstractions over SQLAlchemy or are not using one of its supported frameworks.
Install
advanced-alchemy on PyPI
pip
pip install advanced-alchemyuv
uv add advanced-alchemypoetry
poetry add advanced-alchemyInstalling advanced-alchemy
Before you install
Low friction install with a pure-Python wheel. Maintenance is active with a release within the last 75 days. Six runtime dependencies are all well-established libraries (sqlalchemy, alembic, greenlet, typing-extensions, eval-type-backport, exceptiongroup).
License in practice
MIT license is permissive; you can use this in commercial and proprietary projects with minimal restrictions, provided you include the license notice.
Quickstart
pip install advanced-alchemy
from advanced_alchemy.repository import SQLAlchemyRepository
from sqlalchemy.orm import Session
repo = SQLAlchemyRepository(session=session, model=YourModel)
await repo.create(data={"field": "value"})
Requires SQLAlchemy and a database driver; async operations require an async-compatible database driver and event loop.
Verify before relying
- Whether composite primary key support works across all database backends listed in the fact sheet.
- Performance characteristics of bulk operations compared to raw SQLAlchemy queries.
- Dogpile caching integration requirements and configuration details.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — alembic, eval-type-backport, exceptiongroup, greenlet, sqlalchemy, typing-extensions |
| Maintenance | actively maintained — 75 days since the last release |
| First released | |
| Downloads | 451,970/month — #6,583 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: advanced_alchemy-1.11.0-py3-none-any.whl
Keywords: alembic, fastapi, flask, litestar, sanic, sqlalchemy
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
databasesProvides async database access for PostgreSQL,…
permissive · top 5,000 on PyPI
litestarLitestar is an ASGI framework for building REST…
permissive · top 5,000 on PyPI
sqlalchemy-mixinsProvides Active Record-style mixins for…
permissive · top 15,000 on PyPI
fastcrudFastCRUD provides async CRUD operations and…
permissive · top 15,000 on PyPI
sqladminGenerates a web-based admin interface for…
permissive · top 5,000 on PyPI
casbin-async-sqlalchemy-adapterProvides an asynchronous SQLAlchemy adapter for…
permissive · top 15,000 on PyPI
FastAPI-SQLAlchemyProvides middleware and helpers to integrate…
permissive · top 15,000 on PyPI
sqlalchemy-cockroachdbA SQLAlchemy dialect that enables ORM and SQL…
permissive · top 5,000 on PyPI
validations-engineValidations Engine is a framework for defining…
unclear · top 15,000 on PyPI
starlette-adminStarlette-admin provides a ready-made admin…
permissive · top 15,000 on PyPI