Skip to main content

Easy-to-use, general-purpose, modern cookiecutter template for Python

Project description

snickerdoodle

snickerdoodle cookie logo

Version PyPI Latest Release GitHub Latest Release
Status Development Status Project Stability License
Docs Hosted By
Tools Documentation Dependency Manager Pre-commit CI Editor Settings Template Manager
Stats PyPI Download Rate (per month) GitHub Stars GitHub Contributors GitHub Issues GitHub Forks
Compatibility Compatible Python Versions Linux MacOS Windows

What is snickerdoodle?

snickerdoodleis an easy-to-use, general-purpose cookiecutter template for Python projects utilizing pdm, mkdocs, GitHub Actions, ruff, and other modern tools. To see what a repository looks like using the template, you can check out snickerdoodle_demo.

Why use snickerdoodle?

There are an enormous number of cookiecutter templates. However, many are difficult to use, inflexible, and/or underdocumented. I created snickerdoodle because I couldn't find another cookiecutter template meeting these criteria:

  • Modern: follows best practices, using modern, actively developed tools.
  • No Required Services: beyond GitHub, you can use whatever code coverage or analysis tools you like.
  • PEP-Compliant: all of the tools follow all finalized PEPs (unfortunately, that rules out poetry, which, three years after the PEP adoption, is still not PEP 621 compliant).
  • Thoughtful: rather than adopting a rigid, opinionated approach, snickerdoodle uses reasonable, but easy-to-change, defaults. It also offers some extras to make your repository look great (like the badges table above, which will include several other badges in your created project and you can select your preferred badge style) and the automatically generated credits page in your created repository's documentation (credit for that goes to pawamoy).
  • Well-Documented: unlike many templates, the internal and external documentation make it easy for you to understand, and, thus, modify the template.

To meet those goals, snickerdoodle uses pdm, a modern dependency manager (that follows PEP 621 syntax), GitHub Actions for CI/CD, and mkdocs on GitHub Pages for documentation. The only other dependency for the template is, obviuosly, cookiecutter.

Getting started

Requirements

To use snickerdoodle and the repository that it creates, you need python, git, cookiecutter (or cruft), and pdm installed on your system. You also need a GitHub account. If you have not already, set up your GitHub credentials on your computer.

Setup

If you are new to cookiecutter or simply want to guarantee that the created repository works as intended, follow the instructions in the snickerdoodle tutorial.

If you are familiar with creating cookiecutter templates, you can go about the normal template construction process with a two important additions. First, after you create the remote repository on GitHub, change "Settings/Actions/General/Workflow Permissions" to "Read and Write Permissions." This is necessary for the repository documentation to be properly deployed. Second, follow the instructions for setting up your virtual environment and deploying your documentation in the snickerdoodle tutorial. It is especially important to follow the document deployment process for your initial deployment - after that GitHub Actions will automatically update and redeploy the documentation (and you need not use the manual process again).

Usage

After your repository is created, you can start setting the dependencies in pyproject.toml. Every push to GitHub will run any tests in the "tests" folder, deploy documentation, and apply ruff. If you wish to publish your repository to PyPI, I recommend using the pdm publish command or the publish GitHub Action, if you set up PyPI to recognize the Action as a trusted publisher.

Contributing

Contributors are always welcome and should find snickerdoodle easy to work with. The template is highly documented so that users and developers can adapt or extendsnickerdoodle to work with their projects. So, forking and creating different template spins is encouraged. If you want to contribute directly to the project, feel free to grab an issue to work on or make a suggested improvement. If you wish to contribute, please read the Contribution Guide and Code of Conduct.

Similar Projects

These are other templates using pdm as their dependency manager:

And, these are other general-purpose templates that are well-maintained, modern, and well-documented:

  • cookiecutter-hypermodern-python: uses, among other tools, sphinx, GitHub Actions, Nox, mypy, flake8, and poetry. If you do not mind those choices and wanted a modern, maintained template, this is the one to use.
  • cookiecutter-pylibrary: a newer template that is minimal compared to most and uses, among other tools, sphinx, GitHub Actions, Setuptools, Tox, and Travis-CI.
  • wolt python package cookiecutter: an interesting template that uses cruft instead of base cookiecutter. The created repository uses, among other tools, 'mkdocs', GitHub Actions, black, flake8, and poetry.

Acknowledgements

I'd also like to extend a special thanks to pawamoy whose excellent pdm and mkdocs extensions and utlities are incorporated into snickerdoodle. Some of the scripts, documentation, configuration files, and other CI code were all adapted from pawamoy's repositories.

I would also like to thank the University of Kansas School of Law for tolerating and supporting this law professor's coding efforts, an endeavor which is well outside the typical scholarly activities in the discipline.

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

snickerdoodle-0.1.5.tar.gz (5.9 kB view hashes)

Uploaded Source

Built Distribution

snickerdoodle-0.1.5-py3-none-any.whl (5.3 kB view hashes)

Uploaded Python 3

Supported by

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