| Crates.io | pynit |
| lib.rs | pynit |
| version | 0.1.1 |
| created_at | 2022-12-07 19:23:31.873316+00 |
| updated_at | 2022-12-07 19:56:27.255456+00 |
| description | Small CLI tool to initialize a python project |
| homepage | https://gitea.antoine-langlois.net/DataHearth/pynit |
| repository | https://gitea.antoine-langlois.net/DataHearth/pynit |
| max_upload_size | |
| id | 732088 |
| size | 67,312 |
pynit speed up the process of creating a new python project. It can initialise the project with git,
a virtual environment (using the venv module) and creating a basic folder structure if wanted.
Small CLI tool to initialize a python project
Usage: pynit [OPTIONS] <COMMAND>
Commands:
new
init
help Print this message or the help of the given subcommand(s)
Options:
-v, --verbose Output will be more verbose
-c, --complete Initialize with minimal fields for "pyproject.toml"
--git Initialize folder with a git repository
--venv <VENV> Initialize a new virtual environment with given name in initialized directory
--layout <LAYOUT> Define a layout for your project (https://setuptools.pypa.io/en/latest/userguide/package_discovery.html) [possible values: src, flat]
-h, --help Print help information
-V, --version Print version information
2 subcommands are available: new and init. Each of them have the same flags (defined globally).
Adding this flag will make the STDOUT more verbose.
NOTE: the flag doesn't do anything currently as logging is not yet implemented.
--complete allows you to control how much questions will be asked during the initialisation of the pyproject.toml. By default, only required fields will be asked: build-sytem section, project.name and project.version.
Initialise a git repository
Add a virtual environment to your python project with a given name.
Add a default popular folder structure to your project.
Two options are available: flat and src.
For more information, check out this setuptools section.
new acts like cargo new. It take one argument which is the project name. Project name will be the folder name and used as default when asking questions to create a basic pyproject.toml.
The directory must NOT exist before creating the project.
$ pynit --git --venv .env --layout flat new my_project
$ exa -a --tree --level=2 my_project
my_project
├── .env
│ ├── ...
├── .git
│ ├── ...
├── .gitignore
├── my_project
│ └── __init__.py
└── pyproject.toml
Like new, init does the same thing. Except it'll initiase the current directory.
NOTE: if a .gitignore and/or a pyproject.toml is present, they'll be truncated.