A Python module for implementing command-line interfaces
argparse
is a python module for implementing command-line interfaces.
From the module documentation:
The
argparse
module makes it easy to write user-friendly command-line interfaces. The program defines what arguments it requires, andargparse
will figure out how to parse those out ofsys.argv
. Theargparse
module 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.