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 ready-to-use wrapper 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 transforms 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
  • Automatic inference of the configuration file structure from your CLI's options
  • Remote loading of configuration files from URLs
  • Optional strict validation of configuration
  • Respect the default application path on each platform (XDG spec on Linux)
  • Glob search patterns for configuration files
  • Respect of CLI > Configuration > Environment > Defaults precedence
  • Normalization and discoverability of environment variables
  • --show-params option to debug parameters defaults, values, environment variables and provenance
  • Colorization of help screens at the semantic-level of options, parameters, subheadings, choices, metavars and defaults
  • Global show_envvar option to display all environment variables in help screens
  • -h/--help option names (see rant on other inconsistencies)
  • --color/--no-color option flag
  • --telemetry/--no-telemetry flag to opt-in/out of tracking code
  • Recognize traditional environment variable conventions:
  • Colored --version option
  • Colored --verbosity option and logs
  • --time/--no-time flag to measure duration of command execution
  • Global show_choices to activate selection of choices on user input prompts
  • Platform recognition utilities (macOS, Linux, Windows, UNIX, *BSD, …)
  • 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 directives 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.

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-4.1.0.tar.gz (73.1 kB view details)

Uploaded Source

Built Distribution

click_extra-4.1.0-py3-none-any.whl (98.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for click_extra-4.1.0.tar.gz
Algorithm Hash digest
SHA256 cdf2d62a7bb6b17a49a3bb05c918da2f89a9a7507b51e4e0ccd00e42fbe8852e
MD5 a581e544e73594d800e5f0ea51d2c925
BLAKE2b-256 2801fe28ca36d281ef1784255b0c4a504f6d58a289dd0ad252a83cf2ad31c902

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for click_extra-4.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 687327e5ed017a3a02c0d17b9dd3285ed4a4a43f3415e968f8a3b5b307c99cf0
MD5 86ff3a90e429fb92de4d2b467ef0dcad
BLAKE2b-256 c179edd4f2a49a8feed8c4adba5a6a877c4058343ed056142a71109b1a7447e5

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