OSS TanbouSign in with GitHub

track SQLAlchemy model changes as versioned database schema migrations

OSS scale score 237.5OSS health 100
About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
4,431
Primary language
Python
License
MIT
Repository last updated
Oct 5, 2026
On this page

Overview

Alembic is a database migration tool built on SQLAlchemy. It manages schema changes as Python revision scripts with upgrade and downgrade paths, autogeneration, transactional DDL, branch merging, and SQLite-oriented batch migrations.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Version schema changes through migration environments and revision scripts

alembic init creates a project-specific migration environment, and each revision can define upgrade() and downgrade() operations. Connection setup and script templates remain customizable for application-specific database and release workflows.

Sources: [2][4]

Autogenerate candidate migrations from model metadata and the live schema

Alembic can compare SQLAlchemy MetaData with the current database schema and render candidate migration directives. It also supports transactional DDL, branch and merge workflows, and batch table recreation for SQLite-style ALTER limitations.

Sources: [2][5]

Best fit

Fits Python backends that want schema evolution as reviewable source-controlled history

It is useful when SQLAlchemy models and database schemas evolve continuously and teams need reproducible upgrade paths committed with application code, including parallel development represented through the revision graph.

Sources: [2][4]

Before adoption

Treat autogenerate output as a draft and review the new 1.20.0 constraint warnings

Autogenerate produces candidate migrations that require manual review. Alembic 1.20.0 requires Python 3.10+ and SQLAlchemy 2.0+, and it adds warnings around unnamed CHECK constraints and drop operations without constraint names. Review naming conventions and downgrade behavior before applying a migration.

Sources: [3][5][6]

Official sources

  1. [1]sqlalchemy/alembic — GitHub repository(2026-10-06)
  2. [2]Alembic 1.20.0 — README(2026-10-06)
  3. [3]Alembic 1.20.0 — pyproject.toml(2026-10-06)
  4. [4]Alembic 1.20.0 tutorial(2026-10-06)
  5. [5]Alembic 1.20.0 autogenerate documentation(2026-10-06)
  6. [6]Alembic 1.20.0 release(2026-10-06)
  7. [7]Alembic MIT license(2026-10-06)
Supplemental curator note

Autogenerate reduces the initial migration authoring work, but it is not a substitute for review. Treat constraint names, data migrations, and downgrade reversibility as explicit code-review concerns.

Try it in 3 steps

  1. 1

    Install Alembic 1.20.0 and SQLAlchemy

    Pin Alembic in the same Python environment as the target project.

    python -m pip install "alembic==1.20.0" "SQLAlchemy==2.1.3"
  2. 2

    Create a migration environment

    Follow the official tutorial to generate alembic.ini, env.py, the versions directory, and related templates.

    alembic init alembic
  3. 3

    Create the first revision and inspect history

    Verify revision generation without applying database changes. Configure the target connection and review upgrade operations before running them against a real database.

    alembic revision -m "baseline" && alembic history
Check the official README

Growth

Growth trends · Last 30 days

4,431 Stars

Trend data is still being collected.

Built with

Categories and tags

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • python
  • sql
  • sqlalchemy
Stars
4,431
Forks
382
Watchers
24
Open issues
120
Contributors
199
Owner type
Organization
Primary language
Python
License
MIT
Repository last updated
Oct 5, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?