A reusable Python project template.
- Python: Version 3.12 or higher.
- Git: For version control and cloning the repository.
- uv: For virtual environment management and dependency syncing.
- Install uv globally using pip:
pip install uv
- Install uv globally using pip:
# 1. Clone the repository
git clone git@github.com:<your-org>/<your-repo>.git
cd <your-repo>
# 2. Initialize Virtual Environment & Sync Dependencies
uv venv
.\.venv\Scripts\activate
# 3. Install Dependencies (Dev Mode includes linting/testing tools)
uv sync
pre-commit install
cp .\hooks\post-commit .\.git\hooks\post-commitThis template includes a simple CLI example. It can be run in three different ways:
# 1. As a script
python .\src\python_template\cli.py -h
# 2. As a module
python -m python_template.cli -h
# 3. As a command
app -hUpdate these values first so your new project has the right identity:
- Project metadata in
pyproject.toml[project].name[project].description[project].authors[project.urls].Repository
- Package import path
- Rename
src/python_template/to your package name (for example,src/my_project/). - Update imports and module references from
python_templateto your new package name.
- Rename
- CLI command name
- Update
[project.scripts](currentlyapp) to your preferred command. - Update
proginsrc/python_template/cli.pyto match.
- Update
- README usage examples
- Replace
python_templatereferences in script/module examples with your new package name.
- Replace