Skip to content

Latest commit

 

History

History
119 lines (91 loc) · 6.7 KB

README.md

File metadata and controls

119 lines (91 loc) · 6.7 KB

Python Project Template

Copier Poetry linting: ruff pre-commit Checked with pyright security: bandit vulnerability: safety Semantic Versions License

A generic python project template based on copier for my data science focused projects.

TL;DR

copier copy --trust git+https://github.com/twsl/python-project-template path/to/destination

Features

Development features

  • Supports Python 3.8 and higher.
  • Poetry as a dependencies manager. See configuration in pyproject.toml.
  • Automatic codestyle with ruff.
  • Ready-to-use pre-commit hooks with code-formatting.
  • Type checks with pyright.
  • Security checks with safety and bandit.
  • Testing with pytest.
  • Ready-to-use .editorconfig and .gitignore.
  • Ready-to-use Devcontainer.

Deployment features

  • GitHub integration: Ready-to-use Pull Requests templates and several Issue templates
  • Github Actions with predefined workflows.
  • Everything is already set up for security checks, codestyle checks, code formatting, testing, linting, docker builds
  • Always up-to-date dependencies with @dependabot.
  • Automatic release notes with Release Drafter.
  • Documentation with MkDocs or Sphinx.

Open source community features

  • Files such as: LICENSE, CONTRIBUTING.md, CODE_OF_CONDUCT.md, and SECURITY.md are generated automatically.
  • Semantic Versions specification with Release Drafter.

How to use it

Installation

To begin using the template consider updating copier:

pip install --upgrade copier

Then, you can copy the template to your destination folder:

copier copy --trust git+https://github.com/twsl/python-project-template path/to/destination

Update

You can update the template in your destination folder with:

copier update --trust path/to/destination

Variables

The template uses the following variables to customize the project:

Parameter Default value
custom_install customized
project_name example_project
project_description ``
primary_branch main
author_username ``
author_email {{ author_username }}@users.noreply.github.com
repository_provider github.com
repository_namespace {{ author_username }}
repository_name {{ project_name }}
copyright_holder {{ author_username }}
copyright_holder_email {{ author_email }}
copyright_year 2024
copyright_license MIT
python_version 3.11
python_package_distribution_name {{ project_name }}
python_package_import_name {{ project_name }}
python_package_command_line_name {{ project_name }}
line_ending lf
use_precommit true
include_docs true
include_notebooks true
include_databricks true
include_copilot true
github_runner_python_version 3.11
github_runner ubuntu-latest
github_runner_onprem small
github_rate_limit false
include_sample_code false
self_signed false

All input values will be saved in the .copier-answers.yml

Credits

I just combined multiple templates to create this one, therefore all credits belong to the following projects: