Skip to main content

GithubActions ReadTheDocs Pypi Downloads Codecov

The xcookie module. A helper for templating python projects.

Read the docs

https://xcookie.readthedocs.io

Github

https://github.com/Erotemic/xcookie

Pypi

https://pypi.org/project/xcookie

The goal is to be able to setup and update Python project structures with consistent boilerplate for things like CI, setup.py, and requirements.

It handles:

  • Multiple version control remotes:

    • Github

    • Gitlab

  • pure python packages

  • python packages with scikit-build binary extensions

  • rotating secrets

  • CI scripts for github or gitlab where the general pattern is:

    • Lint the project

    • Build the pure python or binary wheels

    • Test the wheels in the supported environments (i.e. different operating systems / versions of Python)

    • Optionally sign the wheels with online GPG keys

    • Upload the wheels to test pypi or live pypi.

This is primarily driven by the needs of my projects and thus has some logic that is specific to things I’m doing. However, these are all generally behind checks for the “erotemic” tag. I am working on slowly making this into a proper CLI that is externally usable.

The top level CLI is command-oriented:

usage: xcookie [-h] [--version] {generate,bump,refresh-docs,rotate-secrets} ...

commands:
  {generate,bump,refresh-docs,rotate-secrets}
    generate            generate or update project boilerplate
    bump                bump the package version and changelog
    refresh-docs        regenerate Sphinx API documentation
    rotate-secrets      rotate CI secrets for an existing repository

Run xcookie generate --help for the project-generation options.

Version bumps are a separate maintenance command. They update the authoritative package version and roll CHANGELOG.md from the current release into the next Unreleased section:

xcookie bump              # patch, by default
xcookie bump patch
xcookie bump minor
xcookie bump major
xcookie bump 2.0.0        # explicit target version

Invocations to create a new github repo:

# Create a new python repo
xcookie generate --repo_name=cookiecutter_purepy --repodir=$HOME/code/cookiecutter_purepy --tags="github,purepy"

# Create a new binary repo
xcookie generate --repo_name=cookiecutter_binpy --repodir=$HOME/code/cookiecutter_binpy --tags="github,binpy,gdal"

Given an initialized repository the general usage pattern is to edit the generated pyproject.toml and modify values in the [tool.xcookie] section and then rerun xcookie generate in that directory. It will then present you with a diff of the proposed changes that you can reject, accept entirely, or accept selectively.

For some files where the user is likely to do custom work, xcookie won’t try to overwrite the file unless you tell it to regenerate it. The setup.py is the main example of this, so if you want xcookie to update your setup.py you would run xcookie generate --regen setup.py

Documentation refresh is also a separate maintenance command:

xcookie refresh-docs

Secret rotation is a separate maintenance command rather than a generation option:

xcookie rotate-secrets

The command loads the repository’s xcookie configuration, prints the commands it plans to run, and asks for confirmation before executing them.

Release files for xcookie 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xcookie 0.5.0
File Size Uploaded
xcookie-0.5.0.tar.gz 207.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xcookie 0.5.0
File Interpreter ABI Platform
xcookie-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 400.2 kB

Release files / xcookie-0.5.0.tar.gz

Download URL xcookie-0.5.0.tar.gz
Size 207.1 kB
Tags Source
SHA-256 checksum
How to use checksums
abd4bc70f7625719fc33f7fdc9553d14bc46bfc46bf86b1630fa30e1b7d0ca66
BLAKE2b-256 checksum
How to use checksums
f20db829ab9f780321309394d3a7a59f50742c0cdb4e710b57ab20565bed1882
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.

Transparency log

Release files / xcookie-0.5.0-py3-none-any.whl

Download URL xcookie-0.5.0-py3-none-any.whl
Size 193.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
12ce969f706accdf436310bf4658d2c12ac8d0a015908c6c3b97d729c211940e
BLAKE2b-256 checksum
How to use checksums
74bcbfb77eb2c99d9cb83bf4f2d1596ba01af07e05c30fa93fbc5c045e2e8dc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page