...
The python scaffold package (https://pypi.python.org/pypi/Scaffold/0.1.13) helps to create a proper directory structure for your package, following the structure as explained in http://www.scotttorborg.com/python-packaging/minimal.html
Each project you scaffold will create the following directory structure:
/[projectname]/
/[projectname]/setup.py
/[projectname]/bin
/[projectname]/docs
/[projectname]/[projectname]
/[projectname]/[projectname]/__init__.py
/[projectname]/tests
/[projectname]/tests/__init__.py
/[projectname]/tests/[projectname]_tests.py
Both setup.py
and [projectname]_tests.py
are set up automatically to reference your project name as a module. The rest is up to you! You should put your code file(s) in the
/[projectname]/[projectname]/
directory and your tests in
/[projectname]/tests/
Installing Scaffold
You can view the scaffold package on PyPi here: http://pypi.python.org/pypi/Scaffold/0.1.3
To install, simply use pip install scaffold
Running Scaffold
You can run scaffold as a python module:
python -m scaffold -p "projectname" [-d {base directory}]
Picking A Name
Python module/package names should generally follow the following constraints:
- All lowercase
- Unique on pypi, even if you don’t want to make your package publicly available (you might want to specify it privately as a dependency later)
- Underscore-separated or no word separators at all (don’t use hyphens)