Welcome to python-template-project
A feature-rich Python project template with auto-generated CLI, GUI and parameterized configuration.
This template provides a solid foundation for your next Python project, incorporating best practices for testing, automation, and distribution. It streamlines the development process with a comprehensive set of pre-configured tools and workflows, allowing you to focus on writing code.
How to use this template
Getting started on developing your own project based on this template
DO NOT FORK This project is meant to be used from Use this template feature.
-
Create a new repository using GitHub template
Click on Use this template. -
Give a name to your project
For example:my-python-project
(Hyphens may be used as project name; they are converted during renaming internally to underscores for packages.) -
Set write permissions
Go to:Repository -> Settings -> Actions -> General -> Workflow permissions
Select:Read and write permissions, then click Save. -
Trigger rename workflow
Navigate toActionstab → Select Rename Action → Run workflow on themainbranch. -
Wait for the workflow to finish
-
Clone the repository
Run:git clone [your-github-url]
-
Open the project in your IDE
-
Install dependencies and create virtual environment Run:
make install -
Configure your IDE Set
.venvas the local Python virtual environment. -
Adjust project metadata Modify
pyproject.toml(e.g., project description, authors, license, etc.) -
Clean up template scripts Delete the files:
rename_project.ymlrename_project.sh
-
Format your codebase Run:
make fmtThis will auto-format your files and reorder imports (based on any name changes).
-
Enable pre-commit hooks Run:
uv run pre-commit install
-
Add repository to ReadTheDocs Visit: https://app.readthedocs.org/dashboard/import/
-
Configure PyPI publishing
- Generate a PyPI API token from your PyPI account.
- Go to GitHub → Settings → Secrets and variables → Actions.
- Add the secret as
PYPI_API_TOKEN.
-
Release your first version Run:
make release
Feature overview
- 📦 Package Management: Utilizes uv, an extremely fast Python package manager, with dependencies managed in
pyproject.toml. - ✅ Code Formatting and Linting: Pre-commit hook with the RUFF auto-formatter to ensure consistent code style.
- 🧪 Testing: Unit testing framework with pytest.
- 📊 Code coverage reports using codecov
- 🔄 CI/CD: GitHub Actions for automated builds (Windows, macOS), unit tests, and code checks.
- 💾 Automated Builds: GitHub pipeline for automatically building a Windows executable and a macOS installer.
- 💬 Parameter-Driven Automation:
- Automatic generation of a configuration file from parameter definitions.
- Automatic generation of a Command-Line Interface (CLI) from the same parameters.
- Automatic generation of CLI API documentation.
- Automatic generation of change log using gitchangelog to keep a HISTORY.md file up to date.
- 📃 Documentation: Configuration for publishing documentation on Read the Docs using mkdocs .
- 🖼️ Minimalist GUI: Comes with a basic GUI based on tkinker that includes an auto-generated settings menu based on your defined parameters.
- 🖥️ Workflow Automation: A
Makefileis included to simplify and automate common development tasks. - 🛳️ Release pipeline: Automated releases unsing the Makefile
make releasecommand, which creates a new tag and pushes it to the remote repo. Thereleasepipeline will automatically create a new release on GitHub and trigger a release on [PyPI](https://pypi.org.- setuptools is used to package the project and manage dependencies.
- setuptools-scm is used to automatically generate the
_version.pyfile from thepyproject.tomlfile.
Installation
Get an impression of how your own project could be installed and look like.
Download from PyPI.
💾 For more installation options see install.
pip install python-template-project
Run GUI from command line
python-template-project-gui
Run application from command line using CLI
python -m python_template_project.cli [OPTIONS] path/to/file
python-template-project-cli [OPTIONS] path/to/file
Troubleshooting
Problems with release pipeline
If you get this error below:
/home/runner/work/_temp/xxxx_xxx.sh: line 1: .github/release_message.sh: Permission denied
You have to run these commands in your IDE Terminal or the git bash and then push the changes.
git update-index --chmod=+x ./.github/release_message.sh
Metadata
Release files for python-template-project 0.2.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| python_template_project-0.2.5.tar.gz | 205.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| python_template_project-0.2.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 233.7 kB
Release files / python_template_project-0.2.5.tar.gz
| Download URL | python_template_project-0.2.5.tar.gz |
|---|---|
| Size | 205.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b1dea5d31f1a32fc99c2a6594cdfc48567fe2395ed54f7d397b2f395752334eb
|
|
BLAKE2b-256 checksum How to use checksums |
3aeda5c19a6a9d99f39f47f549e636d4c229e42ee54056d8626501cc70636232
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.16
|
Release files / python_template_project-0.2.5-py3-none-any.whl
| Download URL | python_template_project-0.2.5-py3-none-any.whl |
|---|---|
| Size | 28.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9e35d53f9a923f0402ec3c1e4c39b4aefeadcff821b431621d37bdb289522938
|
|
BLAKE2b-256 checksum How to use checksums |
0c62da24512cf09472e6fa87bbba287e320ec82b4014dce1fbb31e8a74a43956
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.16
|