Skip to main content

Public Python Package Template

Using This Template for Your Own Package (e.g., "my_package")

To adapt this template for your new package (let's call it "my_package"):

  1. Copy or Template the Repository:

    • Click the "Use this template" button on GitHub to create a new repository from this template.
  2. Rename the Package Directory:

    • Rename the main package directory in src dir
  3. Update pyproject.toml:

    • [project].name: Change from "public_package_template" to "my_package".
    • [project].urls: Update Homepage and Repository URLs to point to your new repository.
  4. Set up bump version:

    1. Install and authenticate GitHub CLI:
      # Install GitHub CLI (if not already installed)
      # macOS: brew install gh
      # Linux: See https://cli.github.com/
      
      # Authenticate
      gh auth login
      
    2. Create a Personal Access Token:
    3. Add the token to repository secrets:
      gh secret set BUMPVERSION_TOKEN --body "your_generated_token_here"
      
    4. It is recommended to make the main branch protected as every push/merge/commit to it will trigger a bump version.
  5. Set up PyPI

    1. Create PyPI API token:
    2. Add the token to repository secrets:
      gh secret set PYPI_PUBLISH_TOKEN --body "pypi-your_token_here"
      
  6. Verify secrets setup:

    # List all repository secrets
    gh secret list
    
    # Check authentication status
    gh auth status
    
  7. Once you push anything to main, a new tag will be created, built, and published to PyPI

Managing Repository Secrets via CLI

Additional useful commands:

# Set multiple secrets from .env file
gh secret set -f .env

# Delete a secret
gh secret delete SECRET_NAME

# Set organization-level secret
gh secret set SECRET_NAME --org your-org

# Open repository settings in browser
gh browse --settings

Installing Your Published Public Package

Then you can just pip install your package.

Release files for yid-public-package-template 0.1.15

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

Source distribution (sdist)

Source distribution for yid-public-package-template 0.1.15
File Size Uploaded
yid_public_package_template-0.1.15.tar.gz 3.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for yid-public-package-template 0.1.15
File Interpreter ABI Platform
yid_public_package_template-0.1.15-py3-none-any.whl Python 3 none any Details

Total release size: 6.5 kB

Release files / yid_public_package_template-0.1.15.tar.gz

Download URL yid_public_package_template-0.1.15.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
49ae8c466951fd4b0102f3625d90f6c0530d8eff750c10ebde2a6c7c299bac80
BLAKE2b-256 checksum
How to use checksums
46ad7930bf057ca01735557e07c03b84b5bd0483381aa461d16284e6176fdb64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.12

Release files / yid_public_package_template-0.1.15-py3-none-any.whl

Download URL yid_public_package_template-0.1.15-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a336b48ede4bb2e6ed90c3432fcaf6f147f77970dc4b749da9e6a323a37f811
BLAKE2b-256 checksum
How to use checksums
912d451d9aeabe3e5ce198898905b0c4f412c876cd8ee9862fa60ae976d564a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.12

Release history Release notifications | RSS feed

This release

0.1.15 This release

2 release files

0.1.14

2 release files

0.1.13

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