https://github.com/appliedai-initiative/pymetrius
A fire-tested template for production grade python libraries and packages.
https://github.com/appliedai-initiative/pymetrius
cookiecutter python python-library python-package template tox
Last synced: 11 months ago
JSON representation
A fire-tested template for production grade python libraries and packages.
- Host: GitHub
- URL: https://github.com/appliedai-initiative/pymetrius
- Owner: appliedAI-Initiative
- License: mit
- Created: 2020-10-30T13:04:47.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-07-15T11:06:41.000Z (11 months ago)
- Last Synced: 2025-07-16T01:03:32.527Z (11 months ago)
- Topics: cookiecutter, python, python-library, python-package, template, tox
- Language: Python
- Homepage:
- Size: 233 KB
- Stars: 16
- Watchers: 4
- Forks: 2
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Pymetrius - cookiecutter for python libraries
This repository contains a [cookiecutter](https://github.com/cookiecutter/cookiecutter) template
that can be used for library development. The template contains several well-known "best-practices" for libraries
(configurable package managers [`uv`, `pixi`, `poetry`], `poethepoet`, `mypy`, `ruff`, `nbqa`) and also some tools
inspired by projects of ours that we consider generally useful - build and release scripts,
auto-generation of documentation files, and others.
Earlier versions of this template were used in several industry projects as well as for open source libraries.
Build, install and tests of the library are run by default [poethepoet](https://github.com/nat-n/poethepoet) tasks, the documentation is built with Jupyter-Book.
The template includes CI/CD pipelines based on github actions. The documentation will be published to GitHub pages using an action.
In the documentation links to source code will be created, therefore you will be prompted to give the project's url.
See the resulting repository's [contributing guidelines](docs/04_contributing/04_contributing.rst)
for further details. Some examples for projects from this template (with poetry) are [tianshou](https://github.com/thu-ml/tianshou)
and [armscan_env](https://github.com/appliedAI-Initiative/armscan_env/)
# Usage
## Prerequisites
The template supports python 3.11 and higher. For a smooth project generation you need to have
1) Cookiecutter. Install it e.g. with `pip install cookiecutter`
2) You will need `tomli` and `tomli-w`. Install them e.g. with `pip install tomli tomli-w`.
If you have cloned this repo, you can also install them with `pip install -r requirements.txt`
3) The selected package manager for your project (`uv`, `pixi`, or `poetry`) (not needed for the templating itself)
## Creating a new project
Call
```shell script
cookiecutter https://github.com/appliedAI-Initiative/pymetrius -o path/to/directory
```
and walk through the questions. You can also clone this repository, adjust the template and call cookiecutter on
the local file.
You will get a repo in `/`. For finalizing the setup, you can `cd` into it, and call
e.g.,
```shell script
git init
# Setup depends on your chosen package manager (uv, pixi, or poetry)
# The generated README will provide specific instructions
poe format
git add . && git commit -m "Initial commit from pymetrius"
```
Note: if you want to use `sphinx-spelling`, as is configured by default in the `poe` tasks, you may need to install the `enchant` library,
see [installation instructions](https://pyenchant.github.io/pyenchant/install.html#installing-the-enchant-c-library). Otherwise, you
can just remove the spellcheck from the tasks.
Push to your branch and enjoy the fully setup pipelines and documentation!
# Contributing
The core maintainers are Michael Panchenko and Carlo Cagnetta at appliedAI. Initially, the project was also supported by Adrian Rumpold.
We are happy about any contribution to this project, feel free to contact us directly or to open an issue or a pull request.