A cookiecutter template for creating Python packages.
- Modern Python packaging (PEP 517/621) with hatchling
- uv for fast dependency management
- GitHub Actions CI/CD (test, lint, release)
- Automated releases with release-please
- PyPI publishing with trusted publishing
- Pre-configured ruff (linting) and mypy (type checking)
- Python 3.11, 3.12, 3.13 test matrix
# Generate new project
uvx cookiecutter gh:OpenDisplay-org/python-module-template
# Follow interactive prompts, then:
cd your-project-name
git init && git add . && git commit -m "chore: initial commit"
uv sync --all-extras- Create GitHub repository: At OpenDisplay-org/your-project-slug
- Configure PyPI trusted publishing: In PyPI project settings
- Push initial commit:
git remote add origin ... && git push -u origin main - Start developing: Add code to
src/package_name/ - Write tests: Add tests to
tests/ - Update README: Customize the generated README.md
- First release: Commit using conventional commits (feat:, fix:, etc.)
# Install with all dependencies
uv sync --all-extras
# Run tests
uv run pytest tests/ -v
# Run tests with coverage
uv run pytest tests/ --cov=src/package_name
# Lint code
uv run ruff check .
# Type check
uv run mypy src/package_nameUse conventional commit messages for automatic versioning:
feat:- New feature (minor version bump)fix:- Bug fix (patch version bump)feat!:orfix!:- Breaking change (major version bump)docs:,refactor:,test:,chore:- No version bump