Skip to main content

🌈 Extra colorization and configuration loading for Click.

Project description

Click Extra

Last release Python versions Unittests status Documentation status Coverage status DOI

What is Click Extra?

A collection of helpers and utilities for Click, the Python CLI framework.

It is a drop-in replacement with good defaults that saves lots of boilerplate code and frustration. It also comes with workarounds and patches that have not reached upstream yet (or are unlikely to).

Example

It can transform this vanilla click CLI:

click CLI help screen

Into this:

click-extra CLI help screen

To undestrand how we ended up with the result above, go read the tutorial.

Features

  • Configuration file loader for:
    • TOML
    • YAML
    • JSON, with inline and block comments (Python-style # and Javascript-style //)
    • INI, with extended interpolation, multi-level sections and non-native types (list, set, …)
    • XML
  • Download configuration from remote URLs
  • Optional strict validation of configuration
  • Search of configuration file from default user folder and glob patterns
  • Respect of CLI > Configuration > Environment > Defaults precedence
  • --show-params option to debug parameters defaults, values, environment variables and provenance
  • Colorization of help screens
  • -h/--help option names (see rant on other inconsistencies)
  • --color/--no-color option flag
  • Recognize the NO_COLOR environment variable convention from no-color.org
  • Colored --version option
  • Colored --verbosity option and logs
  • --time/--no-time flag to measure duration of command execution
  • Platform recognition utilities (macOS, Linux and Windows)
  • New conditional markers for pytest:
    • @skip_linux, @skip_macos and @skip_windows
    • @unless_linux, @unless_macos and @unless_windows
    • @destructive and @non_destructive
  • .. click:example:: and .. click:run:: Sphinx extensions to document CLI source code and their execution
  • ANSI-capable Pygments lexers for shell session and console output
  • Pygments styles and filters for ANSI rendering
  • Fixes 30+ bugs from other Click-related projects
  • Rely on cloup to add:
    • option groups
    • constraints
    • subcommands sections
    • aliases
    • command suggestion (Did you mean <subcommand>?)

Used in

Check these projects to get real-life examples of click-extra usage:

Feel free to send a PR to add your project in this list if you are relying on Click Extra in any way.

Development

Development guidelines are the same as parent project mpm, from which click-extra originated.

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

click_extra-3.8.3.tar.gz (60.9 kB view details)

Uploaded Source

Built Distribution

click_extra-3.8.3-py3-none-any.whl (80.1 kB view details)

Uploaded Python 3

File details

Details for the file click_extra-3.8.3.tar.gz.

File metadata

  • Download URL: click_extra-3.8.3.tar.gz
  • Upload date:
  • Size: 60.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for click_extra-3.8.3.tar.gz
Algorithm Hash digest
SHA256 53f2a5b68e79c81b6a574ad8a6e22f4d9b1e36261c7630097231a7f5a72427b6
MD5 2c77e867da0e41148b79766f8873b367
BLAKE2b-256 d16040d04e998740c5f1563fd94391a2835770e1444859c0faf69f7bd06c30a4

See more details on using hashes here.

File details

Details for the file click_extra-3.8.3-py3-none-any.whl.

File metadata

  • Download URL: click_extra-3.8.3-py3-none-any.whl
  • Upload date:
  • Size: 80.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for click_extra-3.8.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bc9ffe66b44a3276c10bc351dc3139ef3284af0c5ef85a8e04552176ed883f7e
MD5 f095281d1bb427bb6fed6dc4d447260b
BLAKE2b-256 4866544253fbf380ede430dc868f85704f6b8ebabf6a78bb48f4d6a4b40b0ff5

See more details on using hashes here.

Supported by

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