Cookiecutter template for Python package.
src
project structure - how and why- Checks & tests with tox
pyproject.toml
for configuration- CI and deployment to PyPI with GitHub Actions
- Documentation with Sphinx
- Easy API documentation with autosummary
- Leverage type annoations for docs with sphinx-autodoc-typehints
- Changelog based on Keep a Changelog
Install the latest Cookiecutter if you haven't installed it yet (this requires Cookiecutter 1.4.0 or higher):
pip install -U cookiecutter
Generate a Python package project:
cookiecutter https://github.com/lukasberbuer/cookiecutter-pypackage.git
Then:
- Follow instructions in generated README to set up development environment
- Create a GitHub repository and push it there
- Register your project with PyPI
- Add API tokens as GitHub secrets for PyPI (
PYPI_API_TOKEN
) and Test PyPI (TEST_PYPI_API_TOKEN
) for automated publishing - Add the repo to your Read the Docs account and activate the service hook
- Release your package by pushing a new tag to master