=================
click-help-colors
=================
|pypi| |downloads|
Colorization of help messages in Click_.
Usage
-----
.. code:: python
import click
from click_help_colors import HelpColorsGroup, HelpColorsCommand
@click.group(
cls=HelpColorsGroup,
help_headers_color='yellow',
help_options_color='green'
)
def cli():
pass
@cli.command()
@click.option('--count', default=1, help='Some number.')
def command1(count):
click.echo('command 1')
@cli.command(
cls=HelpColorsCommand,
help_options_color='blue'
)
@click.option('--name', help='Some string.')
def command2(name):
click.echo('command 2')
.. code-block:: console
$ python example.py --help
.. image:: https://raw.githubusercontent.com/click-contrib/click-help-colors/master/examples/screenshots/1.png
.. code-block:: console
$ python example.py command1 --help
.. image:: https://raw.githubusercontent.com/click-contrib/click-help-colors/master/examples/screenshots/2.png
.. code-block:: console
$ python example.py command2 --help
.. image:: https://raw.githubusercontent.com/click-contrib/click-help-colors/master/examples/screenshots/3.png
.. code:: python
import click
from click_help_colors import HelpColorsGroup, HelpColorsCommand
@click.group(
cls=HelpColorsGroup,
help_headers_color='yellow',
help_options_color='green',
help_options_custom_colors={'command3': 'red', 'command4': 'cyan'}
)
def cli():
pass
@cli.command(
cls=HelpColorsCommand,
help_headers_color=None,
help_options_color=None,
help_options_custom_colors={'--count': 'red', '--subtract': 'green'}
)
@click.option('--count', default=1, help='Count help text.')
@click.option('--add', default=1, help='Add help text.')
@click.option('--subtract', default=1, help='Subtract help text.')
def command1(count, add, subtract):
"""A command"""
click.echo('command 1')
...
.. code-block:: console
$ python example_with_custom_colors.py --help
.. image:: https://raw.githubusercontent.com/click-contrib/click-help-colors/master/examples/screenshots/4.png
.. code-block:: console
$ python example_with_custom_colors.py command1 --help
.. image:: https://raw.githubusercontent.com/click-contrib/click-help-colors/master/examples/screenshots/5.png
.. code:: python
from click_help_colors import version_option
@click.group()
def cli():
pass
@cli.command()
@version_option(
version='1.0',
prog_name='example',
message_color='green'
)
def cmd1():
pass
@cli.command()
@version_option(
version='1.0',
prog_name='example',
version_color='green',
prog_name_color='yellow'
)
def cmd2():
pass
@cli.command()
@version_option(
version='1.0',
prog_name='example',
version_color='green',
prog_name_color='white',
message='%(prog)s %(version)s\n python=3.7',
message_color='bright_black'
)
def cmd3():
pass
.. image:: https://raw.githubusercontent.com/click-contrib/click-help-colors/master/examples/screenshots/6.png
Installation
------------
With ``pip``:
.. code-block:: console
$ pip install click-help-colors
From source:
.. code-block:: console
$ git clone https://github.com/click-contrib/click-help-colors.git
$ cd click-help-colors
$ python setup.py install
.. _Click: http://click.pocoo.org/
.. |pypi| image:: https://img.shields.io/pypi/v/click-help-colors
:alt: PyPI
.. |downloads| image:: https://img.shields.io/pypi/dm/click-help-colors
:alt: PyPI - Downloads
Raw data
{
"_id": null,
"home_page": "https://github.com/click-contrib/click-help-colors",
"name": "click-help-colors",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "click",
"author": "",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/6f/50/76f51d9c7fcd72a12da466801f7c1fa3884424c947787333c74327b4fcf3/click-help-colors-0.9.4.tar.gz",
"platform": null,
"description": "=================\nclick-help-colors\n=================\n\n|pypi| |downloads|\n\nColorization of help messages in Click_.\n\nUsage\n-----\n\n.. code:: python\n\n import click\n from click_help_colors import HelpColorsGroup, HelpColorsCommand\n\n @click.group(\n cls=HelpColorsGroup,\n help_headers_color='yellow',\n help_options_color='green'\n )\n def cli():\n pass\n\n @cli.command()\n @click.option('--count', default=1, help='Some number.')\n def command1(count):\n click.echo('command 1')\n\n @cli.command(\n cls=HelpColorsCommand,\n help_options_color='blue'\n )\n @click.option('--name', help='Some string.')\n def command2(name):\n click.echo('command 2')\n\n.. code-block:: console\n\n $ python example.py --help\n\n.. image:: https://raw.githubusercontent.com/click-contrib/click-help-colors/master/examples/screenshots/1.png\n\n.. code-block:: console\n\n $ python example.py command1 --help\n\n.. image:: https://raw.githubusercontent.com/click-contrib/click-help-colors/master/examples/screenshots/2.png\n\n.. code-block:: console\n\n $ python example.py command2 --help\n\n.. image:: https://raw.githubusercontent.com/click-contrib/click-help-colors/master/examples/screenshots/3.png\n\n.. code:: python\n\n import click\n from click_help_colors import HelpColorsGroup, HelpColorsCommand\n\n @click.group(\n cls=HelpColorsGroup,\n help_headers_color='yellow',\n help_options_color='green',\n help_options_custom_colors={'command3': 'red', 'command4': 'cyan'}\n )\n def cli():\n pass\n\n\n @cli.command(\n cls=HelpColorsCommand,\n help_headers_color=None,\n help_options_color=None,\n help_options_custom_colors={'--count': 'red', '--subtract': 'green'}\n )\n @click.option('--count', default=1, help='Count help text.')\n @click.option('--add', default=1, help='Add help text.')\n @click.option('--subtract', default=1, help='Subtract help text.')\n def command1(count, add, subtract):\n \"\"\"A command\"\"\"\n click.echo('command 1')\n\n ...\n\n.. code-block:: console\n\n $ python example_with_custom_colors.py --help\n\n.. image:: https://raw.githubusercontent.com/click-contrib/click-help-colors/master/examples/screenshots/4.png\n\n.. code-block:: console\n\n $ python example_with_custom_colors.py command1 --help\n\n.. image:: https://raw.githubusercontent.com/click-contrib/click-help-colors/master/examples/screenshots/5.png\n\n.. code:: python\n\n from click_help_colors import version_option\n\n @click.group()\n def cli():\n pass\n\n @cli.command()\n @version_option(\n version='1.0',\n prog_name='example',\n message_color='green'\n )\n def cmd1():\n pass\n\n @cli.command()\n @version_option(\n version='1.0',\n prog_name='example',\n version_color='green',\n prog_name_color='yellow'\n )\n def cmd2():\n pass\n\n @cli.command()\n @version_option(\n version='1.0',\n prog_name='example',\n version_color='green',\n prog_name_color='white',\n message='%(prog)s %(version)s\\n python=3.7',\n message_color='bright_black'\n )\n def cmd3():\n pass\n\n.. image:: https://raw.githubusercontent.com/click-contrib/click-help-colors/master/examples/screenshots/6.png\n\nInstallation\n------------\n\nWith ``pip``:\n\n.. code-block:: console\n\n $ pip install click-help-colors\n\nFrom source:\n\n.. code-block:: console\n\n $ git clone https://github.com/click-contrib/click-help-colors.git\n $ cd click-help-colors\n $ python setup.py install\n\n.. _Click: http://click.pocoo.org/\n\n\n.. |pypi| image:: https://img.shields.io/pypi/v/click-help-colors\n :alt: PyPI\n\n.. |downloads| image:: https://img.shields.io/pypi/dm/click-help-colors\n :alt: PyPI - Downloads\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Colorization of help messages in Click",
"version": "0.9.4",
"project_urls": {
"Homepage": "https://github.com/click-contrib/click-help-colors"
},
"split_keywords": [
"click"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "99f88768f803151714640cb6f06fd9de490ce7db632d351da05f42f77330d2fd",
"md5": "1a10ef7b5c51e069f4734a2249648011",
"sha256": "b33c5803eeaeb084393b1ab5899dc5476c7196b87a18713045afe76f840b42db"
},
"downloads": -1,
"filename": "click_help_colors-0.9.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1a10ef7b5c51e069f4734a2249648011",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6437,
"upload_time": "2023-11-18T11:55:09",
"upload_time_iso_8601": "2023-11-18T11:55:09.775714Z",
"url": "https://files.pythonhosted.org/packages/99/f8/8768f803151714640cb6f06fd9de490ce7db632d351da05f42f77330d2fd/click_help_colors-0.9.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6f5076f51d9c7fcd72a12da466801f7c1fa3884424c947787333c74327b4fcf3",
"md5": "bb1fb93a8871cf2800de794e2e34fc06",
"sha256": "f4cabe52cf550299b8888f4f2ee4c5f359ac27e33bcfe4d61db47785a5cc936c"
},
"downloads": -1,
"filename": "click-help-colors-0.9.4.tar.gz",
"has_sig": false,
"md5_digest": "bb1fb93a8871cf2800de794e2e34fc06",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8048,
"upload_time": "2023-11-18T11:55:15",
"upload_time_iso_8601": "2023-11-18T11:55:15.554559Z",
"url": "https://files.pythonhosted.org/packages/6f/50/76f51d9c7fcd72a12da466801f7c1fa3884424c947787333c74327b4fcf3/click-help-colors-0.9.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-18 11:55:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "click-contrib",
"github_project": "click-help-colors",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "click-help-colors"
}