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.

Files for nomade, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size nomade-1.0.0-py3-none-any.whl (15.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size nomade-1.0.0.tar.gz (14.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page