🌈 Extra colorization and configuration loading for Click.
Project description
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 you some boilerplate code. 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:
Into this:
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, sets, …)XML
- Download configuration from remote URLs
- Optional strict validation of configuration
- Automatic search of configuration file from default user folder
- Respect of
CLI > Configuration > Environment > Defaults
precedence - 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 fromno-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
- 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:
- Mail Deduplicate - A CLI to deduplicate similar emails.
- Meta Package Manager - A unifying CLI for multiple package managers.
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
Built Distribution
File details
Details for the file click-extra-3.0.0.tar.gz
.
File metadata
- Download URL: click-extra-3.0.0.tar.gz
- Upload date:
- Size: 41.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8b71479ebc4c3c62c9d737547af98d6095d49660cd5cf7ef16f9152ac072874 |
|
MD5 | 09f266bf33b0d2441065759b8f181dd0 |
|
BLAKE2b-256 | bc7feb9708a6c8b49a4206d3b377f82e487ea8f86cbb948ac27cbb2a7ac3cc44 |
File details
Details for the file click_extra-3.0.0-py3-none-any.whl
.
File metadata
- Download URL: click_extra-3.0.0-py3-none-any.whl
- Upload date:
- Size: 63.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1c3687b7329c43a85d0873f3a5a0d5c7a34db066e4ebc56a316e1831e05d36f |
|
MD5 | 25b2aecb2b4fcb82a967f0daeca41286 |
|
BLAKE2b-256 | c36b970a04dd0aede134984c5ade401ed1b7903722718279d3063ca6aebdab6f |