A template library for Python library projects using Poetry and Semantic Release.
Project description
Python Library Template
Python library template with security scanning, automated publishing, and optional AWS integration.
📊 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
.envandCLAUDE.mdfiles - 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:
- Python 3.9+ and Poetry
- Git and GitHub CLI (optional)
- For AWS features: AWS CLI and SAM CLI
- For secret management: chezmoi and age
PyPI Setup (Important - Do This First!):
- Reserve your package name on PyPI and TestPyPI
- 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.mdfor 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file augint_library-1.22.1.tar.gz.
File metadata
- Download URL: augint_library-1.22.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
085f2893d310ff6ff22302799c53a49ba524ef6fb7b1f7c4a010226b28cf7c78
|
|
| MD5 |
92130fbbdcd8ea934f57865bb2fbef22
|
|
| BLAKE2b-256 |
ec9edc226d41694a565abd1335a97a135c45f8a230377e0703bbc2fa793974ff
|
Provenance
The following attestation bundles were made for augint_library-1.22.1.tar.gz:
Publisher:
pipeline.yaml on svange/augint-library
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
augint_library-1.22.1.tar.gz -
Subject digest:
085f2893d310ff6ff22302799c53a49ba524ef6fb7b1f7c4a010226b28cf7c78 - Sigstore transparency entry: 286950303
- Sigstore integration time:
-
Permalink:
svange/augint-library@ae88120417868b784fa7dd0690ecf335f8047356 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/svange
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pipeline.yaml@ae88120417868b784fa7dd0690ecf335f8047356 -
Trigger Event:
push
-
Statement type:
File details
Details for the file augint_library-1.22.1-py3-none-any.whl.
File metadata
- Download URL: augint_library-1.22.1-py3-none-any.whl
- Upload date:
- Size: 29.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd5780da03d27d3c4ec3264dcd3d29b7638fd102f39c2ef7b2612c727f3e13cf
|
|
| MD5 |
cb76bcd8e139d151261997a75c07631a
|
|
| BLAKE2b-256 |
ccb9aba5b56b694e2a50fba1fd68ee99223f51c7185d874ee824757ce070f796
|
Provenance
The following attestation bundles were made for augint_library-1.22.1-py3-none-any.whl:
Publisher:
pipeline.yaml on svange/augint-library
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
augint_library-1.22.1-py3-none-any.whl -
Subject digest:
bd5780da03d27d3c4ec3264dcd3d29b7638fd102f39c2ef7b2612c727f3e13cf - Sigstore transparency entry: 286950324
- Sigstore integration time:
-
Permalink:
svange/augint-library@ae88120417868b784fa7dd0690ecf335f8047356 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/svange
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pipeline.yaml@ae88120417868b784fa7dd0690ecf335f8047356 -
Trigger Event:
push
-
Statement type: