Skip to main content

Reasonable defaults for Click CLI applications.

Project description

Nob.py

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

  1. Installation
  2. Usage
  3. Contributing
  4. TODOs

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

Usage

import logging

from nob import cli


@cli.cmd()
@cli.opt("--name", required=True, help="Greet someone.")
def hello(lg: logging.Logger, name: str):
    lg.info("Hello %s", name)


if __name__ == "__main__":
    hello()

run with:

uv run <file.py> --name "Eric Norbert"

Get more usage examples in the Wiki.

Contributing

[!Important] Sign your commits.

Clone the repository if you have direct right access or clone your fork:

git clone git@github.com:ThomasByr/nob.py nob

Then:

  1. Install uv if you haven't already (or run uv self update):

    Linux Bash
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
    Windows Powershell
    powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
    
  2. Install just:

    cargo install --locked just just-lsp
    

    List all available recipes by typing just.

  3. Sync the codebase dependencies

    Without explicit --all-extras syncing, some recipes will not evaluate on optional dependencies and functionalities.

    just sync
    

Run the following recipes before committing.

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

just format check ty test

[!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.

TODOs

  • workflow to publish to PyPI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nob_py-0.1.1.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nob_py-0.1.1-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

File details

Details for the file nob_py-0.1.1.tar.gz.

File metadata

  • Download URL: nob_py-0.1.1.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","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

Hashes for nob_py-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d94e8df1e4434a170eb7028143107776c6fb4bd19a5e9e07b79112e03383d70b
MD5 1e2b9f91b23ec4b7aebcfc3f45fbd7ff
BLAKE2b-256 711dd0cf6109e99294b417743ec9b7b8115d2917e392ab6874d916b891baa1d6

See more details on using hashes here.

File details

Details for the file nob_py-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: nob_py-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 24.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","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

Hashes for nob_py-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f5f28f6a72c555b9cafd4f0d965c6d7193c8a534c0159ae5701436e780e93713
MD5 0fc62cf88d7c1e01d11b58a891907960
BLAKE2b-256 0facc5f7c2f2e98710e8024e160cfa06265fd766ab3f947feac139b3c749b6f7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page