This release is a pre-release and may not be stable for production use.
Swarmauri Git Filter GitHub Release
Store artifacts in GitHub Releases.
Overview
swarmauri_gitfilter_gh_release provides the GithubReleaseFilter, a StorageAdapter and GitFilter hybrid that manages Peagen artifacts as assets attached to a GitHub Release. It:
- Connects to the configured organization, repository, and release tag using PyGithub.
- Creates the release on-demand if it does not already exist.
- Normalizes object keys with an optional prefix, exposing the release contents as a virtual directory via
root_uri. - Uploads and replaces release assets atomically, allowing you to store binary artifacts without worrying about duplicates.
- Supports directory workflows with
upload_dir,iter_prefix, anddownload_prefixhelpers for batch operations.
Authentication & configuration
The filter authenticates using a GitHub token sourced from your .peagen.toml or the GITHUB_TOKEN environment variable. The token needs permissions to read and write releases in the target repository.
Example .peagen.toml snippet:
[storage.filters.gh_release]
token = "$GITHUB_TOKEN"
You can also set the environment variable directly:
export GITHUB_TOKEN="ghp_..."
Installation
pip
pip install swarmauri_gitfilter_gh_release
uv
curl -Ls https://astral.sh/uv/install.sh | sh
uv pip install swarmauri_gitfilter_gh_release
Poetry
poetry add swarmauri_gitfilter_gh_release
Usage
from swarmauri_gitfilter_gh_release import GithubReleaseFilter
filt = GithubReleaseFilter.from_uri("ghrel://org/repo/tag/artifacts")
print(filt.root_uri)
The example above resolves the release (creating it if necessary) and prints the normalized root URI (ghrel://org/repo/tag/artifacts/).
Managing artifacts
GithubReleaseFilter mirrors GitHub release assets onto local paths. Each method accepts keys relative to the virtual root defined by the release tag and optional prefix:
upload(key, data)uploads a file-like object and replaces existing assets that share the same key.download(key)streams a release asset back as aBytesIOobject for inspection or local persistence.upload_dir(path, prefix="")walks a directory tree and pushes each file into the release using the provided prefix.iter_prefix(prefix)yields keys that start with the supplied prefix, allowing selective sync logic.download_prefix(prefix, dest_dir)restores a tree of assets into a target directory on disk.
Combine these helpers to move trained models, prompts, or configuration bundles between local development and persistent release storage while keeping file layouts consistent.
Want to help?
If you want to contribute to swarmauri-sdk, read up on our guidelines for contributing that will help you get started.
Metadata
Release files for swarmauri_gitfilter_gh_release 0.11.0.dev1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| swarmauri_gitfilter_gh_release-0.11.0.dev1.tar.gz | 8.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| swarmauri_gitfilter_gh_release-0.11.0.dev1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.8 kB
Release files / swarmauri_gitfilter_gh_release-0.11.0.dev1.tar.gz
| Download URL | swarmauri_gitfilter_gh_release-0.11.0.dev1.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3a5b18fa83ebb7099354b9575806c0cccbdd5748646bc7b1abf494c5082940ce
|
|
BLAKE2b-256 checksum How to use checksums |
f7c34e90a2499d1e7de1d8d73d0d85732cff3d85b08e3525b3dde4db2ea50278
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / swarmauri_gitfilter_gh_release-0.11.0.dev1-py3-none-any.whl
| Download URL | swarmauri_gitfilter_gh_release-0.11.0.dev1-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7f7673baa60b0be1b99d3a8093c17c920e7b3005cba596e4335631563b405478
|
|
BLAKE2b-256 checksum How to use checksums |
2c9d430a990d0b4b415b949169d5102b4c2768b6d74925d33f636724e8251a35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|