alembic_utils
A sqlalchemy/alembic extension for migrating procedures and views
Decision gist · record as of 2026-08-14
Yes, if you use Alembic with PostgreSQL and need to version-control functions, views, triggers, or policies. The low install friction, permissive license, and stable maintenance history make it a safe addition to SQLAlchemy projects. The aging release cycle is not a blocker—the package is feature-complete for its scope and the repository shows recent activity. Install it if PostgreSQL-specific schema objects are part of your migration strategy.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires PostgreSQL database; only works with Alembic and SQLAlchemy projects.
- Low install friction with a pure-Python wheel.
- Maintenance status is aging—last release 491 days ago—but the repository remains active with recent commits and no archived status, suggesting the package is stable rather than abandoned.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use, modify, and distribute this package with minimal restrictions, making it suitable for both open-source and commercial projects.
last release 2025-04-10 (491 days) · last repo commit 2025-04-10 · 300 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,604,291 downloads/mo, #3,726 on PyPI
Alternatives
Verify before relying
pip install alembic_utils
# In migrations/env.py:
from alembic_utils.pg_function import PGFunction
from alembic_utils.replaceable_entity import register_entities
to_upper = PGFunction(
schema='public',
signature='to_upper(some_text text)',
definition='RETURNS text as $$ SELECT upper(some_text) $$ language SQL;'
)
register_entities([to_upper])
# Then: alembic revision --autogenerate -m 'create to_upper'- Whether the 491-day gap since last release indicates active maintenance or dormancy despite recent commits.
- Performance characteristics when managing large numbers of PostgreSQL entities in a single migration.
- Compatibility with PostgreSQL versions beyond the current stable releases.
What it is and what it does
Alembic Utils is an extension to Alembic, the standard SQLAlchemy migration tool, that adds autogeneration support for PostgreSQL-specific database objects. While Alembic natively detects changes to SQLAlchemy models and generates migration scripts, it does not handle PostgreSQL functions, views, materialized views, triggers, or policies. This package fills that gap by letting you register these entities in your migration environment and have Alembic automatically detect when they are created, modified, or removed, then populate the upgrade and downgrade sections of your migration scripts.
You define PostgreSQL entities using classes like PGFunction, PGView, and PGTrigger, register them with the migration system, and then run `alembic revision --autogenerate` as usual. The tool compares your registered definitions against the database and generates the necessary SQL to bring them into sync. This eliminates manual SQL writing for these common schema changes and keeps your migrations declarative and version-controlled alongside your application code.
Use it for
- Autogenerate migrations when adding or updating PostgreSQL stored functions in a SQLAlchemy project.
- Track changes to database views and materialized views as part of your standard Alembic workflow.
- Manage PostgreSQL row-level security policies alongside table schema migrations.
- Detect and migrate trigger definitions without writing raw SQL in migration scripts.
- Keep PostgreSQL procedures in sync with application code in a version-controlled migration history.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you use Alembic with PostgreSQL and need to version-control functions, views, triggers, or policies.
The low install friction, permissive license, and stable maintenance history make it a safe addition to SQLAlchemy projects. The aging release cycle is not a blocker—the package is feature-complete for its scope and the repository shows recent activity. Install it if PostgreSQL-specific schema objects are part of your migration strategy.
Install
alembic-utils on PyPI
Before you install
Low install friction with a pure-Python wheel. Maintenance status is aging—last release 491 days ago—but the repository remains active with recent commits and no archived status, suggesting the package is stable rather than abandoned.
Requires PostgreSQL database; only works with Alembic and SQLAlchemy projects.
License in practice
MIT license is permissive; you can use, modify, and distribute this package with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
pip install alembic_utils
# In migrations/env.py:
from alembic_utils.pg_function import PGFunction
from alembic_utils.replaceable_entity import register_entities
to_upper = PGFunction(
schema='public',
signature='to_upper(some_text text)',
definition='RETURNS text as $$ SELECT upper(some_text) $$ language SQL;'
)
register_entities([to_upper])
# Then: alembic revision --autogenerate -m 'create to_upper'
Verify before relying
- Whether the 491-day gap since last release indicates active maintenance or dormancy despite recent commits.
- Performance characteristics when managing large numbers of PostgreSQL entities in a single migration.
- Compatibility with PostgreSQL versions beyond the current stable releases.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 5 packagesalembicflupyparsesqlalchemytyping_extensions |
| Maintenance | Aging 491 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,604,291 / month, #3,726 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Programming Language :: SQL |
Evidence: alembic_utils-0.8.8-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 › “database migration functions views”
- alembic_utilsExtends Alembic to autogenerate database migrations for PostgreSQL…
- django-pgviews-reduxAdds first-class PostgreSQL view support to Django's ORM, allowing…
- starrocksProvides a SQLAlchemy dialect and Alembic integration for connecting…
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 alembic · alembic-autogenerate-enums · schemainspect · starrocks · Flask-Alembic · sqlalchemy-views · pytest-alembic · alembic-postgresql-enum · django-pgviews-redux · Flask-Migrate