Skip to content

MoritzM00/python-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Light-weight Python Template


Tired of overloaded python templates? This template is for you!

This demo repository shows the template in action.

Features

uv for efficient dependency management

Note: Need Conda as base environment for data Science and ML Projects? Switch to the conda Branch!

Pre-Commit for enforcing code quality

✅ CI/CD with Pre-Commit CI and GitHub Actions

✅ Light-weight Documentation with pdoc with deployment to GitHub Pages

Quick Start

  1. Install uv, e.g. with homebrew:

    brew install uv
  2. Run the following command:

    uvx cookiecutter gh:MoritzM00/python-template

    or

    uvx cookiecutter -c conda gh:MoritzM00/python-template

    to get the conda template.

Detailed Instructions for first-time setup

Pre-Requisites

  • Python >= 3.10
  • uv

The code is tested for python versions 3.10 and 3.11 on Linux and version 3.10 on macOS.

Environment Setup and GitHub Linking

After you generated your project with the template (see above), you need to do the following steps:

  1. Setup your environment by executing

    make setup
    source .venv/bin/activate

    and then create a commit (must include the uv.lock file):

    git add .
    git commit -m "initial commit"
  2. Push your local repository to Github with the Github CLI: For this, run

    gh repo create

    to interactively create a new repository on Github.

Set up third-party services

  1. Enable Pre-Commit CI for your repository.
  2. Enable Github Pages for your documentation. To do that, go to the Settings tab of your repository and scroll down to the Pages section. For the Source option, select GitHub Action.