a ``formatter_class`` for ``argparse`` that deals with ANSI colour escapes. Specifically, this formatter does not count escape characters as displayed characters when wrapping ``argparse``'s help text into the terminal.
Project description
.. list-table::
:header-rows: 1
* - Branch
- Build Status
- Coverage Status
* - master
-
.. image:: https://semaphoreci.com/api/v1/emergence/argparse-color-formatter/branches/master/shields_badge.svg
:target: https://semaphoreci.com/emergence/argparse-color-formatter
:alt: Build Status
-
.. image:: https://docs.emergence.com/argparse-color-formatter/htmlcov_master/coverage.svg
:target: https://docs.emergence.com/argparse-color-formatter/htmlcov_master/
:alt: Coverage Status
* - develop
-
.. image:: https://semaphoreci.com/api/v1/emergence/argparse-color-formatter/branches/develop/shields_badge.svg
:target: https://semaphoreci.com/emergence/argparse-color-formatter
:alt: Build Status
-
.. image:: https://docs.emergence.com/argparse-color-formatter/htmlcov_develop/coverage.svg
:target: https://docs.emergence.com/argparse-color-formatter/htmlcov_develop/
:alt: Coverage Status
Install
-------
.. code-block:: shell
$ pip install argparse-color-formatter
Usage
-----
Pass in ``argparse_color_formatter.ColorHelpFormatter`` to a new argument parser as ``formatter_class``
.. code-block:: python
import argparse
from argparse_color_formatter import ColorHelpFormatter
parser = argparse.ArgumentParser(
formatter_class=ColorHelpFormatter
)
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
Close
Hashes for argparse-color-formatter-1.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 699b26927a71e55b57cbb8786ad07929bb6f0cc568e582537e7c92679ae7672d |
|
MD5 | ea90120cb3934bf6b5eb4172757f9e29 |
|
BLAKE2b-256 | ebda2e12f2efec3a2e3601fda6f6a561431a18c18c6cea86e384f41cabd3a1c4 |