This repository has been archived by the owner on May 25, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
16,708 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,7 +64,7 @@ instance/ | |
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
#docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: c9029b17966ef819213e3a3231729aa3 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.. include:: ../CHANGELOG.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
Commands | ||
======== | ||
|
||
Here you can find a description of all ``Nomade`` commands: | ||
|
||
Version | ||
------- | ||
|
||
Show the ``Nomade`` version. | ||
|
||
Usage: | ||
|
||
$ nomade version | ||
|
||
Init | ||
---- | ||
|
||
Initialize a ``Nomade`` project. | ||
|
||
Usage: | ||
|
||
$ nomade init | ||
|
||
Migrate | ||
------- | ||
|
||
Create a new ``Nomade`` migration. | ||
|
||
Usage: | ||
|
||
$ nomade migrate "My First Migration" | ||
|
||
Upgrade | ||
------- | ||
|
||
Upgrade database version. | ||
|
||
Usage: | ||
|
||
$ nomade upgrade head | ||
|
||
$ nomade upgrade 1 | ||
|
||
Downgrade | ||
--------- | ||
|
||
Downgrade database version. | ||
|
||
Usage: | ||
|
||
$ nomade downgrade tail | ||
|
||
$ nomade downgrade 1 | ||
|
||
History | ||
------- | ||
|
||
Show migration history. | ||
|
||
Usage: | ||
|
||
$ nomade history | ||
|
||
Current | ||
------- | ||
|
||
Show the current migration applied in the database. | ||
|
||
Usage: | ||
|
||
$ nomade current | ||
|
||
Help | ||
---- | ||
|
||
Show ``Nomade`` helper. | ||
|
||
Usage: | ||
|
||
$ nomade --help | ||
|
||
Stamp | ||
----- | ||
|
||
Stamp a specific migration to the database. | ||
|
||
**Note**: this command will not run any migration, it will only save the migration ID in the database. | ||
|
||
Usage: | ||
|
||
$ nomade stamp u19jh2h1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.. include:: ../CONTRIBUTING.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.. Nomade documentation master file, created by | ||
sphinx-quickstart on Sat Aug 24 23:24:41 2019. | ||
You can adapt this file completely to your liking, but it should at least | ||
contain the root `toctree` directive. | ||
RST examples: https://pythonhosted.org/an_example_pypi_project/sphinx.html | ||
.. image:: ../artwork/logo.svg | ||
:alt: Nomade: Python Migration Manager for Humans | ||
:align: center | ||
:width: 250 | ||
|
||
Introduction | ||
============ | ||
|
||
Python Migration Manager for Humans. | ||
|
||
Nomade is a simple migration manager tool that aims to be easy to integrate with any ORM. | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Contents: | ||
|
||
quickstart | ||
commands | ||
settings | ||
Contributing <contributing> | ||
changelog | ||
modules | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
nomade | ||
====== | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
|
||
nomade |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
nomade package | ||
============== | ||
|
||
Submodules | ||
---------- | ||
|
||
nomade.database module | ||
---------------------- | ||
|
||
.. automodule:: nomade.database | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
nomade.main module | ||
------------------ | ||
|
||
.. automodule:: nomade.main | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
nomade.migration module | ||
----------------------- | ||
|
||
.. automodule:: nomade.migration | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
nomade.migrations module | ||
------------------------ | ||
|
||
.. automodule:: nomade.migrations | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
nomade.nomad module | ||
------------------- | ||
|
||
.. automodule:: nomade.nomad | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
nomade.settings module | ||
---------------------- | ||
|
||
.. automodule:: nomade.settings | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
nomade.utils module | ||
------------------- | ||
|
||
.. automodule:: nomade.utils | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
|
||
Module contents | ||
--------------- | ||
|
||
.. automodule:: nomade | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
Quick Start | ||
=========== | ||
|
||
Here you can find a quick tutorial with basic ``Nomade`` commands. | ||
|
||
virtualenv | ||
---------- | ||
|
||
We recommend the use of a virtual environment to run develop any Python project. You can create a virtual environment using ``virtualenv`` tool, for example: | ||
|
||
$ pip install virtualenv | ||
|
||
$ virtualenv venv | ||
|
||
$ source venv/bin/activate | ||
|
||
Installation | ||
------------ | ||
|
||
With the virtual environment created and activated you are ready to go. Go ahead and install ``Nomade`` with: | ||
|
||
$ pip install nomade | ||
|
||
Basic commands | ||
-------------- | ||
|
||
Initialize a ``Nomade`` project with: | ||
|
||
$ nomade init | ||
|
||
Set the settings in the `pyproject.toml` file. | ||
|
||
Then, create your first migration: | ||
|
||
$ nomade migrate "My first migration" | ||
|
||
Then apply the migration to the database: | ||
|
||
$ nomade upgrade head | ||
|
||
These are the basic ``Nomade`` commands, to discover more features please read the :doc:`Commands <commands>` section or run the following command: | ||
|
||
$ nomade --help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Settings | ||
======== | ||
|
||
**Nomade** can be customized by defining the following settings in the ``pyproject.toml`` file. | ||
|
||
Description | ||
----------- | ||
|
||
- **migrations**: Path to the migrations folder. | ||
- **template**: Path to the template file. | ||
- **connection-string**: String to connect to the database. The connection string can also be set by an environment variable (``CONNECTION_STRING``). | ||
- **date-format**: Date format (follows the `Python date format <https://docs.python.org/3/library/datetime.html>`_). | ||
- **name-format**: Name format (options are: ``date``, ``time``, ``id`` and ``slug``). | ||
|
||
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}" |
Oops, something went wrong.