Building a CLI with argparse

CLI    |    Beginner
  • 9 Videos | 39m 8s
  • Includes Assessment
  • Earns a Badge
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

  • Playable
    1. 
    Introduction to CLIs
    1m
    UP NEXT
  • Playable
    2. 
    Why Build a CLI?
    1m 20s
  • Locked
    3. 
    Adding Positional Arguments
    5m 18s
  • Locked
    4. 
    Adding Optional Arguments
    7m 34s
  • Locked
    5. 
    Assigning Custom Actions
    7m 39s
  • Locked
    6. 
    Why Use Alternative Tools?
    1m 9s
  • Locked
    7. 
    Installing Python Module as an Editable Package
    4m 16s
  • Locked
    8. 
    Using docopt to Create a CLI
    6m 12s
  • Locked
    9. 
    Using click to Create a CLI
    4m 42s

EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE

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

Digital badges are yours to keep, forever.