Member-only story
Designing Beautiful Command-Line Applications With Python
Five libraries that make your console beautiful

A lot of people still write their command-line applications with Argparse or even Optparse plus input()
. Creating outputs is often done directly with print
and formatting strings — which gets really hairy when you want to print tables or have some color/emphasis.
There are four libraries that allow you to do WAY better. I can promise the last two will surprise you — let’s get started!
№1 and 2: Use click or Typer for CLIs

click is a library in the Flask ecosystem for creating non-interactive command-line interfaces. It parses command-line arguments/options but uses decorators in a very clever way to do so. Especially the options for creating subcommands are top-notch