Skip to main content

An opinionated CLI tool to manage python projects.

Project description

PyPrj

An opinionated CLI tool to manage python projects.

Installation

A good way to install CLI tools made with python is using pipx.

pipx install pyprj

With it, the tool is globally installed in an isolated environment.

Usage

Look at the help messages from the CLI (pass --help). Some of the messages are bellow.

Main command

 pyprj --help
usage: pyprj [-h] {init,test,docs} ...

A CLI to manage python projects with predefined tools.

options:
  -h, --help        Show this help message and exit.

subcommands:
  {init,test,docs}
    init            Create a new project for a python package.
    test            Run task 'test' inside the project.
    docs            Manage documentation of the project.

init subcommand

 pyprj init --help
usage: pyprj init [-h] [-p <python>] [-b <black-line-length>]

Create a new project for a python package.

options:
  -h, --help            Show this help message and exit.

  -p <python>, --python <python>
                        The Python interpreter to use to determine the minimum
                        supported Python version.
                        Defaults to '3.12'.

  -b <black-line-length>, --black-line-length <black-line-length>
                        Line length parameter to use with `black`.
                        Defaults to '128'.

test subcommand

 pyprj test --help
usage: pyprj test [-h]

Run task 'test' inside the project.

This command only runs the task 'test' inside the project.
Tasks use the tool 'taskipy'. Currently are run with the tool 'uv.'
The task 'test' runs tests with 'pytest' in folder './tests'.

options:
  -h, --help  Show this help message and exit.

docs subcommand

 pyprj docs --help
usage: pyprj docs [-h] {init,nbmd,nbex,modm} ...

Manage documentation of the project.

If called without subcommands, runs the task 'docs' inside the project.
Tasks use the tool 'taskipy'. Currently are run with the tool 'uv.'
The task 'docs' makes docs with 'sphinx' in folder './doc/sphinx'.

options:
  -h, --help            Show this help message and exit.

subcommands:
  {init,nbmd,nbex,modm}
    init                Initialize documentation folder with packages.
    nbmd                Process jupyter (nb) files to generate markdown (md) files.
    nbex                Process jupyter (nb) files to generate example files of code.
    modm                Process documentation in modules.

docs/init subcommand

 pyprj docs init --help
usage: pyprj docs init [-h]

Initialize documentation folder with packages.

options:
  -h, --help  Show this help message and exit.

docs/nbmd subcommand

 pyprj docs nbmd --help
usage: pyprj docs nbmd [-h] [-k {tutorial,function,class}] [-n] [-r <pattern>] [filepath ...]

Process jupyter (nb) files to generate markdown (md) files.

positional arguments:
  filepath              The filepath or filepaths of jupyter notebook (`.ipynb`) to convert
                        to markdown. If `None` (default), process all notebook files from
                        the current directory.

options:
  -h, --help            Show this help message and exit.

  -k {tutorial,function,class}, --kind {tutorial,function,class}
                        The kind of the notebook files documentation to convert.
                        Defaults to 'tutorial'.

  -n, --no-prettier     Whether to not pos-process the generate .md files with
                        'prettier', if 'prettier' is available.
                        Defaults to 'False'.

  -r <pattern>, --remove-pattern-shell-files <pattern>
                        Pattern to remove in shell command line cells. Aiming to
                        remove example command line folders from path.
                        Defaults to 'examples/'.

docs/nbex subcommand

 pyprj docs nbex --help
usage: pyprj docs nbex [-h] [-c] [-d <dest-directory>] [-o <output-suffix>] [filepath ...]

Process jupyter (nb) files to generate example files of code,
creating files from the cells starting with '%%python'

positional arguments:
  filepath              The filepath or filepaths of jupyter notebook (`.ipynb`) to
                        generate examples. If `None` (default), process all notebook
                        files from the current directory.

options:
  -h, --help            Show this help message and exit.

  -c, --change-shell-cells
                        Whether to edit the following shell cells, after the
                        example cells.
                        Defaults to 'False'.

  -d <dest-directory>, --dest-directory <dest-directory>
                        Directory of the resulting examples files.
                        Defaults to 'examples'.

  -o <output-suffix>, --output-suffix <output-suffix>
                        If editing original notebook file
                        (`change_shell_cells=True`) add this
                        suffix to the resulting file. Used for debbuging
                        purposes, to not overwrite
                        the original file (which is done with the default
                        value).
                        Defaults to ''.

docs/modm subcommand

 pyprj docs modm --help
usage: pyprj docs modm [-h] [filepath ...]

Process documentation in modules.

positional arguments:
  filepath    The filepath or filepaths of modules (.py) to process.
              If `None` (default), process all python files from the current directory.

options:
  -h, --help  Show this help message and exit.

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

pyprj-0.3.0.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyprj-0.3.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file pyprj-0.3.0.tar.gz.

File metadata

  • Download URL: pyprj-0.3.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pyprj-0.3.0.tar.gz
Algorithm Hash digest
SHA256 9c24e7f1697a3f9b2bba8d9c1d08ccc3ca5507e7bed388cbb36a32cb08bfc656
MD5 4ff8141c6c556994d39d7aba7ef1ad2b
BLAKE2b-256 56ffcd500cf2baf737fc75c449b473def5fd3dd9b34e08139125fa7e3d88f518

See more details on using hashes here.

File details

Details for the file pyprj-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pyprj-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pyprj-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a3d2f38a52c4fb941357f8399d755f7c3b979842ce2d9cd621b5d7a1aa910a3
MD5 55d9ffc097044ac6cd5d5a815d09473b
BLAKE2b-256 95592dd6ae443c9c524ac2cfee4b8c7aaa21251ebff5a1f170d65be197be6d3c

See more details on using hashes here.

Supported by

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