Nob.py
Reasonable defaults for Click CLI applications with rich logging...
... and additional goodies.
Installation
uv add nob.py
Or:
pip install nob.py
Install from GitHub
uv add git+https://github.com/ThomasByr/nob.py --branch main
or lock a specific version:
uv add git+https://github.com/ThomasByr/nob.py --tag v0.1.3
Or if you are using pip
pip install git+https://github.com/ThomasByr/nob.py@main
You may directly also use @ with a tag, for example:
pip install git+https://github.com/ThomasByr/nob.py@v0.1.3
Available extras
ipc- for inter-process communication with posix_ipc (Linux and MacOS only).
Usage
[!Note] Get more usage examples in the Wiki.
from nob import cli
@cli.cmd()
@cli.opt("--name", required=True, help="Greet someone.")
def hello(lg: cli.Logger, name: str):
lg.info("Hello %s", name)
if __name__ == "__main__":
hello()
run with:
uv run <file.py> --name "Eric Norbert"
Replace uv run with python once your environment is activated - if you don't use uv.
Contributing
[!Important] Sign your commits.
Pre-requisites
-
Install uv if you haven't already (or run
uv self update):Linux Bash
curl -LsSf https://astral.sh/uv/install.sh | sh
or
wget -qO- --content-disposition https://astral.sh/uv/install.sh | sh
Windows Powershell
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
-
Install just:
With uv
uv tool install rust-just
Or if you have cargo
This way you can also install just-lsp.
cargo install --locked just just-lsp
Useful just recipes
List all available recipes
just
Sync the codebase dependencies
Without explicit --all-extras syncing, some recipes will not evaluate on optional dependencies and functionalities.
The sync recipe will also update the dependencies if possible.
just sync
Release a new version
This recipe uses release-it. You will need a working npx installation.
Install fnm with cargo
cargo install fnm --locked
fnm install --lts
fnm use --lts
just release
[!TIP] Install pre-commit hooks:
just pc-install.
To keep hooks somewhat fast enough, they will only check (not forcibly fix) for typing and formatting.
Metadata
Release files for nob.py 1.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nob_py-1.5.0.tar.gz | 25.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nob_py-1.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 60.5 kB
Release files / nob_py-1.5.0.tar.gz
| Download URL | nob_py-1.5.0.tar.gz |
|---|---|
| Size | 25.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a9f815f1e1bc827e8bafdee143eae7ac23eac56c8e965db43dd6e4874e559f3f
|
|
BLAKE2b-256 checksum How to use checksums |
a1a080afbd62e95674a7fb5b61d069ade8e67c961cb0e3ded76255f2fa4b1115
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / nob_py-1.5.0-py3-none-any.whl
| Download URL | nob_py-1.5.0-py3-none-any.whl |
|---|---|
| Size | 35.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
99b324228bd4491fa5dfbf34bd43be80e8ea0a3ad301712d0f25600273aed747
|
|
BLAKE2b-256 checksum How to use checksums |
7d93c3e67ab72fea49e5f2236380beac92c5610f9c1a507728495783508ed802
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|