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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file nomade-1.0.0.tar.gz.

File metadata

  • Download URL: nomade-1.0.0.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.17 CPython/3.7.4 Linux/5.0.0-29-generic

File hashes

Hashes for nomade-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f7f204e282401dc807960ec1d94e0f5bcc2ae7a7f5aa5d735845ddd42ef7481f
MD5 1465bcd24af21fef237d8ab697182b4f
BLAKE2b-256 c5b6b9e8752c806e50a7d873b949a2ccd244ea12365e5f695f1dc5d21e9fa7c4

See more details on using hashes here.

File details

Details for the file nomade-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: nomade-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.17 CPython/3.7.4 Linux/5.0.0-29-generic

File hashes

Hashes for nomade-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d8809f7c81c706c5832529506731ff3bff5fb47694e64872a5d265223a3537a
MD5 f163b3d39a9b241bd959a7cd7cee18e9
BLAKE2b-256 0fcf16d79aedb7911dbb3db838861c5d5e0282a91a6d83bd3d812a95cc41b8d3

See more details on using hashes here.

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