Skip to main content

A template library for Python library projects using Poetry and Semantic Release.

Project description

Python Library Template

Enterprise-grade Python library template with security scanning, automated publishing, and optional AWS integration.

CI Pipeline PyPI Python

Poetry Code style: black Linting: Ruff pre-commit Dependabot

pytest GitHub Actions Semantic Release AWS SAM License: AGPL v3

📊 Live Dashboards

📖 Documentation 🧪 Test Results 📊 Coverage 🔒 Security ⚖️ Compliance

⚡ What You Get

Zero-Config CI/CD Pipeline

  • Matrix testing with HTML reports
  • Automated security scanning (Bandit, Safety, pip-audit, Semgrep)
  • License compatibility checking and compliance reports
  • Semantic versioning with automated changelog generation

Enterprise-Grade Quality

  • Pre-commit hooks (Ruff, Black, conventional commits)
  • Test-driven development setup with Click CLI testing
  • Code coverage reporting with beautiful HTML dashboards
  • API documentation auto-generated and deployed to GitHub Pages

Modern Python Stack

  • Poetry dependency management with security/compliance groups
  • Trusted publishing to PyPI/TestPyPI (no API keys needed)
  • Optional AWS SAM integration with ephemeral test environments
  • Windows/Git Bash compatibility with comprehensive guidance

🚀 Quick Start

1. Get the Template

# Use as GitHub template or clone
gh repo create my-awesome-lib --template svange/augint-library --public
cd my-awesome-lib

2. One-Command Setup

# Complete automated setup
python bootstrap.py full-setup

This will:

  • Generate project-specific .env and CLAUDE.md files
  • Replace template strings throughout the codebase
  • Set up AWS pipeline resources (optional)
  • Guide you through the remaining manual steps

3. Secure Your Secrets

# Add GitHub token to .env, then
chezmoi add .env
chezmoi git add . && chezmoi git commit -m "Add project secrets"

4. Go Live

poetry install && pre-commit install
git add . && git commit -m "feat: initial project setup"
git push

That's it! Your CI/CD pipeline is now running with full security scanning and automated publishing.

📋 Prerequisites

Required Tools:

PyPI Setup (Important - Do This First!):

  1. Reserve your package name on PyPI and TestPyPI
  2. Set up Trusted Publishing:
    • Publisher: GitHub Actions
    • Repository: your-account/your-repo
    • Workflow: pipeline.yaml
    • Environment: pypi

Windows Users:

# Install tools
winget install Python.Python.3.11
winget install twpayne.chezmoi
winget install --id FiloSottile.age

# Set environment for Claude Code
$env:CLAUDE_CODE_GIT_BASH_PATH="C:\Program Files\Git\bin\bash.exe"

AWS Setup (Optional - One Time Per Account):

# Enable GitHub Actions OIDC
aws iam create-open-id-connect-provider \
  --url https://token.actions.githubusercontent.com \
  --client-id-list sts.amazonaws.com

🏗️ Bootstrap Commands

# Complete guided setup
python bootstrap.py full-setup

# Individual commands
python bootstrap.py init       # Generate .env from git remote
python bootstrap.py customize  # Replace template strings
python bootstrap.py aws        # Set up AWS pipeline resources

# Testing and dry-run
python bootstrap.py --dry-run full-setup
python bootstrap.py templates   # Generate example files

📚 Documentation Best Practices

API Documentation (Google-style docstrings):

def process_data(data: list[str], format: str = "json") -> dict:
    """Process input data and return formatted results.

    Args:
        data: List of strings to process.
        format: Output format ("json" or "xml").

    Returns:
        Processed data in specified format.

    Example:
        >>> process_data(["item1", "item2"])
        {"processed": ["item1", "item2"]}
    """

Library vs CLI Design:

  • Use __all__ to control public API surface
  • Keep CLI commands in separate modules
  • Document both library and CLI usage in module docstrings

🛠️ Development Workflow

# Daily development
poetry run pytest              # Run fast tests
poetry run pytest -m slow      # Run AWS integration tests  
poetry run ruff check --fix     # Lint and fix
poetry run black .              # Format code

# Security and compliance (CI runs these automatically)
poetry install --with security,compliance
poetry run bandit -r src/
poetry run safety check
poetry run pip-licenses

# Documentation
poetry run pdoc src/your_module  # Generate docs locally

💡 Pro Tips

  • Branch Protection: See .github/BRANCH_PROTECTION.md for recommended settings
  • Dependabot: Auto-merge is configured for safe updates (patch/minor)
  • Security Scans: Only run on main/dev branches to keep feature branches fast
  • Windows Users: All commands work in Git Bash, PowerShell, and CMD
  • Claude Code: Generate CLAUDE.md during bootstrap for AI-assisted development

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

augint_library-1.22.0.tar.gz (32.3 kB view details)

Uploaded Source

Built Distribution

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

augint_library-1.22.0-py3-none-any.whl (29.9 kB view details)

Uploaded Python 3

File details

Details for the file augint_library-1.22.0.tar.gz.

File metadata

  • Download URL: augint_library-1.22.0.tar.gz
  • Upload date:
  • Size: 32.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for augint_library-1.22.0.tar.gz
Algorithm Hash digest
SHA256 4772891e7e54e413d7558b0f51fae98f7f8a4618108d38d8d7dd82b09745ce60
MD5 38a545a8fb9d74ad40494184c50e8abf
BLAKE2b-256 7b2994968d8ecdbd32d6ac03efdcbe463a329d88228b759c2e773ccf6da431d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for augint_library-1.22.0.tar.gz:

Publisher: pipeline.yaml on svange/augint-library

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

File details

Details for the file augint_library-1.22.0-py3-none-any.whl.

File metadata

File hashes

Hashes for augint_library-1.22.0-py3-none-any.whl
Algorithm Hash digest
SHA256 029ca9b17ffb78d26d5b1c942c731a15be4d2b49385e7a90afb24acf471774a0
MD5 545323de6c2a624f63bbe4ca3c30f183
BLAKE2b-256 c3c73ca56fb0299b9faaacba46fb529dee7879830f185517e00a42c5cf8e3647

See more details on using hashes here.

Provenance

The following attestation bundles were made for augint_library-1.22.0-py3-none-any.whl:

Publisher: pipeline.yaml on svange/augint-library

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