skillfed

advanced-alchemy

Ready-to-go SQLAlchemy concoctions.

advanced-alchemy v1.11.0 452.0K downloads/30d#6,583 on PyPI
Permissive license MIT Active released

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

uv

uv add advanced-alchemy

poetry

poetry add advanced-alchemy

Installing 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

Development Status :: 3 - AlphaEnvironment :: Web EnvironmentIntended Audience :: DevelopersIntended Audience :: System AdministratorsLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: DatabaseTopic :: Database :: Database Engines/ServersTopic :: Software DevelopmentTyping :: Typed

Tags

sqlalchemy repository patternasync database crud operationssqlalchemy bulk operationsfastapi sqlalchemy integrationdatabase service layersqlalchemy orm helperslitestar database toolkit
sqlalchemy-extensionasync-ormrepository-pattern

More Software Development packages