{"library":"rich-argparse","title":"Rich Argparse","description":"rich-argparse provides beautiful, Rich-powered help formatters for Python's argparse and optparse modules. It enhances the standard help output with syntax highlighting, improved layout, and the ability to include Rich renderables like Markdown and tables in descriptions and epilogs. The current version is 1.7.2, and it maintains an active release cadence with regular updates.","status":"active","version":"1.7.2","language":"en","source_language":"en","source_url":"https://github.com/hamdanal/rich-argparse","tags":["argparse","rich","cli","help","formatting","documentation"],"install":[{"cmd":"pip install rich-argparse","lang":"bash","label":"Install rich-argparse"}],"dependencies":[{"reason":"Provides the core rendering capabilities for the enhanced help output.","package":"rich"}],"imports":[{"symbol":"RichHelpFormatter","correct":"from rich_argparse import RichHelpFormatter"}],"quickstart":{"code":"import argparse\nfrom rich_argparse import RichHelpFormatter\n\nparser = argparse.ArgumentParser(\n    description='A command-line tool with \\n[bold blue]rich[/bold blue] help formatting.',\n    formatter_class=RichHelpFormatter\n)\n\nparser.add_argument('--name', '-n', help='Your name.')\nparser.add_argument('--age', '-a', type=int, help='Your age.')\nparser.add_argument(\n    '--verbose', '-v', action='store_true', \n    help='[dim]Enable verbose output.[/dim]'\n)\n\n# To display the rich help, you would typically run your script with --help\n# or allow argparse to display it on invalid input.\n# For demonstration, we can try parsing arguments that trigger help:\n# try:\n#     parser.parse_args(['--help'])\n# except SystemExit: # argparse raises SystemExit on --help\n#     pass\n\n# To simply see the formatted output in a script context:\n# This will print the help to the console\nparser.print_help()\n","lang":"python","description":"This quickstart demonstrates how to apply `RichHelpFormatter` to an `argparse.ArgumentParser` instance. It showcases rich markup directly within the description and help messages, which `RichHelpFormatter` will render beautifully in the terminal when `parser.print_help()` is called or `--help` is invoked."},"warnings":[{"fix":"After upgrading to 2.0.0, consult the documentation for how to explicitly enable Rich markup parsing if your help strings contain Rich syntax.","message":"In version 2.0, Rich markup will become opt-in instead of opt-out. Existing code relying on automatic markup parsing in descriptions and help messages will need to explicitly enable it.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Upgrade your Python environment to 3.9 or newer before upgrading to rich-argparse 2.0.","message":"Python 3.8 support will be dropped in version 2.0. The last release to officially support Python 3.8 is 1.7.0. Future versions will require Python 3.9 or newer.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Upgrade to rich-argparse version 1.7.1 or newer to resolve `TypeError` issues on Python 3.14+.","message":"On Python 3.14.0a7+ (nightly builds), versions of rich-argparse prior to 1.7.1 could raise a `TypeError` due to changes in `HelpFormatter` arguments, specifically the `console` parameter becoming keyword-only.","severity":"gotcha","affected_versions":"<1.7.1"},{"fix":"Ensure you are using rich-argparse version 1.5.2 or later to correctly handle `%(default)s` style without crashes.","message":"A regression in versions 1.5.1 and earlier could cause the formatter to crash when handling `%(default)s` style strings, especially if they appeared after markup text.","severity":"gotcha","affected_versions":"<1.5.2"}],"env_vars":null,"last_verified":"2026-04-06T00:00:00.000Z","next_check":"2026-07-05T00:00:00.000Z"}