The simplest to use, yet the most comprehensive Python template
✨ Features 🚀 Quick start 📚 Documentation 🤝 Contribute 👍 Adopters 📜 Legal
opentemplate is a Python template which is:
- Truly open source: no tokens, no fees, no premium plans, open source software only
- Easy to use: clone templated repo, run pdm setup and focus on your code
- State of the art: best checkers for Python, YAML, Markdown, prose, and more unified
- Secure: SLSA Level 3, SBOMs, attestations, secured egress, OSSF Best Practices
- Consistent: all pipelines (GitHub Actions, pre-commit) share the same pyproject.toml config
- Performant: parallel checks, builds, minimally-sized caches and checkouts
Note
Install pdm (if you don't have it already), for Linux/MacOS:
- Create a new GitHub repository using this template (green Use this template button)
- Name your repo (use underscore _, not hyphens -)
- Add project description (necessary!)
- Wait until the setup commit appears (performed by github-actions[bot], it may take a few minutes)
- Clone the repository
- Run pdm setup command locally to setup development environment
- Create a new branch
- Optionally add dependencies to pyproject.toml
- Write code in /src/<project_name> and tests in /tests
- Use git add, git commit and git push your changes
- pre-commit will guide you through the process
Note that all check and fix commands are grouped for your convenience:
Most of the adjustments can be done by only editing pyproject.toml
Common changes to pyproject.toml:
- Add dev dependencies under [dependency-groups] (everything is named dev-<group>)
- Modify [tool.pdm.scripts] for custom command (check-<group> or fix-<group>, the latter modifies files)
- Use [tool.<name>] to adjust specific tool configuration
Adjusting these sections will affect pre-commit and GitHub Actions
Disable some pre-commit check (click me)Disabling checks should be done cautiously!
pre-commit checks are defined in .pre-commit-config.yaml.
Disable a check using SKIP environment variable:
For details, refer to the id fields in .pre-commit-config.yaml.
Some commands have both <group>-fix and <group>-check for different actions!
We welcome your contributions! Start here:
- This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
- This project is copyrighted by open-nudge - the appropriate copyright notice is included in each file.
.png)
![Court Judge Rules Flock Safety camera data is not exempt from PRA [WA State]](https://bloximages.chicago2.vip.townnews.com/goskagit.com/content/tncms/assets/v3/editorial/0/38/03831dfd-8da1-4314-adee-de2efaee5a8d/673e71385a45e.image.jpg?crop=1821%2C956%2C0%2C90&resize=1200%2C630&order=crop%2Cresize)
![Geoffrey Hinton: Intro to Deep Learning and Deep Belief Nets [video] (2012)](https://www.youtube.com/img/desktop/supported_browsers/edgium.png)
