Chapter 1: Getting Started with Click

Alfredo Deza

Building command-line tools is fun. For me, though, and for the longest time, it meant struggling with the different types of libraries Python had to offer. It all began with optparse, which is deprecated since Python 2.7, and it is unfortunately still in the standard library after all these years. It was replaced with argparse which, as you will see soon, it is still complicated to deal with. It is crucial to understand what Python has to offer to grasp why the alternative (the Click framework) is better.

Click is a project created by Armin Ronacher. If you haven’t heard of him before, you probably have heard about projects he created or co-authored:

- Pygments: Syntax highlighter- Jinja ...

Get Python Command Line Tools now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.