A Python module for implementing command-line interfaces
argparse is a python module for implementing command-line interfaces.
From the module documentation:
The
argparsemodule makes it easy to write user-friendly command-line interfaces. The program defines what arguments it requires, andargparsewill figure out how to parse those out ofsys.argv. Theargparsemodule also automatically generates help and usage messages and issues errors when users give the program invalid arguments.
argparse was added to the stdlib in 2.7/3.2, deprecating optparse.