PyTennessee 2016 Tutorial: Writing Command Line Applications that Click
Clone or download


PyTennessee 2016 - Writing Command Line Applications that Click

Tutorial for writing command line applications using click.






Installation: TL;DR

Know all about installing and developing Python packages and don't feel like reading the rest?:

  • Have Git and Python installed
  • Create and activate a virtualenv
  • Clone this repo (or your own fork of it) and cd to it.
  • Install the package in editable mode: pip install -e .

Installation: Detailed Instructions


In order to make use of this tutorial you will a system with the following installed:

  • Git
  • Python (2.7, 3.3, 3.4, 3.5)

If you do not already have these installed, follow these directions:


The virtualenv package allows you to create isolated environments for developing Python code.

  • To make sure it is installed, run this command:

    pip install virtualenv

    or on Windows (if the above doesn't work):

    python -m pip install virtualenv

    This will either install the package or let you know it's already installed. If it is already installed, you will see:

    Requirement already satisfied (use --upgrade to upgrade)
  • Create a virtualenv for this tutorial:

    virtualenv click_tutorial
  • Activate the virtualenv:

    source click_tutorial/bin/activate

    or on Windows:


Get The Tutorial

  • (Optional) Fork this repo on GitHub

  • Clone the repo locally (using either this repo's URL or that of your new fork.)

    git clone pytn

Install The Tutorial

The tutorial repo is configured to be a Python package in order to ease installation.

  • In a terminal/console cd to cloned tutorial directory: cd pytn

  • Install the package in editable mode:

    pip install -e .
  • Run tests to verify installation:

    py.test -v tests/
  • Verify that all tests report PASSED

Run The Tutorial

Once installed, the tutorial command should be available.

  • See usage information

    tutorial --help