Skip to content

Template for Python packages with UV, GitHub Actions, semantic-release, and optional Starlight documentation

License

Notifications You must be signed in to change notification settings

opencitations/python-package-template

Repository files navigation

Python package template

A template for creating Python packages with UV dependency management, pytest testing, semantic-release versioning, and optional Astro Starlight documentation.

Getting started

  1. Click the Use this template button on GitHub:

    "Use this template" button

  2. Select Create a new repository, fill in the repository name, and click Create repository:

    "Create a new repository" page

  3. Clone your new repository and continue with the setup below.

Prerequisites

Setup

Run the setup script:

python setup.py

The script will ask for:

  • Package name
  • Description
  • Author name and email
  • GitHub username/organization
  • Whether to include a Starlight documentation site

It will automatically configure all files and remove itself when done.

After running the script

Configure your GitHub repository:

  1. Add PyPI token (for publishing releases)

  2. Enable GitHub Pages (only if you included documentation)

    • Go to Settings > Pages
    • Set Source to "GitHub Actions"

Learn more

For detailed explanations of the tools and workflows used in this template, see the Repository setup guides.