Skip to content

daotl/cookiecutter-python

 
 

Repository files navigation

DAOT Python Template

Test Powered by NumFOCUS

The purpose of this template is to get you started quickly building a best-practice python library.

Please check out the

that are automatically generated and kept in sync with this template.

Features

  • automated testing with pytest
  • continuous integration using GitHub actions.
  • documentation hosted by readthedocs
  • coverage tests with codecov
  • pre-commit checks for code style and consistency
  • tutorials with myst-nb and jupyter notebooks
  • issue templates for better bug reports and feature requests

Getting started

In this section we will show you how to set-up your own repository from this template and how to customize it for your needs.

Install dependencies

You need git >=2.28 and uv to be installed on your system. All other dependencies will be managed through uv.

Create the project

We are using cruft to initialize the project from the template. Cruft is fully compatible with cookiecutter, but enables automatic updates to your project whenever a new template version is released.

To create the project, run the following command and follow the prompts:

# uv will download all dependencies on-the-fly
uvx --with pre-commit cruft create https://github.com/daotl/cookiecutter-python

This will create a git repository generated from the template. Now cd into the newly created directory and make the initial commit! Don't forget to create a repository on GitHub and upload your project.

Working without `uv` If you want to permanently install the tools, you can run
pipx install cruft pre-commit # or for each: uv tool install $pkg
cruft create https://github.com/daotl/cookiecutter-python

Set up online services

Your repository is now ready. However, to use all features of the template you will need to set up the following online services. Clicking on the links will take you to the respective sections of the developer documentation. The developer documentation is also shipped as part of the template in docs/template_usage.md.

  1. pre-commit.ci to check for inconsistencies and to enforce a code style
  2. readthedocs.org to build and host documentation
  3. codecov to generate test coverage reports

All CI checks should pass, you are ready to start developing your new tool!

Customizations

Further instructions on using this template can be found in the dev docs included in the project.

Changelog

See the release page.

Releasing a new template version

To release a new version of the template, create a new release on the GitHub release page. Choose a tag name of the format vX.X.X that adheres to semantic versioning.

Note that when creating a new release, changes will be propagated to packages using this template.

About

Cookiecutter template for Python package

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 90.5%
  • Jupyter Notebook 7.7%
  • TeX 1.8%