Building a Command-Line Interface (CLI) with argparse

0% of 4 hours and 54 minutes completed.

A common scenario: you deliver software that runs with a variety of options. What, then, is the best way of letting users invoke the various options? A command line interface (CLI)!

CLIs have been used to run programs since the early 1960s and are still relevant today. Their simplistic design, small footprint, and self-documentation make them ideal for automated or scheduled tasks.

In this course, you will learn how to build a CLI using argparse, a module in the Python Standard Library. The course will also explore alternative, third-party packages for building a CLI: docopt and click.

After completing this course, you will be able to:

  • Build a command line interface (CLI) using Python's argparse module
  • Accept both required and optional arguments
  • Assign a type to an argument
  • Write a custom type
  • Write a custom action
  • Handle mutually exclusive options
  • Build a CLI with docopt
  • Build a CLI with click
There are no resources available.
0 attachments
0%
Build a CLI
1 hour 26 minutes 8 Activities: Article  (2)  |  Lab  (3)  |  Video  (3)
0%
Build an advanced CLI
1 hour 51 minutes 11 Activities: Article  (5)  |  Lab  (5)  |  Video  (1)
0%
Use alternative tools
1 hour 30 minutes 9 Activities: Article  (2)  |  Lab  (3)  |  Video  (4)
0%
Copyright
1 minute 1 Activity: Article  (1)  |  Lab  (0)  |  Video  (0)
0%
Survey
5 minutes 1 Activity: Article  (1)  |  Lab  (0)  |  Video  (0)