Skip to main content

Creates the skeleton of your Python project.

Project description

Starting a new Python project from the scratch is boring and error prone:
  • Create a setup.py script

  • Configure documentation

  • Provide installation instructions

  • A README file

  • etc…

This time-consuming and error prone work gives little satisfaction, but is necessary to make your project a good citizen in the open source community.

Boilerplate produces skeletons for your Python projects so you can get up and running fast. It is influenced by this blog post: http://jeffknupp.com/blog/2013/08/16/open-sourcing-a-python-project-the-right-way/, although we do not follow these recommendations by the letter.

The filesystem structure

The python-boilerplate init [<project>] command will create the following tree under the current directory:

.
|- .gitignore
|- LICENSE
|- MANIFEST.in
|- INSTALL.rst
|- README.rst
|- VERSION
|- requirements.txt
|- requirements-dev.txt
|- setup.py
|- docs/
|   |- conf.py
|   |- index.rst
|   |- make.bat
|   |- Makefile
|   |- _static/*
|   \- _templates/*
\- src/
    \- <project>
        |- __init__.py
        |- __meta__.py
        |- <project>.py
        \- test/
            |- __init__.py
            \- test_<project>.py

setup.py

src/*

docs/*

README.rst and INSTALL.rst

We provide a default INSTALL.rst file with generic installation instructions for Python packages. Unless your project requires something fancy, this probably can be left as is.

The README.rst file, however, provides a detailed overview of your project. You should edit this file to provide a meaningful description, otherwise a not so flattering default will be used. The contents of README.rst are also displayed in the index page of the project’s documentation.

VERSION

Your project’s version is conveniently centralized in a single file. The setup.py script uses this value to register you package and it also saves the correct version in the package.__version__ attribute in your module.

You may bump versions using an invoke task:

$ inv bump-version

This method assumes that the version string is in the form “<major>.<minor>.<micro>”.

requirements.txt

The requirements.txt uses the - e . directive to tell pip to search for the requirements in the setup.py script. As a general rule, dependencies should be specified only in the install_requires flag in your setup.py.

You may want to use your requirements.txt to freeze packages to specific versions by adding lines such as:

my-package==1.2.3

Freezing makes sense for packages that are meant to run only on their own private environments such as a Django project running in it own virtualenv or docker container.

MANIFEST.in

LICENSE

.gitignore

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-boilerplate-0.3.0.tar.gz (26.1 kB view details)

Uploaded Source

File details

Details for the file python-boilerplate-0.3.0.tar.gz.

File metadata

File hashes

Hashes for python-boilerplate-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e38bf4c8890916d93a0c9f98c9dd3da76603e436e97f91bf49d3379e15da10ec
MD5 7b6b49d3e6dd723cfd8ffac9ca541ac6
BLAKE2b-256 37bc650224e6a4ab74c2cfbcfed62f76c125bdd76e6555a4006c01e95d8d5a45

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page