Skip to main content

Nob.py

Python version PyPI version License: MIT Read the wiki OS GitHub profile

Reasonable defaults for Click CLI applications with rich logging...
... and additional goodies.

  1. Installation
  2. Usage
  3. Contributing

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

  1. 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"
    
  2. 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
Before committing

We (I) work with ruff, ty and pytest.

just format check ty test
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)

Source distribution for nob.py 1.5.0
File Size Uploaded
nob_py-1.5.0.tar.gz 25.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nob.py 1.5.0
File Interpreter ABI Platform
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}

Release history Release notifications | RSS feed

1.6.1

2 release files

1.6.0

2 release files

1.5.2

2 release files

1.5.1

2 release files

This release

1.5.0 This release

2 release files

1.4.0

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page