Reasonable defaults for Click CLI applications.
Project description
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
[!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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nob_py-1.3.2.tar.gz.
File metadata
- Download URL: nob_py-1.3.2.tar.gz
- Upload date:
- Size: 23.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db7bfbd9ffb8bb1557eb37df80478c5d4ee10975f390c9c448debf61f5e167ee
|
|
| MD5 |
a972e33d2a4609146db6c436e0801169
|
|
| BLAKE2b-256 |
868659c347944dbcdd2ca853280a10635634e9f018b40c12089d68ca8301c5e9
|
File details
Details for the file nob_py-1.3.2-py3-none-any.whl.
File metadata
- Download URL: nob_py-1.3.2-py3-none-any.whl
- Upload date:
- Size: 33.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d40586012a6ca6f27d30536c02f064b1ae818643c3cd4bb856826c9e2e7835c7
|
|
| MD5 |
8f261d9543136b17d8a86848920d08aa
|
|
| BLAKE2b-256 |
1079fd07d5b746b8388e1632fc63963372fd55d148a5e65f31f5ea37f1475569
|