🌈 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 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:
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
,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 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
.. 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:
- Meta Package Manager - A unifying CLI for multiple package managers.
- Mail Deduplicate - A CLI to deduplicate similar emails.
- fireproxng - A rewrite of the fireprox tool.
- badger-proxy - An mDNS-based reverse proxy for naming services on a local network.
- Molecular Dynamics Trajectory Analysis
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
Built Distribution
File details
Details for the file click_extra-3.9.0.tar.gz
.
File metadata
- Download URL: click_extra-3.9.0.tar.gz
- Upload date:
- Size: 61.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8d28bb81cbb5e6a18dae928b3594cead0a9475d3395649ea833cc7829d6a603 |
|
MD5 | 86050b3b0a9332601ea59d851cd36481 |
|
BLAKE2b-256 | 7469bd35a759f4d18f73fe28e0e4f1bc04dc36a45f4397ee318507039f013370 |
File details
Details for the file click_extra-3.9.0-py3-none-any.whl
.
File metadata
- Download URL: click_extra-3.9.0-py3-none-any.whl
- Upload date:
- Size: 82.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4f0bbf067b14d920a102e9969e74484127b3aafeb2817b892c4a4f63eee6abf |
|
MD5 | 85cac35153004efd718a2d7f1626037c |
|
BLAKE2b-256 | 6bbb63e24160d6d5e49ecd0074da6d5410793663fab68e1048b8a7ded5a938b7 |