Boilerplate code for making a Python 2.7+ package
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Python Boilerplate

The name of the directory, python-boilerplate, is also the name of the distribution. This distribution contains a package called mypackage. An example usage of this package:

#!/usr/bin/env python

from mypackage.mymodule import foo, bar, baz

print(foo(), bar(), baz())

This boilerplate code is meant to support Python 2.7+ (although there’s no reason it can’t support earlier versions).


This distribution is installable via standard usage. Note that Distribute will be installed as part of the setup process (if it isn’t already):

$ python install

Because specifies an entry point as a console script, mybin will be installed into your Python's bin/ directory

Unit Tests

Unit tests are run from the target test:

$ python test