Skip to main content

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

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
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

argparse-color-formatter-1.0.0.tar.gz (5.1 kB view details)

Uploaded Source

File details

Details for the file argparse-color-formatter-1.0.0.tar.gz.

File metadata

File hashes

Hashes for argparse-color-formatter-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5fd334a55024edc3ce33e5b2927402766ded0f8a1b7817e0f18045ad8b9dd85f
MD5 bf699f7c8edacd7f6af99e6f4ba37e70
BLAKE2b-256 51375b9c6233ea93d5156acbc32b172e5162d458f050ed93cd88dea585a8cc57

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page