Skip to main content

Project Setup

Layout

These recommendations are based on this article, updated to reflect the use of Pipenv.

Simple project

.gitignore
README.md
LICENSE
Pipfile
Pipfile.lock
sample.py # module lives in a single file
tests/test_sample.py

Application or larger project

.gitignore
README.md
LICENSE
Pipfile
Pipfile.lock
sample/__init__.py
sample/*.py # module lives in a directory
docs/
tests/test_*.py

Library

Packaging a python library

.gitignore

We suggest copying this Python-specific .gitignore into the root of your project:

curl https://raw.githubusercontent.com/github/gitignore/master/Python.gitignore -o .gitignore