Skip to main content

Barmaid Logo

Barmaid

Visualize your Alembic migrations with style.

Features • Installation • Usage • License


Barmaid is a lightweight, zero-dependency CLI tool that instantly converts your Alembic migration history into clear, meaningful Mermaid flowcharts.

Database migrations can get messy. Branches, merges, and head entanglements are hard to track in your head. Barmaid helps you see the state of your database schema evolution at a glance.

✨ Features

  • 🚀 Zero Dependencies: Built with pure Python standard library. No bloat, no conflicts.
  • 🌳 Complex Topography: Flawlessly handles branches, merges, and multiple heads.
  • 🕵️‍♀️ Health Checks: Automatically detects and visually highlights orphaned revisions (missing parents).
  • 🎨 Highly Customizable:
    • Switch orientations (Top-Down, Left-to-Right, etc.).
    • Output to file or stdout.
  • 📦 Drop-in Ready: Works with any standard Alembic folder structure automatically.

📦 Installation

Install directly from source:

pip install .

Note: Barmaid requires Python 3.10 or higher.

🚀 Usage

Navigate to your project directory and let Barmaid do the rest. It will automatically hunt for your versions directory.

# Generate diagram and print to stdout
barmaid

Common Commands

Save to a file:

barmaid -o schema_evolution.mmd

Change orientation (Left-to-Right):

# Great for long, linear histories
barmaid -d LR

Specify a custom versions directory:

barmaid ./src/alembic/versions

CLI Options

Option Description Default
path Path to versions directory Auto-detected
-o, --output Save output to a file stdout
-d, --direction Graph direction (TD, LR, BT, RL) TD
--no-orphans Hide missing parent nodes True (shown)
-v, --version Show version information -

📊 Visualizing the Output

Barmaid outputs standard Mermaid syntax. You can view the diagrams in:

  1. GitHub / GitLab: Paste the output into any Markdown file (like a PR description or Wiki).
  2. Mermaid Live Editor: Copy-paste for an instant interactive preview.
  3. VS Code: Use the Mermaid Preview extension.

Example Output

graph TD
    a1b2c3d4["init_schema<br/>Create user table"]
    e5f6g7h8["add_email_column<br/>Add email to users"]
    i9j0k1l2["create_posts<br/>Add posts table"]
    
    a1b2c3d4 --> e5f6g7h8
    e5f6g7h8 --> i9j0k1l2
    classDef default fill:#f9f9f9,stroke:#333,stroke-width:2px

🤝 Contributing

Contributions are welcome! If you find a bug or have a feature request, please open an issue or submit a pull request.

📄 License

This project is licensed under the MIT License.

Metadata

Release files for barmaid 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for barmaid 0.0.2
File Size Uploaded Provenance Actions
barmaid-0.0.2.tar.gz 5.9 kB Without provenance Details for barmaid-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for barmaid 0.0.2
File Interpreter ABI Platform Actions
barmaid-0.0.2-py3-none-any.whl Python 3 none any Details for barmaid-0.0.2-py3-none-any.whl

Total release size: 12.1 kB

Release files / barmaid-0.0.2.tar.gz

Download URL barmaid-0.0.2.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
61e45b40b2c6657b5e3558a7284d92759899f059521f810bc2fadc85bcbf7e3d
BLAKE2b-256 checksum
How to use checksums
370a924a1a159540b01ea14be672ec14421a13306cce5e5ce63faaab4aeca043
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.2

Release files / barmaid-0.0.2-py3-none-any.whl

Download URL barmaid-0.0.2-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
04e8090a9a7d287d3f46da36c22f821f044ac6fbb84ad3b2b9db3a2b64b994b7
BLAKE2b-256 checksum
How to use checksums
0519e373fb87f12a29072a795c11147910850a1a7ffa3b3574d2c4aff067faab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.2

Security for barmaid 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page