--- id: advanced-alchemy version: "1.11.0" license: MIT license_treatment: permissive maintenance: active --- # advanced-alchemy — Ready-to-go SQLAlchemy concoctions. License: permissive · Maintenance: active · Downloads: 452.0K/mo ## 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 above — 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 pip install advanced-alchemy uv add advanced-alchemy 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_current - Install friction: low - Maintenance: active - Downloads: 452.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags sqlalchemy repository pattern, async database crud operations, sqlalchemy bulk operations, fastapi sqlalchemy integration, database service layer, sqlalchemy orm helpers, litestar database toolkit, sqlalchemy-extension, async-orm, repository-pattern [View on SkillFed](https://skillfed.io/packages/advanced-alchemy) · [View on PyPI](https://pypi.org/project/advanced-alchemy/)