Python Project Template
A modern Python project template with a full toolchain and best practices baked in.
Highlights
- π Package management with
uv(orpoetry) - π§ͺ Testing with
pytest, multi-version withtox - π Beautiful reports via
allure - π§ Code quality enforced by
pre-commit - π Documentation with
mkdocs - π― Doc coverage via
interrogate - π Code checks with
ruff,flake8,mypy
Quick Start
1. Install uv (recommended)
2. Create a new project
# Clone the template
git clone https://github.com/SongshGeo/project_template.git my-project
cd my-project
# Initialize
make setup
3. Start developing
Need help?
See the Quick Start Guide for details.
Project Structure
.
βββ src/ # Source code
βββ tests/ # Tests
βββ config/ # Config files
βββ docs/ # Documentation
βββ scripts/ # Utility scripts
βββ pyproject.toml # Project config
βββ makefile # Shortcuts
βββ README.md # Project overview
Core Capabilities
Package managers
- uv (recommended): extremely fast
- poetry (alternative): mature ecosystem
Code quality
- Black: formatting
- Ruff: blazing-fast lint/format
- Flake8: style checks
- MyPy: type checks
- Interrogate: doc coverage
Testing
- Pytest: unit testing
- Tox: Python 3.10-3.13 matrix
- Allure: test reports
- Coverage: coverage reports
Docs
- MkDocs with Material theme
Docs Navigation
Jump to a section
- π Quick Start - step-by-step tutorial
- π§ Tooling - tools and best practices
- βοΈ Configuration - config walkthrough
- π Development - coding standards
- π Deployment - release process
Feature Matrix
| Feature | Tool | Notes |
|---|---|---|
| Package mgmt | uv, poetry | Modern dependency management |
| Formatting | Black, Ruff | Consistent style |
| Linting | Ruff, Flake8, MyPy | Multi-layer quality |
| Testing | Pytest, Tox | Comprehensive coverage |
| Reports | Allure | Visual test reports |
| Docs | MkDocs | Professional doc site |
| Doc coverage | Interrogate | Ensure docstrings |
| Git hooks | Pre-commit | Checks before commit |
| Versioning | Release Please | Automated releases |
| Typing | MyPy | Static typing |
| Profiling | Snakeviz | Performance visualization |
Common Commands
# Install deps
make setup
# Run tests
make test
# View report
make report
# Configure project
make configure-project
License
MIT License.
Contributing
Contributions welcome. Typical steps:
- Fork the repo
- Create a feature branch
- Commit changes
- Push to your branch
- Open a Pull Request
Links
- π Full docs
- π§ GitHub repo
- π€ Author site