click-extra


Nameclick-extra JSON
Version 4.11.4 PyPI version JSON
download
home_pageNone
Summary🌈 Drop-in replacement for Click to make user-friendly and colorful CLI
upload_time2024-11-14 18:10:23
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
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?

It should be easy to write a good CLI in Python. [Click](https://click.palletsprojects.com) makes it so. But there is still hundrends of tweaks to implement by yourself to have a user-friendly CLI.

Click Extra is a **ready-to-use wrapper around Click** to make your CLI look good and behave well. It is a drop-in replacement with good defaults that saves lots of boilerplate code and frustration by making all parts working together.

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
- [`.. 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": null,
    "name": "click-extra",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "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": null,
    "author_email": "Kevin Deldycke <kevin@deldycke.com>",
    "download_url": "https://files.pythonhosted.org/packages/84/d1/f8a0a91b15c972cee922a23389e6c2c0411be4b363289a94c0850fc2be36/click_extra-4.11.4.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\nIt should be easy to write a good CLI in Python. [Click](https://click.palletsprojects.com) makes it so. But there is still hundrends of tweaks to implement by yourself to have a user-friendly CLI.\n\nClick Extra is a **ready-to-use wrapper around Click** to make your CLI look good and behave well. It is a drop-in replacement with good defaults that saves lots of boilerplate code and frustration by making all parts working together.\n\nIt also comes with [workarounds and patches](https://kdeldycke.github.io/click-extra/issues.html) that have not reached 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- [`.. 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",
    "bugtrack_url": null,
    "license": null,
    "summary": "\ud83c\udf08 Drop-in replacement for Click to make user-friendly and colorful CLI",
    "version": "4.11.4",
    "project_urls": {
        "Changelog": "https://github.com/kdeldycke/click-extra/blob/main/changelog.md",
        "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": null,
            "digests": {
                "blake2b_256": "f29f76d77873c9ca58c73bfa2810996d11eda3bbf8c45a5eeb7637bb5c3f3214",
                "md5": "983037d695deb0f989793d2c0672da86",
                "sha256": "f24af73f3926d871a93ac5d4b424ba73327bccd865d02a15495bacecb3ca2da0"
            },
            "downloads": -1,
            "filename": "click_extra-4.11.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "983037d695deb0f989793d2c0672da86",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 70662,
            "upload_time": "2024-11-14T18:10:22",
            "upload_time_iso_8601": "2024-11-14T18:10:22.000201Z",
            "url": "https://files.pythonhosted.org/packages/f2/9f/76d77873c9ca58c73bfa2810996d11eda3bbf8c45a5eeb7637bb5c3f3214/click_extra-4.11.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "84d1f8a0a91b15c972cee922a23389e6c2c0411be4b363289a94c0850fc2be36",
                "md5": "b5d81ffd62d5cea4216d72806111ea4d",
                "sha256": "ffebd1f1ef096d296d61193ff96d03aac85b55952608cdaa934e4d5bfc963dd9"
            },
            "downloads": -1,
            "filename": "click_extra-4.11.4.tar.gz",
            "has_sig": false,
            "md5_digest": "b5d81ffd62d5cea4216d72806111ea4d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 87246,
            "upload_time": "2024-11-14T18:10:23",
            "upload_time_iso_8601": "2024-11-14T18:10:23.862643Z",
            "url": "https://files.pythonhosted.org/packages/84/d1/f8a0a91b15c972cee922a23389e6c2c0411be4b363289a94c0850fc2be36/click_extra-4.11.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-14 18:10:23",
    "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.71903s