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
argparse-color-formatter
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.
master
develop
Install
$ pip install argparse-color-formatter
Usage
Pass in argparse_color_formatter.ColorHelpFormatter
to a new argument parser as formatter_class
import argparse
from argparse_color_formatter import ColorHelpFormatter
parser = argparse.ArgumentParser(
formatter_class=ColorHelpFormatter
)
Before & After
ANSI colour escapes using the default HelpFormatter
:
ANSI colour escapes using this libraries new 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
Built Distribution
Hashes for argparse-color-formatter-1.2.2.post2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 781791135ad00e5682b970933130786da2b3e0a6dd1c1134e298f3e956479505 |
|
MD5 | 98fe5b9953bd4fe250caf2c68dccde45 |
|
BLAKE2b-256 | 20e21e76aa668aceca22eaf60112ba544225a36d92bb6494636daf528072b5c4 |
Hashes for argparse_color_formatter-1.2.2.post2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9861f2aac9ee8c6154d8486c3d6e9c500ebaea6dd89fdca0dbb2612a6ba184b3 |
|
MD5 | 4d4bbe0f4b822f6238e3b6d6a8a186e9 |
|
BLAKE2b-256 | 52811af84e045408a6bb45814e2475c7ee90528c67e650960f872d04ce9ca6ad |