A modern Python project template with batteries included: tooling, docs, tests, CI, and packaging.
# Install uv (recommended, faster)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Or install poetry
pip install poetry# Clone this template
git clone https://github.com/SongshGeo/project_template.git my-project
cd my-project
# Initialize the project (configure name/description)
make setup
# Manual configuration (optional, if make setup is skipped)
make configure-project # auto-detects package manager
# or run directly (requires deps installed)
python scripts/configure_project.pyWhat the config script does
- Update
[project]and[tool.poetry]inpyproject.toml - Update GitHub workflow config
- Create/update
README.md - Clear
CHANGELOG.md
The script will ask for
- Project name: used in package/config
- Project description: short project summary
uv sync --all-extras # using uv
# or
poetry install # using poetry# Run tests
make test
# View test report
make report
# Run pre-commit checks
pre-commit run --all-files.
├── src/ # Source code
│ ├── api/ # API layer
│ ├── core/ # Core logic
│ └── __init__.py
├── tests/ # Tests
│ ├── conftest.py # pytest config
│ └── helper.py # test helpers
├── config/ # Configuration
│ └── config.yaml # Main config
├── data/ # Data assets
├── docs/ # Documentation
├── examples/ # Examples
├── scripts/ # Utility scripts
│ └── configure_project.py
├── pyproject.toml # Project config (uv/poetry)
├── tox.ini # Multi-Python testing
├── makefile # Make shortcuts
└── README.md # This file- Makefile automation
- Hydra-friendly config management
- pytest unit tests
- allure reports
- nbstripout for notebooks (keep outputs)
- pre-commit for linting
- mkdocs for docs
- uv package manager (poetry compatible)
- interrogate doc coverage
- Jupyter for analysis
- snakeviz profiling
- isort imports
- flake8 linting
- ruff linting
- black formatting
- mypy type checking
- coverage reports
- tox for Python 3.10-3.13 matrix
- release-please versioning
- mkdocs-material theme
# Install all deps (auto-detect uv or poetry)
make setup
# Run tests
make test
# Matrix tests (Python 3.10-3.13)
make tox
# Test report
make report
# Configure project metadata
make configure-project
# Serve docs
make docsNote: The Makefile auto-detects uv first, then poetry. If neither is installed, it prints install hints.
# Install deps
uv sync --all-extras
# Run tests
uv run pytest
# Run any Python command
uv run python your_script.py
# Add a dependency
uv add package-name
# Add a dev dependency
uv add --dev package-name# Install deps
poetry install
# Run tests
poetry run pytest
# Add a dependency
poetry add package-name# Install pre-commit hooks
pre-commit install
# Run all checks
pre-commit run --all-files
# Run specific checks
pre-commit run flake8 --all-files
pre-commit run black --all-files
pre-commit run interrogate --all-files # doc coverage# All versions (via Makefile)
make tox
# Specific version
make tox-e pyversion=py311
# List envs
make tox-list
# Direct tox
tox # all versions
tox -e py311 # Python 3.11
tox list # show envs
tox -p # parallel!!! info "Online docs" Visit Online Docs for the full site.
# Dev server with live reload
make docs
# Or run directly
uv run mkdocs serve
poetry run mkdocs serve # via poetryOpen http://127.0.0.1:8000.
make docs-build
# or
uv run mkdocs buildDocs are deployed by GitHub Actions:
- Push to
main - Actions build automatically
- Pages deploy
URL: https://songshgeo.github.io/project_template/
- 📖 Quick Start - step-by-step tutorial
- 🔧 Tooling - usage and best practices
- ⚙️ Configuration - config walkthrough
- 📝 Development - coding standards
- 🚀 Deployment - release process
A: uv is faster and modern; poetry is mature. Choose based on preference.
A: Run make setup to configure and install deps.
uv add package-name # runtime deps
uv add --dev package-name # dev depsmake test # via Make
uv run pytest # directContributions welcome! Steps:
- Fork the repo
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit (
git commit -m 'feat: add amazing feature') - Push (
git push origin feature/amazing-feature) - Open a Pull Request
Please ensure:
- All linters pass
- Tests are added/updated
- Docs are updated
- Follow coding guidelines
MIT License. See LICENSE.