Some relevant links

PyPI

PyPI, the Python Package Index, is a repository of Python packages that can be installed with pip. You can set up a local PyPI server and configure pip to use it by modifying your $HOME/.pypirc file. It’s easy to set up a Heroku instance to run pypiserver.

Why bother

If you package Python code this way, two benefits accrue. First, pip will install the executable script right on the path, whenever you are in a virtual environment to which your package has been installed. Second, this configures your package to make it ready and easy to upload to a PyPI server.

Here is my-awesome-helloworld-script.

#!/usr/bin/env python
print "Hello World"

To build my package, I need a setup.py file.

from setuptools import setup

setup(
    name='my-awesome-helloworld-script',    # This is the name of your PyPI-package.
    version='0.1',                          # Update the version number for new releases
    scripts=['helloworld']                  # The name of your scipt, and also the command you'll be using for calling it
)

And here is the process for building the package.

$ python setup.py register sdist upload
...
$ pip install my-awesome-helloworld-script