Fundamentals 11 min read

Comparison of Python Project Templates and Build Tools: CookieCutter, PyScaffold, PyBuilder, and Poetry

This article reviews the lack of a standard Python project layout and compares four popular tools—CookieCutter, PyScaffold, PyBuilder, and Poetry—by showing their installation commands, generated directory structures, and typical build/test workflows.

Python Programming Learning Circle
Python Programming Learning Circle
Python Programming Learning Circle
Comparison of Python Project Templates and Build Tools: CookieCutter, PyScaffold, PyBuilder, and Poetry

Python has never settled on a single, de‑facto standard for project layout and build automation, which leads to many different structures and tools. Unlike Java, which converged on Maven’s conventions, Python’s ecosystem offers several independent solutions.

The article introduces four widely used tools for creating and managing Python projects: CookieCutter, PyScaffold, PyBuilder, and Poetry. For each tool it shows how to install it, generate a sample project, and the typical directory tree produced.

CookieCutter

Install and generate a project from the popular audreyr/cookiecutter-pypackage template:

$ pip install cookiecutter
$ cookiecutter gh:audreyr/cookiecutter-pypackage

After answering the prompts, the generated layout looks like:

$ tree sample
sample
├── AUTHORS.rst
├── CONTRIBUTING.rst
├── HISTORY.rst
├── LICENSE
├── MANIFEST.in
├── Makefile
├── README.rst
├── docs
│   ├── Makefile
│   ├── authors.rst
│   ├── conf.py
│   ├── ...
├── requirements_dev.txt
├── sample
│   ├── __init__.py
│   ├── cli.py
│   └── sample.py
├── setup.cfg
├── setup.py
├── tests
│   ├── __init__.py
│   └── test_sample.py
└── tox.ini

Typical build commands are executed via make (e.g., make test , make coverage , make docs , make dist ) after installing supporting packages such as tox , wheel , coverage , sphinx , and flake8 with pip .

PyScaffold

Install and create a project with:

$ pip install pyscaffold
$ putup sample

PyScaffold places source files under a src directory:

$ tree sample
sample
├── AUTHORS.rst
├── CHANGELOG.rst
├── ...
├── pyproject.toml
├── setup.cfg
├── setup.py
├── src
│   └── sample
│       ├── __init__.py
│       └── skeleton.py
├── tests
│   ├── conftest.py
│   └── test_skeleton.py
└── tox.ini

All build and test actions are driven by tox , which creates isolated virtual environments for each task.

PyBuilder

Install and start a project:

$ pip install pybuilder
$ mkdir sample && cd sample
$ pyb --start-project

The resulting layout is Maven‑like:

$ tree sample
.
├── build.py
├── docs
├── pyproject.toml
├── setup.py
└── src
    ├── main
    │   ├── python
    │   └── scripts
    └── unittest
        └── python

Tasks are listed with pyb -t sample and can be run individually (e.g., pyb run_unit_tests ). Dependencies are declared inside build.py using project.depends_on(...) .

Poetry

Install and create a new project:

$ pip install poetry
$ poetry new sample

The minimal structure is:

$ tree sample
sample
├── README.rst
├── pyproject.toml
├── sample
│   └── __init__.py
└── tests
    ├── __init__.py
    └── test_sample.py

Poetry manages dependencies and packaging via the pyproject.toml file (similar to Node’s package.json ). Common commands include poetry add , poetry install , poetry build , poetry run pytest , and poetry run my-script for executing scripts defined under [tool.poetry.scripts] .

Overall, the complexity of the generated project structure decreases from CookieCutter to PyScaffold, PyBuilder, and finally Poetry, while the learning curve follows the same order.

PythonBuild ToolsPoetryproject-templatesCookieCutterPyBuilderPyScaffold
Python Programming Learning Circle
Written by

Python Programming Learning Circle

A global community of Chinese Python developers offering technical articles, columns, original video tutorials, and problem sets. Topics include web full‑stack development, web scraping, data analysis, natural language processing, image processing, machine learning, automated testing, DevOps automation, and big data.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.