Skip to content

audreyfeldroy/cookiecutter-pypackage

Cookiecutter PyPackage

PyPI version PyPI downloads

Cookiecutter template for a Python package.

Features

  • Modern tooling: uv for dependency management, justfile for task running
  • Testing with pytest, GitHub Actions for Python 3.10, 3.11, 3.12, 3.13, and 3.14
  • Auto-release to PyPI via Trusted Publishers when you push a tag
  • Command line interface using Typer

Quickstart

First, install uv if you haven't already.

Generate a new Python package:

uvx cookiecutter-pypackage

You'll be prompted for some values:

[1/9] full_name (Audrey M. Roy Greenfeld): Your Name
[2/9] email (audreyfeldroy@example.com): you@example.com
[3/9] github_username (audreyfeldroy): your-github-username
[4/9] pypi_package_name (python-boilerplate): my-package
[5/9] project_name (Python Boilerplate): My Package
[6/9] project_slug (my_package):
[7/9] project_short_description (...): A short description of your package.
[8/9] pypi_username (your-github-username):
[9/9] first_version (0.1.0):
Traditional way (without uvx)
uv venv
source .venv/bin/activate
uv pip install cookiecutter
cookiecutter gh:audreyfeldroy/cookiecutter-pypackage

Then:

  • Create a GitHub repo and push your code
  • Set up PyPI Trusted Publishing for your repo
  • Release your package by pushing a tag: git tag v0.1.0 && git push --tags

Not Exactly What You Want?

Don't worry, you have options:

Fork This / Create Your Own

If you have differences in your preferred setup, I encourage you to fork this to create your own version. Or create your own; it doesn't strictly have to be a fork.

Similar Cookiecutter Templates

Explore other forks to get ideas. See the network and family tree for this repo.

Or Submit a Pull Request

I also accept pull requests on this, if they're small, atomic, and if they make my own packaging experience better.

About

Cookiecutter template for a Python package.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published