🌈 Extra colorization and configuration file for Click.
Project description
Click Extra
What is Click Extra?
click-extra
is a collection of helpers and utilities for
Click, the Python CLI framework.
It provides boilerplate code and good defaults, as weel as some workarounds and patches that have not reached upstream yet (or are unlikely to).
Used in
- Mail Deduplicate - A CLI to deduplicate similar emails.
- Meta Package Manager - A unifying CLI for multiple package managers.
Installation
Install click-extra
with pip
:
$ pip install click-extra
Features
- TOML and YAML configuration file loader
- Colorization of help screens
--color/--no-color
option flag- 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
Issues addressed by click-extra
Keep track of things to undo if they reach upstream.
- Add a
no-color
option, method or parameter to disable colouring globally (#30) - Log level is leaking between invokations: hack to force-reset it (#29)
- Add missing string interpolation in error message (#24)
- Add trailing dot to help text (#18)
- Add support for option groups on
cloup.Group
(#98) - Styling metavars, default values, env var, choices (#97) & Highlights options, choices and metavars (#95)
- Add loading of options from a TOML configuration file (#96)
TOML configuration file
Allows a CLI to read defaults options from a configuration file.
Here is a sample:
# My default configuration file.
[my_cli]
verbosity = "DEBUG"
manager = ["brew", "cask"]
[my_cli.search]
exact = true
Colorization of help screen
Extend Cloup's own help formatter and theme to add colorization of:
- Options
- Choices
- Metavars
Dependencies
Here is a graph of Python package dependencies:
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-1.3.0.tar.gz
.
File metadata
- Download URL: click-extra-1.3.0.tar.gz
- Upload date:
- Size: 24.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b55eee6eacbbd5c44039e664819343f6fbb6a258b5d21c98c76876174c755a8 |
|
MD5 | a6f626f801104e902a87cbb607ac4b66 |
|
BLAKE2b-256 | a908523e620bc39c8a55d79dded97aa9b8e75719637aac6352fea3c52bac2655 |
File details
Details for the file click_extra-1.3.0-py3-none-any.whl
.
File metadata
- Download URL: click_extra-1.3.0-py3-none-any.whl
- Upload date:
- Size: 36.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa21525cc31c7159d95482305da56dc39ac5fd8e1ef64c03c0225921ae5d1df6 |
|
MD5 | 5c10fed52f656eab521026aec1bbe570 |
|
BLAKE2b-256 | 77dba5ab14ce43193b9c12f9ca54bf6f141a67ee84bffb2a1aed6bc9d3a4b45e |