Skip to main content

Feature-rich Python project template designed for robustness and ease of use.

Project description

Welcome to python-template-project

A feature-rich Python project template with auto-generated CLI, GUI and parameterized configuration.

Github CI Status GitHub release Read the Docs License GitHub issues PyPI Downloads

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.


  1. Create a new repository using GitHub template
    Click on Use this template.

  2. 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.)

  3. Set write permissions
    Go to: Repository -> Settings -> Actions -> General -> Workflow permissions
    Select: Read and write permissions, then click Save.

  4. Trigger rename workflow
    Navigate to Actions tab → Select Rename Action → Run workflow on the main branch.

  5. Wait for the workflow to finish

  6. Clone the repository
    Run:

    git clone [your-github-url]
    
  7. Open the project in your IDE

  8. Install dependencies and create virtual environment Run:

    make install
    
  9. Configure your IDE Set .venv as the local Python virtual environment.

  10. Adjust project metadata Modify pyproject.toml (e.g., project description, authors, license, etc.)

  11. Clean up template scripts Delete the files:

    • rename_project.yml
    • rename_project.sh
  12. Format your codebase Run:

    make fmt
    

    This will auto-format your files and reorder imports (based on any name changes).

  13. Enable pre-commit hooks Run:

    uv run pre-commit install
    
  14. Add repository to ReadTheDocs Visit: https://app.readthedocs.org/dashboard/import/

  15. 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.
  16. 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 Makefile is included to simplify and automate common development tasks.
  • 🛳️ Release pipeline: Automated releases unsing the Makefile make release command, which creates a new tag and pushes it to the remote repo. The release pipeline 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.py file from the pyproject.toml file.

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_template_project-0.2.4.tar.gz (201.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_template_project-0.2.4-py3-none-any.whl (28.3 kB view details)

Uploaded Python 3

File details

Details for the file python_template_project-0.2.4.tar.gz.

File metadata

  • Download URL: python_template_project-0.2.4.tar.gz
  • Upload date:
  • Size: 201.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for python_template_project-0.2.4.tar.gz
Algorithm Hash digest
SHA256 fe085a9d72834df7402e3862852cbe84e66b42d4c04b811cb8baa7dd4cfe2194
MD5 6d53ea4a65f8785f69af3be288d95bef
BLAKE2b-256 5b5d82bf6b891969de867764a759cef2d793c2c4cd6fae5340ac3f7a39bc6f33

See more details on using hashes here.

File details

Details for the file python_template_project-0.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for python_template_project-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fefb82f6a88870774dce72891dc787980bc758ed14d07da1e9524e21808e8c99
MD5 e0b6b17a3f4d4781609fdf07838d608b
BLAKE2b-256 59a781fd5af1c95e20bb8ba933d8fa21d6494884029412e3a7afe263be241f4b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page