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
Compatibility Compatible Python Versions Linux MacOS Windows
Stats PyPI Download Rate (per month) GitHub Contributors GitHub Contributors GitHub Stars GitHub Forks
Tools Documentation Dependency Manager Pre-commit CI Editor Settings Template Manager

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: most templates are older and do not use current best practices, such as pyproject.toml or one of the numerous dependency managers that make project management much easier.
  • PEP-Compatible: all included tools should meet the design specifications of all finalized PEPs (that rules out poetry, which, three years after PEP adoption, is still not PEP 621 compatible).
  • No External Services: I wanted a template that didn't require external services offering CI/CD, code coverage, code analysis, etc. This is particularly true for services that are neither free nor open-source (e.g. sonarcloud.io, which is in an increasing number of newer templates).
  • (Nearly) Turn-Key: a template should be easy to deploy and immediately use without having to understand or examine the underlying code.
  • Flexible: beyond the core tools, a template should be easy to add other components too (including external services that you use).

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.

Further, rather than adopting a rigid, opinionated approach, snickerdoodle focuses on including nice-looking and functional defaults (like the badges table above, which will include several other badges in your created project). There are also nice extras, like an automatically generated credits page (borrowed from pawamoy) in the documentation, that should work with any Python project. snickerdoodle makes no assumptions about the type of Python project you are creating and includes base template options that are (nearly) universal.

Getting started

This section describes the basic usage of the snickerdoodle template. If you want to modify its settings or have other questions, you should consult the template user guide.

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 local computer.

Setup

If you are new to cookiecutter or simply want to make sure 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 one important addition: 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. Then, 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 the first time - 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.

Contributing

Contributors are always welcome and should find snickerdoodle easy to work with. The template is highly documented so that users and developers can make snickerdoodle work with their projects. 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.1.tar.gz (6.0 kB view hashes)

Uploaded Source

Built Distribution

snickerdoodle-0.1.1-py3-none-any.whl (5.4 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