click-extra


Nameclick-extra JSON
Version 4.7.5 PyPI version JSON
download
home_pagehttps://github.com/kdeldycke/click-extra
Summary🌈 Extra colorization and configuration loading for Click.
upload_time2024-04-05 10:54:37
maintainerNone
docs_urlNone
authorKevin Deldycke
requires_python<4.0,>=3.8
licenseGPL-2.0-or-later
keywords ansi-colors cli cloup colorization configuration console ini json logging multiplatform pygments pytest python python-tabulate sphinx terminal toml xml yaml
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
  <a href="https://github.com/kdeldycke/click-extra/">
    <img src="https://raw.githubusercontent.com/kdeldycke/click-extra/main/docs/assets/logo-banner.svg" alt="Click Extra">
  </a>
</p>

[![Last release](https://img.shields.io/pypi/v/click-extra.svg)](https://pypi.python.org/pypi/click-extra)
[![Python versions](https://img.shields.io/pypi/pyversions/click-extra.svg)](https://pypi.python.org/pypi/click-extra)
[![Downloads](https://static.pepy.tech/badge/click_extra/month)](https://pepy.tech/project/click_extra)
[![Unittests status](https://github.com/kdeldycke/click-extra/actions/workflows/tests.yaml/badge.svg?branch=main)](https://github.com/kdeldycke/click-extra/actions/workflows/tests.yaml?query=branch%3Amain)
[![Coverage status](https://codecov.io/gh/kdeldycke/click-extra/branch/main/graph/badge.svg)](https://app.codecov.io/gh/kdeldycke/click-extra)
[![Documentation status](https://github.com/kdeldycke/click-extra/actions/workflows/docs.yaml/badge.svg?branch=main)](https://github.com/kdeldycke/click-extra/actions/workflows/docs.yaml?query=branch%3Amain)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7116050.svg)](https://doi.org/10.5281/zenodo.7116050)

## What is Click Extra?

A ready-to-use wrapper for [Click](https://click.palletsprojects.com), 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](https://kdeldycke.github.io/click-extra/issues.html) that have not
reached upstream yet (or are unlikely to).

## Example

It transforms this vanilla `click` CLI:

![click CLI help screen](https://raw.githubusercontent.com/kdeldycke/click-extra/main/docs/assets/click-help-screen.png)

Into this:

![click-extra CLI help screen](https://raw.githubusercontent.com/kdeldycke/click-extra/main/docs/assets/click-extra-screen.png)

To undestrand how we ended up with the result above, [go read the tutorial](https://kdeldycke.github.io/click-extra/tutorial.html).

## Features

- [Configuration file](https://kdeldycke.github.io/click-extra/config.html) 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](https://kdeldycke.github.io/click-extra/config.html#remote-url)
- Optional [strict validation](https://kdeldycke.github.io/click-extra/config.html#strictness) of configuration
- Respect the [default application path](https://kdeldycke.github.io/click-extra/config.html#default-folder) on each platform (XDG spec on Linux)
- [Glob search patterns](https://kdeldycke.github.io/click-extra/config.html#pattern-matching) for configuration files
- Respect of `CLI` > `Configuration` > `Environment` > `Defaults` [precedence](https://kdeldycke.github.io/click-extra/config.html#precedence)
- Normalization and discoverability of environment variables
- [`--show-params` option](https://kdeldycke.github.io/click-extra/parameters.html#show-params-option) to debug parameters defaults, values, environment variables and provenance
- [Click parameters introspection](https://kdeldycke.github.io/click-extra/parameters.html#introspecting-parameters)
- [Colorization of help screens](https://kdeldycke.github.io/click-extra/colorize.html) 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](https://blog.craftyguy.net/cmdline-help/))
- `--color`/`--no-color` option flag
- `--telemetry`/`--no-telemetry` flag to opt-in/out of tracking code
- Recognize traditional environment variable conventions:
  - `NO_COLOR` from [`no-color.org`](https://no-color.org)
  - `DO_NOT_TRACK` from [`consoledonottrack.com`](https://consoledonottrack.com)
- Colored `--version` option
- [Colored `--verbosity` option and logs](https://kdeldycke.github.io/click-extra/logging.html)
- `--time`/`--no-time` flag to measure duration of command execution
- Global `show_choices` to activate selection of choices on user input prompts
- [Platform recognition](https://kdeldycke.github.io/click-extra/platforms.html) 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`
- [`.. click:example::` and `.. click:run::` Sphinx directives](https://kdeldycke.github.io/click-extra/sphinx.html) to document CLI source code and their execution
- [Inline testing of CLI examples](https://kdeldycke.github.io/click-extra/sphinx.html#inline-tests) in documentation
- [ANSI-capable Pygments lexers](https://kdeldycke.github.io/click-extra/pygments.html#lexers) for shell session and console output
- [Fixes 40+ bugs](https://kdeldycke.github.io/click-extra/issues.html) from other Click-related projects
- Rely on [Cloup](https://github.com/janluke/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:

- ![GitHub stars](https://img.shields.io/github/stars/kdeldycke/meta-package-manager?label=%E2%AD%90&style=flat-square) [Meta Package Manager](https://github.com/kdeldycke/meta-package-manager#readme)
  \- A unifying CLI for multiple package managers.
- ![GitHub stars](https://img.shields.io/github/stars/kdeldycke/mail-deduplicate?label=%E2%AD%90&style=flat-square) [Mail Deduplicate](https://github.com/kdeldycke/mail-deduplicate#readme) - A
  CLI to deduplicate similar emails.
- ![GitHub stars](https://img.shields.io/github/stars/Sprocket-Security/fireproxng?label=%E2%AD%90&style=flat-square) [fireproxng](https://github.com/Sprocket-Security/fireproxng#readme) - A rewrite of the fireprox tool.
- ![GitHub stars](https://img.shields.io/github/stars/hugolundin/badger?label=%E2%AD%90&style=flat-square) [badger-proxy](https://github.com/hugolundin/badger#readme) - An mDNS-based reverse
  proxy for naming services on a local network.

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](https://kdeldycke.github.io/meta-package-manager/development.html)
are the same as
[parent project `mpm`](https://github.com/kdeldycke/meta-package-manager), from
which `click-extra` originated.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/kdeldycke/click-extra",
    "name": "click-extra",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": "ansi-colors, cli, cloup, colorization, configuration, console, ini, json, logging, multiplatform, pygments, pytest, python, python-tabulate, sphinx, terminal, toml, xml, yaml",
    "author": "Kevin Deldycke",
    "author_email": "kevin@deldycke.com",
    "download_url": "https://files.pythonhosted.org/packages/5f/1c/f4994753da10be8f785b093da4bc86942930e86a78d3216aa2cce6371f69/click_extra-4.7.5.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n  <a href=\"https://github.com/kdeldycke/click-extra/\">\n    <img src=\"https://raw.githubusercontent.com/kdeldycke/click-extra/main/docs/assets/logo-banner.svg\" alt=\"Click Extra\">\n  </a>\n</p>\n\n[![Last release](https://img.shields.io/pypi/v/click-extra.svg)](https://pypi.python.org/pypi/click-extra)\n[![Python versions](https://img.shields.io/pypi/pyversions/click-extra.svg)](https://pypi.python.org/pypi/click-extra)\n[![Downloads](https://static.pepy.tech/badge/click_extra/month)](https://pepy.tech/project/click_extra)\n[![Unittests status](https://github.com/kdeldycke/click-extra/actions/workflows/tests.yaml/badge.svg?branch=main)](https://github.com/kdeldycke/click-extra/actions/workflows/tests.yaml?query=branch%3Amain)\n[![Coverage status](https://codecov.io/gh/kdeldycke/click-extra/branch/main/graph/badge.svg)](https://app.codecov.io/gh/kdeldycke/click-extra)\n[![Documentation status](https://github.com/kdeldycke/click-extra/actions/workflows/docs.yaml/badge.svg?branch=main)](https://github.com/kdeldycke/click-extra/actions/workflows/docs.yaml?query=branch%3Amain)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7116050.svg)](https://doi.org/10.5281/zenodo.7116050)\n\n## What is Click Extra?\n\nA ready-to-use wrapper for [Click](https://click.palletsprojects.com), the Python CLI framework.\n\nIt is a drop-in replacement with good defaults that saves lots of boilerplate code and frustration.\nIt also comes with\n[workarounds and patches](https://kdeldycke.github.io/click-extra/issues.html) that have not\nreached upstream yet (or are unlikely to).\n\n## Example\n\nIt transforms this vanilla `click` CLI:\n\n![click CLI help screen](https://raw.githubusercontent.com/kdeldycke/click-extra/main/docs/assets/click-help-screen.png)\n\nInto this:\n\n![click-extra CLI help screen](https://raw.githubusercontent.com/kdeldycke/click-extra/main/docs/assets/click-extra-screen.png)\n\nTo undestrand how we ended up with the result above, [go read the tutorial](https://kdeldycke.github.io/click-extra/tutorial.html).\n\n## Features\n\n- [Configuration file](https://kdeldycke.github.io/click-extra/config.html) loader for:\n  - `TOML`\n  - `YAML`\n  - `JSON`, with inline and block comments (Python-style `#` and Javascript-style `//`)\n  - `INI`, with extended interpolation, multi-level sections and non-native types (`list`, `set`, \u2026)\n  - `XML`\n- Automatic inference of the configuration file structure from your CLI's options\n- Remote loading of [configuration files from URLs](https://kdeldycke.github.io/click-extra/config.html#remote-url)\n- Optional [strict validation](https://kdeldycke.github.io/click-extra/config.html#strictness) of configuration\n- Respect the [default application path](https://kdeldycke.github.io/click-extra/config.html#default-folder) on each platform (XDG spec on Linux)\n- [Glob search patterns](https://kdeldycke.github.io/click-extra/config.html#pattern-matching) for configuration files\n- Respect of `CLI` > `Configuration` > `Environment` > `Defaults` [precedence](https://kdeldycke.github.io/click-extra/config.html#precedence)\n- Normalization and discoverability of environment variables\n- [`--show-params` option](https://kdeldycke.github.io/click-extra/parameters.html#show-params-option) to debug parameters defaults, values, environment variables and provenance\n- [Click parameters introspection](https://kdeldycke.github.io/click-extra/parameters.html#introspecting-parameters)\n- [Colorization of help screens](https://kdeldycke.github.io/click-extra/colorize.html) at the semantic-level of options, parameters, subheadings, choices, metavars and defaults\n- Global `show_envvar` option to display all environment variables in help screens\n- `-h`/`--help` option names (see [rant on other inconsistencies](https://blog.craftyguy.net/cmdline-help/))\n- `--color`/`--no-color` option flag\n- `--telemetry`/`--no-telemetry` flag to opt-in/out of tracking code\n- Recognize traditional environment variable conventions:\n  - `NO_COLOR` from [`no-color.org`](https://no-color.org)\n  - `DO_NOT_TRACK` from [`consoledonottrack.com`](https://consoledonottrack.com)\n- Colored `--version` option\n- [Colored `--verbosity` option and logs](https://kdeldycke.github.io/click-extra/logging.html)\n- `--time`/`--no-time` flag to measure duration of command execution\n- Global `show_choices` to activate selection of choices on user input prompts\n- [Platform recognition](https://kdeldycke.github.io/click-extra/platforms.html) utilities (macOS, Linux, Windows, UNIX, \\*BSD, \u2026)\n- New conditional markers for `pytest`:\n  - `@skip_linux`, `@skip_macos` and `@skip_windows`\n  - `@unless_linux`, `@unless_macos` and `@unless_windows`\n- [`.. click:example::` and `.. click:run::` Sphinx directives](https://kdeldycke.github.io/click-extra/sphinx.html) to document CLI source code and their execution\n- [Inline testing of CLI examples](https://kdeldycke.github.io/click-extra/sphinx.html#inline-tests) in documentation\n- [ANSI-capable Pygments lexers](https://kdeldycke.github.io/click-extra/pygments.html#lexers) for shell session and console output\n- [Fixes 40+ bugs](https://kdeldycke.github.io/click-extra/issues.html) from other Click-related projects\n- Rely on [Cloup](https://github.com/janluke/cloup) to add:\n  - option groups\n  - constraints\n  - subcommands sections\n  - aliases\n  - command suggestion (`Did you mean <subcommand>?`)\n\n## Used in\n\nCheck these projects to get real-life examples of `click-extra` usage:\n\n- ![GitHub stars](https://img.shields.io/github/stars/kdeldycke/meta-package-manager?label=%E2%AD%90&style=flat-square) [Meta Package Manager](https://github.com/kdeldycke/meta-package-manager#readme)\n  \\- A unifying CLI for multiple package managers.\n- ![GitHub stars](https://img.shields.io/github/stars/kdeldycke/mail-deduplicate?label=%E2%AD%90&style=flat-square) [Mail Deduplicate](https://github.com/kdeldycke/mail-deduplicate#readme) - A\n  CLI to deduplicate similar emails.\n- ![GitHub stars](https://img.shields.io/github/stars/Sprocket-Security/fireproxng?label=%E2%AD%90&style=flat-square) [fireproxng](https://github.com/Sprocket-Security/fireproxng#readme) - A rewrite of the fireprox tool.\n- ![GitHub stars](https://img.shields.io/github/stars/hugolundin/badger?label=%E2%AD%90&style=flat-square) [badger-proxy](https://github.com/hugolundin/badger#readme) - An mDNS-based reverse\n  proxy for naming services on a local network.\n\nFeel free to send a PR to add your project in this list if you are relying on Click Extra in any way.\n\n## Development\n\n[Development guidelines](https://kdeldycke.github.io/meta-package-manager/development.html)\nare the same as\n[parent project `mpm`](https://github.com/kdeldycke/meta-package-manager), from\nwhich `click-extra` originated.\n\n",
    "bugtrack_url": null,
    "license": "GPL-2.0-or-later",
    "summary": "\ud83c\udf08 Extra colorization and configuration loading for Click.",
    "version": "4.7.5",
    "project_urls": {
        "Changelog": "https://kdeldycke.github.io/click-extra/changelog.html",
        "Documentation": "https://kdeldycke.github.io/click-extra",
        "Funding": "https://github.com/sponsors/kdeldycke",
        "Homepage": "https://github.com/kdeldycke/click-extra",
        "Issues": "https://github.com/kdeldycke/click-extra/issues",
        "Repository": "https://github.com/kdeldycke/click-extra"
    },
    "split_keywords": [
        "ansi-colors",
        " cli",
        " cloup",
        " colorization",
        " configuration",
        " console",
        " ini",
        " json",
        " logging",
        " multiplatform",
        " pygments",
        " pytest",
        " python",
        " python-tabulate",
        " sphinx",
        " terminal",
        " toml",
        " xml",
        " yaml"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "709d5336f58b11006a4fcf471626be767dca686f56753d373bbfe5680f6779f1",
                "md5": "458649662fb656ce6f6804838c18a8af",
                "sha256": "a1edd9fb2d62ff4e24528aa43f2494c4553f2fe20a8b669aa9f981f946ce240e"
            },
            "downloads": -1,
            "filename": "click_extra-4.7.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "458649662fb656ce6f6804838c18a8af",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 115412,
            "upload_time": "2024-04-05T10:54:34",
            "upload_time_iso_8601": "2024-04-05T10:54:34.767011Z",
            "url": "https://files.pythonhosted.org/packages/70/9d/5336f58b11006a4fcf471626be767dca686f56753d373bbfe5680f6779f1/click_extra-4.7.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5f1cf4994753da10be8f785b093da4bc86942930e86a78d3216aa2cce6371f69",
                "md5": "6830714afde1e39907b4500b80bad6bd",
                "sha256": "f34f8acc6b942eb162154633538a9b7f17b713aeb4778d55bfbf85006740de54"
            },
            "downloads": -1,
            "filename": "click_extra-4.7.5.tar.gz",
            "has_sig": false,
            "md5_digest": "6830714afde1e39907b4500b80bad6bd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 90233,
            "upload_time": "2024-04-05T10:54:37",
            "upload_time_iso_8601": "2024-04-05T10:54:37.230721Z",
            "url": "https://files.pythonhosted.org/packages/5f/1c/f4994753da10be8f785b093da4bc86942930e86a78d3216aa2cce6371f69/click_extra-4.7.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-05 10:54:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kdeldycke",
    "github_project": "click-extra",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "click-extra"
}
        
Elapsed time: 0.29132s