Live data from Hacker News

Modern Python Boilerplate – good package basic structure

news.ycombinator.com

1–6 of 6 posts

Modern Python Boilerplate – good package basic structure

#1
TL;DR: Python Boilerplate repo for fast package building with all best practices

Hello,

I wanted to share a small repository I made named “Modern Python Boilerplate”. I created it because I saw in multiple projects including in professional environnement, the lack of good structure and practice, leading to ugly code or even non-functional, environnement mess…

The goal is to provide a python repository setup that provides all the best good-practices tool available and pre-configure them. It makes it easy to build and publish python package !

The link is here https://github.com/lambda-science/modern-python-boilerplate

It include (in a single Makefile !) modern python management (structure, packaging, version and deps w/ UV), modern CI (listing, formatting, type checking, testing, coverage, pre-commit hooks w/ Ruff/Ty), documentation (automatic API Reference building and publishing on Github/Gitlab w/ Mkdocs) and running (basic Dockerfile, Makefile, DevContainer tested on Pycharm, module running as a terminal command…)

Don’t hesitate to share feedback or comments on this, what could be improved.

I heard for example that some people hate pre-commit hooks, so I just kept it to the straight minimum of checking/re-formatting code.

Re: Modern Python Boilerplate – good package basic structure

#5

So, It's like Cookiecutter, right? https://github.com/cookiecutter/cookiecutter

Yes. However, cookiecutter is the tool.

It would be nice if the repo was made into a cookiecutter template.

https://cookiecutter.readthedocs.io/en/latest/tutorials/