A modern, production-ready cookiecutter template for Python packages that follows best practices. This template sets up a complete development environment with all the tools you need to build, test, and publish professional Python libraries.
- pyproject.toml: Uses the modern Python packaging standard (PEP 517/PEP 621)
- Hatch: Fast, modern project management and build tool
- uv: Ultra-fast Python package installer and resolver
- Automatic version management
- Development and production dependency separation
- Proper package metadata and classifiers
- pytest: Modern testing framework
- tox: Automated testing across Python versions
- Coverage.py: Code coverage tracking
- ruff: Ultra-fast Python linter and formatter
- Code style enforcement (PEP 8)
- Import sorting
- Dead code detection
- Best practice enforcement
- mypy: Static type checking
- Pre-configured with sensible defaults
- Easy to customize rules
- Sphinx: Professional documentation generator
- ReadTheDocs theme
- Automatic API documentation
- GitHub Actions workflows for:
- Testing across Python versions
- Code quality checks
- Documentation builds
- Automated PyPI releases
- Structured issue templates for:
- Bug reports
- Feature requests
- Documentation improvements
- Pull request template
- Makefile with common development commands:
make install-dev # Install development dependencies make test # Run tests make lint # Check code quality make format # Format code make docs # Build documentation make clean # Clean build artifacts
-
Install Cookiecutter:
pip install cookiecutter
-
Create your project:
cookiecutter gh:{{cookiecutter.github_username}}/cookiecutter-pipproject
-
Initialize your development environment:
cd your-project-name curl -LsSf https://astral.sh/uv/install.sh | sh # Install uv make install-dev
-
Start developing:
# Run tests make test # Check code quality make lint # Format code make format # Build docs make docs
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE.md file for details.
This template builds on the work of many in the Python community and incorporates modern best practices from various sources. Special thanks to:
- Python Packaging Authority
- Astral for uv and ruff
- pytest team
- GitHub for Actions and security tools