Summary
In this chapter, we learned about command-line applications by developing a CLI client for the railway API that we created in Chapter 14, Introduction to API Development. We learned how to parse command-line arguments with the standard library argparse
module. We looked at how to structure a CLI application interface by using sub-commands and saw how this can help us build modular applications that are easy to maintain and extend. We concluded the chapter with some links to other libraries for CLI application development in Python and some resources where you can learn more.
Working with command-line applications is an excellent way to practice the skills you learned throughout this book. We encourage you to study the code for this chapter, extend it by adding more commands, and improve it by adding logging and tests.
In the next chapter, we will learn how to package and publish Python applications.
Join our community on Discord
Join our community’s...