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

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

  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

Metadata

Release files for nob.py 1.5.1

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.1
File Size Uploaded
nob_py-1.5.1.tar.gz 25.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nob.py 1.5.1
File Interpreter ABI Platform
nob_py-1.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 60.7 kB

Release files / nob_py-1.5.1.tar.gz

Download URL nob_py-1.5.1.tar.gz
Size 25.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0dd5e03a2a668581aaf8c817dae0d5b27b8d0515557611b17c644bd4e9a5b4d3
BLAKE2b-256 checksum
How to use checksums
7d4ddaca8472ca086c933a91617b915997f77afceb85d13df3dc20a1fa414384
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.14 {"installer":{"name":"uv","version":"0.12.14","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.1-py3-none-any.whl

Download URL nob_py-1.5.1-py3-none-any.whl
Size 35.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8eece9044b6b605d16a6257534953631cd298102df53150157ab7ba51451b4d2
BLAKE2b-256 checksum
How to use checksums
7637597eb05967ff51e42bd8cdbc4b20087a1b2863123d5245f99e999e5fe77c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.14 {"installer":{"name":"uv","version":"0.12.14","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

This release

1.5.1 This release

2 release files

1.5.0

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