Skip to main content

A Python Template Repository

Project description

pytere

Python Template repository

GitHub release Test status Lint status Coverage status Docs
ruff pre-commit licence

DescriptionInstallUsageUse this templateFAQContribute
Documentation

Description

pytere stands for Python template repository.

It's just a template repository for python, with the following features :

  • 📚 Beautiful documentation with Material for Mkdocs, published as a Github page with mike automatically
  • ✨ Modern code style checks with ruff
  • 🅿️ Easy development with pre-commit hooks
  • ✅ Tests with pytest and automatic coverage without external tools
  • :octocat: CI with Github actions
  • 📝 Issues & PR templates
  • 🤖 Stale bot & Dependabot
  • 🚀 Releases automatically published to PyPi

Install

Install pytere by running :

pip install pytere

For development, you can install it locally by first cloning the repository :

git clone https://github.com/astariul/pytere.git
cd pytere
pip install -e .

Or, if you use Github CLI, use:

gh repo fork astariul/pytere

Usage

pytere does not contain any useful code because it's a template repository.
But you can check if the package is correctly installed with :

from pytere import is_odd

print(is_odd(2))  # False

Use this template

To use this template, click the button "Use this template" :

Use template

It will prompt you to create a new Github repository.

Then replace the content in your freshly created repository, with your own package name, own code, and update the links to point to your own repository.

[!IMPORTANT]
Check the documentation for a comprehensive, step-by-step guide on how to use the template.

FAQ

Why creating yet another template, there is already plenty on the internet ?

True, but I couldn't find one that entirely satisfies my needs and uses the tools I want.

For example, a lot of templates use Sphinx for the documentation, but I'm much more comfortable with MkDocs. Or the test coverage was provided by an external tool, but I wanted everything in Github. Etc...
Hence the creation of this repository.

Can I use this template for a private repository ?

Absolutely !

But some things might not work (for example the release badge), and you might want to remove some features (like automatically pushing to PyPi, or publishing the documentation to Github page)

Contribute

To contribute, install the package locally, create your own branch, add your code (and tests, and documentation), and open a PR !

Pre-commit hooks

Pre-commit hooks are set to check the code added whenever you commit something.

[!NOTE]
If you never ran the hooks before, install it with :

pip install -e .[hook]
pre-commit install

Then you can just try to commit your code. If your code does not meet the quality required by linters, it will not be committed. You can just fix your code and try to commit again !

[!TIP] You can manually run the pre-commit hooks with :

pre-commit run --all-files

Tests

When you contribute, you need to make sure all the unit-tests pass. You should also add tests if necessary !

[!NOTE]
Install the testing dependencies with :

pip install -e .[test]

You can run the tests with :

pytest

Tests are not included in the pre-commit hooks, because running the tests might be slow, and for the sake of developpers we want the pre-commit hooks to be fast !

Documentation

The documentation should be kept up-to-date. You can visualize the documentation locally by running :

mkdocs serve

[!NOTE]
Before running this, you need to install the documentation dependencies :

pip install -e .[docs]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytere-0.7.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytere-0.7.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file pytere-0.7.0.tar.gz.

File metadata

  • Download URL: pytere-0.7.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for pytere-0.7.0.tar.gz
Algorithm Hash digest
SHA256 682fd0c61f5ceb1e5c59099568acee7b95e1b0f4ad2fed06bb7ac1ef03941350
MD5 d5cd960ce8c8ef0b4ca14de5e7a6a834
BLAKE2b-256 39c4a3a149effab14d2f1f143482cf9400c9637badbbf6f9c62b676070b47d5f

See more details on using hashes here.

File details

Details for the file pytere-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: pytere-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for pytere-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ec4bef1eb55b5c758c798611ab5ff51bcbfebcc93c33bfd2d03228c1282ed3b
MD5 b4915b402beedcbef44829e038d841f6
BLAKE2b-256 f004b4de3d2c69e37e4296484ccf4170d32c276d62cc7c554f6598d0cb6b6a81

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page