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.2

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.2
File Size Uploaded
nob_py-1.5.2.tar.gz 25.3 kB Details

Built distribution (wheel)

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

Total release size: 60.9 kB

Release files / nob_py-1.5.2.tar.gz

Download URL nob_py-1.5.2.tar.gz
Size 25.3 kB
Tags Source
SHA-256 checksum
How to use checksums
13c09a97eae7ef15f991b20fe46f89555c34ed4e0a69f14dcf0ba4c823799ced
BLAKE2b-256 checksum
How to use checksums
a623032f0674506ff7852e7d753afc396310dca76b1723e30d4b3ea1356e6c60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","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.2-py3-none-any.whl

Download URL nob_py-1.5.2-py3-none-any.whl
Size 35.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e6820c6ae17fdb60f83ef20f279da2dc975b5c52ef08dcc84b7667a2711f6b0
BLAKE2b-256 checksum
How to use checksums
9dc8dc952c38c284f90917d07782e4a125cfd7f07fa1555fcf1aac8ec723c839
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","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

This release

1.5.2 This release

2 release files

1.5.1

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