Skip to main content

Migration Manager for Humans

Project description

Nomade Logo

Python Migration Manager for Humans :camel:

Nomade is a simple migration manager tool that aims to be easy to integrate with any ORM (e.g. SQLAlchemy, Peewee, Pony) and database (e.g. SQLite, MySQL, PostgreSQL). It is basically a command-line interface (CLI) tool that manages migrations (Python files) by applying changes to the database schema and storing the current migration ID.

This tool was inspired by alembic (if you are using SQLAlchemy as ORM you should consider using alembic).

Note: this project is still under development so you may find bugs. If you find any bug, feel free to contribute by creating an issue and/or submitting a PR to fix it.

Installation

Use pip to install Nomade:

$ pip install nomade

Quick Start

Initialize a Nomade project:

$ nomade init

It will create the following project structure:

.
├── nomade
│   ├── template.py.j2
│   └── migrations
└── pyproject.toml

Define Nomade settings in the pyproject.toml file, for example:

[tool.nomade]
migrations = "nomade/migrations"
template = "nomade/template.py.j2"
connection-string = "sqlite:///nomade.db"
date-format = "%d/%m/%Y"
name-format = "{date}_{time}_{id}_{slug}"

Then, create your first migration:

$ nomade migrate "Create first table"

Implement the upgrade and downgrade functions in the migration file.

Then apply the migration to the database:

$ nomade upgrade head

To discover more Nomade features please read the documentation or call for help:

$ nomade --help

Usage: nomade [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  current    Show the current migration.
  downgrade  Downgrade migrations.
  history    Show migrations history.
  init       Init a Nomade project.
  migrate    Create a new migration.
  stamp      Stamp a specific migration to the database.
  upgrade    Upgrade migrations.
  version    Show Nomade version.

How to Contribute

  • Check for open issues or open a fresh one to start a discussion around a feature idea or a bug.
  • Become more familiar with the project by reading the Contributor's Guide.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nomade-1.0.0.tar.gz (14.0 kB view hashes)

Uploaded Source

Built Distribution

nomade-1.0.0-py3-none-any.whl (15.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page