Building a CLI with argparse

CLI    |    Beginner
  • 9 videos | 39m 8s
  • Includes Assessment
  • Earns a Badge
Rating 4.8 of 24 users Rating 4.8 of 24 users (24)
It's common to need to deliver software that runs with a variety of options and a command line interface is a great way to let users invoke these various options. 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'll review the history of CLIs and learn how to build a CLI using argparse, a module in the Python Standard Library. You'll examine positional and optional arguments, as well as how to use custom actions. Finally, you'll learn how to install a Python module as an editable package and explore the alternative, third-party packages for building a CLI - docopt and click. This course was originally created by Global Knowledge (GK).

WHAT YOU WILL LEARN

  • Recognize command line interface (cli) concepts that will be covered in the course
    Recognize the history and uses of a command line interface
    Recognize the argumentparser class and its add_argument() method, as well as how to add positional arguments, set help text, and designate a type for each argument
    Recognize how to add optional arguments, set the dest (destination), designate metavar to change help text that's generated, and assign long and abbreviated argument names
    Recognize why you would use a custom action and how to construct one
  • Recognize tools that are alternatives to argparse for building a cli
    Recognize how to use pip to install your python module as an editable package
    Recognize how to write a cli using the open-source tool docopt
    Recognize how to write a cli by using the open-source tool click

IN THIS COURSE

EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE

Skillsoft is providing you the opportunity to earn a digital badge upon successful completion on some of our courses, which can be shared on any social network or business platform.

Digital badges are yours to keep, forever.

YOU MIGHT ALSO LIKE

Rating 4.6 of 285 users Rating 4.6 of 285 users (285)
Rating 3.0 of 1 users Rating 3.0 of 1 users (1)
Rating 5.0 of 2 users Rating 5.0 of 2 users (2)

PEOPLE WHO VIEWED THIS ALSO VIEWED THESE

Rating 4.6 of 64 users Rating 4.6 of 64 users (64)
Rating 4.7 of 74 users Rating 4.7 of 74 users (74)
Rating 4.6 of 640 users Rating 4.6 of 640 users (640)