Skip to main content

Cookiecutter template for a Python package

Project description

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.

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

cookiecutter_pypackage-0.3.1.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

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

cookiecutter_pypackage-0.3.1-py3-none-any.whl (25.4 kB view details)

Uploaded Python 3

File details

Details for the file cookiecutter_pypackage-0.3.1.tar.gz.

File metadata

  • Download URL: cookiecutter_pypackage-0.3.1.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cookiecutter_pypackage-0.3.1.tar.gz
Algorithm Hash digest
SHA256 90c2c149e13c71bccb616312d123ab520b5ee749577f18eb86c8b9aed4d75c49
MD5 12c95489fbf7ede43f2fb71ff3876634
BLAKE2b-256 f49ab751251f21169a9e15663aebbcfb584269c76a010a1730df47d86ad8ca84

See more details on using hashes here.

Provenance

The following attestation bundles were made for cookiecutter_pypackage-0.3.1.tar.gz:

Publisher: publish.yml on audreyfeldroy/cookiecutter-pypackage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cookiecutter_pypackage-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for cookiecutter_pypackage-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 924b223b4754d9471bca26e4bdfcd8cad22136e2c712ef9f8917412160b1ea03
MD5 291cdf6213ad5d71357b524317f23dc2
BLAKE2b-256 d7346f008d571736dfa8eb03063194c50b2955db8c95f60a1ced9188b4d5d397

See more details on using hashes here.

Provenance

The following attestation bundles were made for cookiecutter_pypackage-0.3.1-py3-none-any.whl:

Publisher: publish.yml on audreyfeldroy/cookiecutter-pypackage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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