sqlalchemy-mixins
Active Record, Django-like queries, nested eager load and beauty __repr__ for SQLAlchemy
Decision gist · record as of 2026-08-14
Yes, if you are starting a new SQLAlchemy project and prefer Active Record patterns or migrating from Django. No, if you need active maintenance—the dormant status (last release 2023-08-29) means security patches and compatibility updates are unlikely. Suitable for stable, low-change codebases; risky for projects requiring ongoing support.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires SQLAlchemy session to be initialized via set_session() and autocommit must be enabled on the session for CRUD operations to work.
- Low friction install with three straightforward runtime dependencies.
- Maintenance is dormant—last release was 2023-08-29 and last commit 2024-09-08—so expect no active bug fixes or feature updates.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
last release 2023-08-29 (1081 days) · last repo commit 2024-09-08 · 788 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 410,284 downloads/mo, #6,865 on PyPI
Alternatives
Verify before relying
pip install sqlalchemy-mixins
from sqlalchemy_mixins import AllFeaturesMixin
class User(Base, AllFeaturesMixin):
pass
BaseModel.set_session(session)
bob = User.create(name='Bob')
user = User.find(1)
User.all()- Compatibility with current SQLAlchemy versions beyond what classifiers claim
- Whether dormant status means the package is stable or abandoned for practical purposes
- Performance characteristics compared to raw SQLAlchemy queries in production workloads
What it is and what it does
sqlalchemy-mixins adds Active Record and Django-inspired ORM patterns on top of SQLAlchemy's Data Mapper architecture. Instead of writing session.query(User).filter(...).all(), you call User.where(...).all() directly on the model class. The package provides mixins you inherit into your model base class to gain CRUD shortcuts (create, update, delete, find), query helpers (all, first, where), eager-load control (with_joined, with_subquery), and automatic timestamp tracking.
It's designed to feel familiar to developers coming from Django or Eloquent ORM while remaining framework-agnostic. The library handles the session plumbing internally once you set it up, reducing boilerplate. It covers serialization to dict, nested eager loading with joinedload and subqueryload, and filtering by relations using Django-style double-underscore syntax.
Use it for
- Migrate from Django ORM to SQLAlchemy while keeping familiar query syntax and reducing code rewrite effort.
- Build Flask or FastAPI apps where you want Active Record convenience without a full framework ORM.
- Reduce boilerplate in SQLAlchemy projects by replacing repetitive session.query() chains with model methods.
- Implement eager loading strategies (nested joins, subqueries) with cleaner syntax than raw SQLAlchemy.
- Add automatic created_at and updated_at timestamp tracking to models without manual column management.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are starting a new SQLAlchemy project and prefer Active Record patterns or migrating from Django.
No, if you need active maintenance—the dormant status (last release 2023-08-29) means security patches and compatibility updates are unlikely. Suitable for stable, low-change codebases; risky for projects requiring ongoing support.
Install
sqlalchemy-mixins on PyPI
Before you install
Low friction install with three straightforward runtime dependencies. Maintenance is dormant—last release was 2023-08-29 and last commit 2024-09-08—so expect no active bug fixes or feature updates.
Requires SQLAlchemy session to be initialized via set_session() and autocommit must be enabled on the session for CRUD operations to work.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install sqlalchemy-mixins
from sqlalchemy_mixins import AllFeaturesMixin
class User(Base, AllFeaturesMixin):
pass
BaseModel.set_session(session)
bob = User.create(name='Bob')
user = User.find(1)
User.all()
Verify before relying
- Compatibility with current SQLAlchemy versions beyond what classifiers claim
- Whether dormant status means the package is stable or abandoned for practical purposes
- Performance characteristics compared to raw SQLAlchemy queries in production workloads
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesSQLAlchemysixtyping |
| Maintenance | Dormant 1,081 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 410,284 / month, #6,865 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaEnvironment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: Implementation :: CPythonTopic :: Database |
Evidence: sqlalchemy_mixins-2.0.5-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “sqlalchemy active record pattern”
- sqlalchemy-mixinsProvides Active Record-style mixins for SQLAlchemy ORM, enabling…
- advanced-alchemyAdvanced Alchemy provides sync and async SQLAlchemy repositories with…
- async-factory-boyExtends factory_boy to generate test fixtures asynchronously for…
Give your agent the search over MCP, or paste the wish link into any chat.
More Database packages
psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.
Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.
Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.
YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.
Install it if you need to connect Python applications to YDB databases.
Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.
sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.
Install it if you need to manipulate, format, or analyze SQL text programmatically.
Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.
See also Flask-SQLAlchemy · mixer · odata-query · sqlalchemy-mate · zope.sqlalchemy · SQLAlchemy · nplusone · sqlalchemy-filters · advanced-alchemy · sqlalchemy-easy-softdelete