Skip to content

πŸ‘·πŸΎβ€β™€οΈ A cookiecutter template for modern python projects. Supports pnpm, conventional commits, git hooks, linters and more.

License

Notifications You must be signed in to change notification settings

dotlas/cookiecutter-pypackage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

55 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ₯  Cookiecutter Template for Modern Python Package Projects 🐍

A package template that comes pre-configured with pre-commit, conventional-commits, mkdocs docs generation and hosting, linting frameworks and a unit testing suite out-of-the-box for better python project development.

About

Cookiecutter templates enables developers and data scientists to create projects from a predefined template. This template is a modern Python package project structure that utilizes a number of tools to automate and align with best practices in order to have smoother development. The project template can be viewed from the structure document. The template creates a project that can be hosted on GitHub and deployed to PyPI.

This template uses husky, commitlint and pre-commit managed by pnpm to use git hooks to automate tasks such as linting, formatting, testing, etc. before a commit is made. This ensures that the code is always in a consistent state and that the commit history is clean and easy to read. The commit messages are also linted to ensure that they follow the Conventional Commits specification.

mkdocs is used to generate a static site for documentation of the project from the docs folder. This is hosted on GitHub Pages through a GitHub Action in .github. The site is automatically built and deployed on every push to the main branch. Mkdocs Material is used as the theme for the documentation site.

This project is primarily built for .vscode but can be used with other editors as well. The .vscode folder contains a number of settings and extensions that are recommended for the project. These are automatically installed when the project is opened in VS Code.

Code style: black

This project uses Pytest as a testing framework with code coverage. A number of python linters are configured to run through pyproject.toml.


  • ⁉️ Helper Resources for more information on choice of tools and how to use them.
  • πŸŽ‹ Project structure for more information on the project structure.

πŸͺ Setup

  • Clone the repository

    git clone https://github.com/dotlas/cookiecutter-pypackage
    cd cookiecutter-template
  • Initialize base conda environment for cookiecutter dependencies and install requirements

    Developers @Dotlas can directly use the dotlas environment instead of base

    conda activate base
    python -m pip install -r requirements.txt

🧰 Usage

Run the following command to create a new project:

cookiecutter .

Or use directly from source:

cookiecutter gh:dotlas/cookiecutter-pypackage

About

πŸ‘·πŸΎβ€β™€οΈ A cookiecutter template for modern python projects. Supports pnpm, conventional commits, git hooks, linters and more.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published