Skip to content

Click, a Command-line Parsing Package for Python

Photo of Robin Chew
Hosted By
Robin C.
Click, a Command-line Parsing Package for Python

Details

Do you prefer to spend your time writing a program, or writing the interface layer (which handles the command-line options and subcommands, tests them for validity, opens files, etc.)?

Wouldn't it be great if you could just indicate how your command-line interface should work and let something else take care of the details? Good news: Click can do this! It uses decorators, so as to keep your interface functions concerned only with business logic, i.e. dealing with the problem domain. Click has a large set of classes that make it easy to specify the type of your command-line options and arguments, and create custom types if you want. And it generates online help messages, which can be enhanced by optional descriptions that you add to your option specifications.

This talk will give an overview of how to create a Python command-line tool using setup.py packaging, with entry points.

Alastair is a Software Engineer and system administrator by trade. He has a BSc in Computer Science from Curtin University.

His computer-related interests lie in various areas within his trade; suffice to say that he is a "geek of many colours". :) Alastair is a die-hard FOSS user and Linux fan.

He is also a freelancer with his own business. Warpspace IT is a consultancy with a fairly broad focus on the technical side of IT.

Photo of Python WA group
Python WA
See more events
Riff, powered by Spacecubed
45 St Georges Terrace · Perth, WA