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
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
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
Metadata
Release files for nob.py 1.6.1
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.6.1.tar.gz | 25.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nob_py-1.6.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 61.9 kB
Release files / nob_py-1.6.1.tar.gz
| Download URL | nob_py-1.6.1.tar.gz |
|---|---|
| Size | 25.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
616a27144170f1d3f655b52019f7fea781fd0dce1827615879a22feedd98688d
|
|
BLAKE2b-256 checksum How to use checksums |
cd8512af257a418631a4ffc54222e2375d7b7bcda6b908a0a849814f1e772c19
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","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.6.1-py3-none-any.whl
| Download URL | nob_py-1.6.1-py3-none-any.whl |
|---|---|
| Size | 36.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6c4329765681ed8691d5c508c94b83ac3a3c2cecf20181f68a258a4d2ecb61c9
|
|
BLAKE2b-256 checksum How to use checksums |
ab1aeacf7be29457c81541747c71401dfe5d9cd67142172c05c77adece86d520
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","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}
|