A template library for Python library projects using Poetry and Semantic Release.
Project description
Augmenting Integrations Library Template Repository
📚 Project Resources
| 📖 Current Documentation | 🧪 Test report for last release |
|---|
Pre-requisites
Install Poetry, AWS CLI, and SAM CLI
Google it and follow the instructions for your platform.
Secret Management
Install chezmoi and age
winget install twpayne.chezmoi
winget install --id FiloSottile.age
Don't forget to setup chezmoi to use age for encryption and github for remote storage.
Set up your AWS OIDC provider (once per account)
Run this once per AWS account (safe to re-run; will no-op if it exists):
aws iam create-open-id-connect-provider `
--url https://token.actions.githubusercontent.com `
--client-id-list sts.amazonaws.com
⚡ Getting Started
Very important: Grab your PyPi and TestPyPi names right away, they may not be available later!
Configure Trusted Publisher on PyPI and TestPyPI
- Go to PyPI Trusted Publishers
- Click Add a trusted publisher, link this repo, and authorize publishing from
main - Repeat on TestPyPI Trusted Publishers for
dev
Bootstrap your project
Run the bootstrap script to set up your project:
# Complete setup (creates .env and AWS resources)
python bootstrap.py setup
# Or run steps individually:
python bootstrap.py init # Create .env file
python bootstrap.py aws # Set up AWS pipeline resources and fix trust policy
The bootstrap script will:
- Auto-detect your GitHub info from git remote
- Create a
.envfile with all required variables - Run
sam pipeline bootstrapand capture the generated ARNs - Automatically fix the trust policy for GitHub Actions OIDC
Manual setup steps
-
Fill in your GitHub token in
.env -
Save your .env file to chezmoi:
chezmoi add .env chezmoi git add . chezmoi git commit -- -am "Add .env file for your-repo-name"
-
Replace template names:
- Search and replace
augint-library→ your project name - Search and replace
augint_library→ your module name - Rename directory:
src/augint_library→src/<your_module_name> - Clear contents of
CHANGELOG.md - Set version to
0.0.0inpyproject.toml
- Search and replace
-
Initialize development environment:
poetry install poetry lock pre-commit install pre-commit install --install-hooks pre-commit run --all-files
-
Push secrets to GitHub:
ai-gh-push
-
Push your repo! Don't for get to set your repository's branch protection rules to require a successful run of the pipeline before merging PRs.
-
To use Claude Code remember to have this in your environment one way or another:
$env:CLAUDE_CODE_GIT_BASH_PATH="C:\Program Files\Git\bin\bash.exe"
📝 Documentation Style Guide
This template uses pdoc for automatic API documentation generation. Follow these patterns for optimal documentation:
Docstring Style: Google Format
def function_name(param1: str, param2: int = 0) -> bool:
"""Brief description of what the function does.
Longer description if needed. Can span multiple lines
and include implementation details.
Args:
param1: Description of param1.
param2: Description of param2 (default: 0).
Returns:
Description of return value.
Raises:
ValueError: Description of when this is raised.
Example:
>>> function_name("test", 42)
True
"""
CLI vs Library Documentation
1. Use __all__ to control API surface
# Only show library functions in docs
__all__ = ["public_function", "AnotherClass"]
2. Module organization
"""Module docstring explaining both library and CLI usage.
Library usage:
>>> from mymodule import public_function
>>> public_function("arg")
CLI usage:
$ my-command arg
"""
3. CLI function documentation
@click.command()
def cli_command():
"""CLI entry point - not for direct import.
Note:
This function is excluded from public API.
Use the installed CLI command instead.
"""
Template Patterns
For CLI-heavy projects:
- Put CLI commands in separate module (e.g.,
cli/commands.py) - Use
__all__to hide CLI internals - Document CLI usage in module docstrings
For library-heavy projects:
- Focus on public API documentation
- Use extensive examples in docstrings
- Group related functions in modules
Helpful Commands
# "source" an .env file in PowerShell
get-content .env | foreach {
$name, $value = $_.split('=')
if ([string]::IsNullOrWhiteSpace($name) -or $name.Contains('#')) {
# skip empty or comment line in ENV file
return
}
set-content env:\$name $value
}
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.10.0.tar.gz.
File metadata
- Download URL: augint_library-1.10.0.tar.gz
- Upload date:
- Size: 31.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96d59dbb413db41d0da90f1809ddf54199cc3a51017f751f7ca6a8e8b79e65e2
|
|
| MD5 |
c61370c1e49ab2dde9bd7a1d5b363982
|
|
| BLAKE2b-256 |
bb89a4d6c985bfe169e3cb08c722e2e426998285fc51d17916a6c42623a3c795
|
Provenance
The following attestation bundles were made for augint_library-1.10.0.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.10.0.tar.gz -
Subject digest:
96d59dbb413db41d0da90f1809ddf54199cc3a51017f751f7ca6a8e8b79e65e2 - Sigstore transparency entry: 283257536
- Sigstore integration time:
-
Permalink:
svange/augint-library@f264324987e1575ad2529b8c32e2033ce04c1cf1 -
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@f264324987e1575ad2529b8c32e2033ce04c1cf1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file augint_library-1.10.0-py3-none-any.whl.
File metadata
- Download URL: augint_library-1.10.0-py3-none-any.whl
- Upload date:
- Size: 29.5 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 |
930f0f89aefececd08696f6095f483a6d04ca6091d961736e3b496531737d0e8
|
|
| MD5 |
88cd1560bc8401a3bd669aa9c41464f2
|
|
| BLAKE2b-256 |
c7575567e1bf529e7623c6b4c296cedcdea9db1d21209700778ee01ca9778970
|
Provenance
The following attestation bundles were made for augint_library-1.10.0-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.10.0-py3-none-any.whl -
Subject digest:
930f0f89aefececd08696f6095f483a6d04ca6091d961736e3b496531737d0e8 - Sigstore transparency entry: 283257576
- Sigstore integration time:
-
Permalink:
svange/augint-library@f264324987e1575ad2529b8c32e2033ce04c1cf1 -
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@f264324987e1575ad2529b8c32e2033ce04c1cf1 -
Trigger Event:
push
-
Statement type: