Skip to Content
Python Command Line Tools Course
on-demand course

Python Command Line Tools Course

with Alfredo Deza, Noah Gift
February 2022
Intermediate
1h 27m
English
Pragmatic AI Labs

Overview

Python Command Line Tools Course

This is a full Python CLI course that will take you from the most basic approaches to command line tools in Python to the more advanced featuers that use frameworks like argparse and Click. Everything on this course is available in the course Repository on GitHub, so that you can follow the examples closely and use that as a foundation with all examples and sample files.

Building a CLI is the foundation for automation in your daily work

By the end of the course you should feel confident in creating a tool, and the following:

  • Create simple CLI tools without any frameworks
  • Learn about arguments, flags, help menus and how to create them automatically
  • Use the argparse framework to build more complex tools
  • Build a CLI with the Click framework
  • Use special features of Click like colored output and argument types
  • Modularizing and project scaffolding in Python
  • Packaging and packaging files in Python
  • How to create tests and run them automatically
  • Continuous Integration and Continuous Deployment with Github Actions for Python
  • Packaging a CLI tool with an executable
  • Distributing a CLI tool on PyPI (the Python Package Index)
  • How to automatically test your project on a PR (GitHub pull request)
  • How to automate publishing your tool to PyPI on a release

We'll cover 3 different ways to create tools, from the very basic (with sys.argv) to using a framework that comes with Python (argparse), and finally the more involved, by using an external library like Click. This flexibility is essential because it will let you decide when to use a simple single file with no dependencies to a fully featured framework like Click.

Then you will learn about the project layout, modularizing and organizing your code in directories and files while keeping everything useful for a CLI. You will test your code using Pytest and then package your code using Python packaging files and tools. You will continue by automating everything, including the testing and linting using GitHub Actions, and finally publishing your project to the Python Package Index so that it can be installed by anyone in the world.

Course Resources
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Watch now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Python Command Line Tools

Python Command Line Tools

Alfredo Deza, Noah Gift
Testing In Python video course

Testing In Python video course

Alfredo Deza, Noah Gift
Fast and Easy Python CLI

Fast and Easy Python CLI

Alfredo Deza, Noah Gift
Python CI/CD for the Command-Line

Python CI/CD for the Command-Line

Alfredo Deza, Noah Gift

Publisher Resources

ISBN: 50131VIDEOPAIMLOtherOtherOther