swarmauri_storage_github_release 0.3.0.dev38__py3-none-any.whl → 0.11.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,7 +19,9 @@ from github import Github, UnknownObjectException
19
19
 
20
20
  @ComponentBase.register_type(StorageAdapterBase, "GithubReleaseStorageAdapter")
21
21
  class GithubReleaseStorageAdapter(StorageAdapterBase):
22
- """Storage adapter that uses GitHub Releases to store and retrieve assets."""
22
+ """
23
+ Storage adapter that uses GitHub Releases to store and retrieve assets.
24
+ """
23
25
 
24
26
  def __init__(
25
27
  self,
@@ -36,11 +38,13 @@ class GithubReleaseStorageAdapter(StorageAdapterBase):
36
38
  **kwargs,
37
39
  ) -> None:
38
40
  super().__init__(**kwargs)
39
- token_val = token.get_secret_value() if isinstance(token, SecretStr) else token
41
+ token_val = (
42
+ token.get_secret_value() if isinstance(token, SecretStr) else token
43
+ )
40
44
  self._client = Github(token_val)
41
45
  self._repo = self._client.get_organization(org).get_repo(repo)
42
46
  self._tag = tag
43
- self._prefix = prefix.lstrip("/")
47
+ self._prefix = self.normalize_prefix(prefix)
44
48
  self._release = self._get_or_create_release(
45
49
  tag=tag,
46
50
  name=release_name or tag,
@@ -51,10 +55,7 @@ class GithubReleaseStorageAdapter(StorageAdapterBase):
51
55
 
52
56
  # ----------------------------------------------------------------- helpers
53
57
  def _full_key(self, key: str) -> str:
54
- key = key.lstrip("/")
55
- if self._prefix:
56
- return f"{self._prefix.rstrip('/')}/{key}"
57
- return key
58
+ return self.compose_key(self._prefix, key, allow_empty=True)
58
59
 
59
60
  @property
60
61
  def root_uri(self) -> str:
@@ -82,9 +83,12 @@ class GithubReleaseStorageAdapter(StorageAdapterBase):
82
83
  prerelease=prerelease,
83
84
  )
84
85
 
85
- # ------------------------------------------------------------------- public
86
+ # -------------------------------------------------------------------
87
+ # public
86
88
  def upload(self, key: str, data: BinaryIO) -> str:
87
- """Upload ``data`` under ``key`` as a release asset and return the artifact URI."""
89
+ """Upload ``data`` under ``key`` as a release asset and return the
90
+ artifact URI."""
91
+ normalized_key = self.normalize_key(key)
88
92
  key = self._full_key(key)
89
93
 
90
94
  data.seek(0)
@@ -95,12 +99,15 @@ class GithubReleaseStorageAdapter(StorageAdapterBase):
95
99
  asset.delete_asset()
96
100
  break
97
101
 
98
- with tempfile.NamedTemporaryFile() as tmp:
102
+ with tempfile.NamedTemporaryFile(delete=False) as tmp:
99
103
  tmp.write(content)
100
- tmp.flush()
101
- self._release.upload_asset(path=tmp.name, name=key, label=key)
104
+ tmp_path = tmp.name
105
+ try:
106
+ self._release.upload_asset(path=tmp_path, name=key, label=key)
107
+ finally:
108
+ Path(tmp_path).unlink(missing_ok=True)
102
109
 
103
- return f"{self.root_uri}{key.lstrip('/')}"
110
+ return f"{self.root_uri}{normalized_key}"
104
111
 
105
112
  def download(self, key: str) -> BinaryIO:
106
113
  """Return the bytes of asset ``key`` as a BytesIO object."""
@@ -116,16 +123,19 @@ class GithubReleaseStorageAdapter(StorageAdapterBase):
116
123
  buf = io.BytesIO(raw)
117
124
  buf.seek(0)
118
125
  return buf
119
- raise FileNotFoundError(f"Asset '{key}' not found in release '{self._tag}'")
126
+ raise FileNotFoundError(
127
+ f"Asset '{key}' not found in release '{self._tag}'"
128
+ )
120
129
 
121
- # --------------------------------------------------------------- convenience
130
+ # ---------------------------------------------------------------
131
+ # convenience
122
132
  def upload_dir(self, src: str | os.PathLike, *, prefix: str = "") -> None:
123
133
  """Upload all files under *src* using an optional *prefix*."""
124
134
  base = Path(src)
125
135
  for path in base.rglob("*"):
126
136
  if path.is_file():
127
137
  rel = path.relative_to(base).as_posix()
128
- key = f"{prefix.rstrip('/')}/{rel}" if prefix else rel
138
+ key = self.compose_key(prefix, rel)
129
139
  with path.open("rb") as fh:
130
140
  self.upload(key, fh)
131
141
 
@@ -136,14 +146,16 @@ class GithubReleaseStorageAdapter(StorageAdapterBase):
136
146
  name = asset.name
137
147
  if name.startswith(full.rstrip("/")):
138
148
  key = name
139
- if self._prefix and key.startswith(self._prefix.rstrip("/") + "/"):
149
+ if self._prefix and key.startswith(
150
+ self._prefix.rstrip("/") + "/"
151
+ ):
140
152
  key = key[len(self._prefix.rstrip("/")) + 1 :]
141
153
  yield key
142
154
 
143
155
  def download_dir(self, prefix: str, dest_dir: str | os.PathLike) -> None:
144
156
  """Download all assets under *prefix* into *dest_dir*."""
145
157
  dest = Path(dest_dir)
146
- base = prefix.strip("/")
158
+ base = self.normalize_prefix(prefix)
147
159
  for rel_key in self.iter_prefix(prefix):
148
160
  rel = rel_key
149
161
  if base:
@@ -154,7 +166,7 @@ class GithubReleaseStorageAdapter(StorageAdapterBase):
154
166
  )
155
167
  if not rel:
156
168
  continue
157
- target = dest / rel
169
+ target = self.download_target_for_key(dest, rel)
158
170
  target.parent.mkdir(parents=True, exist_ok=True)
159
171
  data = self.download(rel_key)
160
172
  with target.open("wb") as fh:
@@ -168,7 +180,8 @@ class GithubReleaseStorageAdapter(StorageAdapterBase):
168
180
  asset.delete_asset()
169
181
  return
170
182
 
171
- # --------------------------------------------------------------------- class
183
+ # ---------------------------------------------------------------------
184
+ # class
172
185
  @classmethod
173
186
  def from_uri(
174
187
  cls,
@@ -0,0 +1,448 @@
1
+ Metadata-Version: 2.4
2
+ Name: swarmauri_storage_github_release
3
+ Version: 0.11.0
4
+ Summary: GitHub Release storage adapter for Peagen
5
+ License-Expression: Apache-2.0
6
+ License-File: LICENSE
7
+ License-File: NOTICE
8
+ Keywords: swarmauri,sdk,standards,storage,github,release
9
+ Author: Jacob Stewart
10
+ Author-email: jacob@swarmauri.com
11
+ Requires-Python: >=3.10,<3.15
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
21
+ Requires-Dist: PyGithub
22
+ Requires-Dist: swarmauri_base
23
+ Requires-Dist: swarmauri_core
24
+ Requires-Dist: swarmauri_standard
25
+ Description-Content-Type: text/markdown
26
+
27
+ # swarmauri_storage_github_release
28
+
29
+ <!-- readme-standards:begin branding -->
30
+ <p align="center"><a href="https://github.com/swarmauri/swarmauri-sdk"><img src="https://raw.githubusercontent.com/swarmauri/swarmauri-sdk/master/assets/swarmauri.brand.theme.svg" alt="Swarmauri SDK" width="300"></a></p>
31
+ <p align="center"><strong>swarmauri_storage_github_release</strong></p>
32
+ <p align="center">GitHub Release storage adapter for Peagen</p>
33
+ <p align="center">
34
+ <a href="https://pypi.org/project/swarmauri_storage_github_release/"><img alt="pypi: swarmauri_storage_github_release" src="https://img.shields.io/pypi/v/swarmauri_storage_github_release?labelColor=1E293B&amp;color=1D4ED8"></a>
35
+ <a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/pyproject.toml"><img alt="Source version: 0.11.0" src="https://img.shields.io/static/v1?label=Source%20version&amp;message=0.11.0&amp;labelColor=1E293B&amp;color=4338CA"></a>
36
+ <a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/pyproject.toml"><img alt="Python: &gt;=3.10,&lt;3.15" src="https://img.shields.io/static/v1?label=Python&amp;message=%3E%3D3.10%2C%3C3.15&amp;labelColor=1E293B&amp;color=0F766E"></a>
37
+ <a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/pyproject.toml"><img alt="Layer: standards" src="https://img.shields.io/static/v1?label=Layer&amp;message=standards&amp;labelColor=1E293B&amp;color=6D28D9"></a>
38
+ <a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/README.md#lifecycle-and-migration"><img alt="Lifecycle: active" src="https://img.shields.io/static/v1?label=Lifecycle&amp;message=active&amp;labelColor=1E293B&amp;color=166534"></a>
39
+ <a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/LICENSE"><img alt="License: Apache-2.0" src="https://img.shields.io/static/v1?label=License&amp;message=Apache-2.0&amp;labelColor=1E293B&amp;color=86198F"></a>
40
+ <a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/NOTICE"><img alt="Notice: attribution" src="https://img.shields.io/static/v1?label=Notice&amp;message=attribution&amp;labelColor=1E293B&amp;color=86198F"></a>
41
+ </p>
42
+ <p align="center">
43
+ <a href="https://pypi.org/project/swarmauri_storage_github_release/"><img alt="Monthly PyPI downloads: swarmauri_storage_github_release" src="https://img.shields.io/pypi/dm/swarmauri_storage_github_release?labelColor=1E293B&amp;color=0E7490"></a>
44
+ <a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/README.md"><img alt="README hits: swarmauri_storage_github_release" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/pkgs/40-standards/swarmauri_storage_github_release/README.md.svg?label=README%20hits&amp;labelColor=1E293B&amp;color=0E7490"></a>
45
+ </p>
46
+ <p align="center">
47
+ <a href="https://github.com/swarmauri/swarmauri-sdk/actions/workflows/readme-standards.yml"><img alt="README standards: CI gate" src="https://img.shields.io/static/v1?label=README%20standards&amp;message=CI%20gate&amp;labelColor=1E293B&amp;color=1D4ED8"></a>
48
+ <a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/tests/unit/test_readme_sources.py"><img alt="Tests: example source" src="https://img.shields.io/static/v1?label=Tests&amp;message=example%20source&amp;labelColor=1E293B&amp;color=0F766E"></a>
49
+ <a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/README.md#certification-status"><img alt="Certification: not certified" src="https://img.shields.io/static/v1?label=Certification&amp;message=not%20certified&amp;labelColor=1E293B&amp;color=92400E"></a>
50
+ <a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/tools/readme/POLICY.md"><img alt="Governance: repository policy" src="https://img.shields.io/static/v1?label=Governance&amp;message=repository%20policy&amp;labelColor=1E293B&amp;color=4338CA"></a>
51
+ <a href="https://github.com/swarmauri/swarmauri-sdk/actions/workflows/readme-standards.yml"><img alt="Evidence: source and CI" src="https://img.shields.io/static/v1?label=Evidence&amp;message=source%20and%20CI&amp;labelColor=1E293B&amp;color=6D28D9"></a>
52
+ </p>
53
+ <p align="center"><a href="#overview">Overview</a> · <a href="#installation">Installation</a> · <a href="#quick-start">Quick Start</a> · <a href="#usage">Usage</a> · <a href="#public-api-and-import-surfaces">API</a> · <a href="#contributing">Contributing</a> · <a href="#governance">Governance</a> · <a href="#license">License</a></p>
54
+ <!-- readme-standards:end branding -->
55
+
56
+ ---
57
+
58
+ ## Overview
59
+
60
+ ### Summary
61
+
62
+ Stores and retrieves artifacts as assets on a GitHub release. The adapter is
63
+ designed to plug directly into the Swarmauri/Peagen storage interfaces while
64
+ still being usable as a standalone utility.
65
+
66
+ ### Why This Package
67
+
68
+ `swarmauri_storage_github_release` isolates this responsibility: GitHub Release storage adapter for Peagen. Its [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/swarmauri_storage_github_release/gh_release_storage_adapter.py) exposes `GithubReleaseStorageAdapter`, allowing consumers to select this package without treating adjacent packages as part of its public contract.
69
+
70
+ ### When to Use
71
+
72
+ Choose `swarmauri_storage_github_release` when your integration needs gitHub Release storage adapter for Peagen. Match the imports below to your application boundary and install its declared dependencies before using the example.
73
+
74
+ ### Features
75
+
76
+ - **Automatic release management** ? a release is created on-demand when the
77
+ requested tag does not already exist.
78
+ - **`ghrel://` addressing** ? the adapter exposes a `root_uri` and returns
79
+ fully-qualified URIs (e.g. `ghrel://org/repo/tag/path`) from `upload` calls.
80
+ - **Prefix-aware paths** ? supply an optional `prefix` to group related assets
81
+ underneath a pseudo-directory on the release.
82
+ - **Bulk helpers** ? use `upload_dir` and `download_dir` to synchronise entire
83
+ directories, or `iter_prefix` to discover stored assets.
84
+ - **Configuration friendly** ? `GithubReleaseStorageAdapter.from_uri` reads
85
+ credentials from the `GITHUB_TOKEN` environment variable for simple
86
+ environment-driven configuration in workflows.
87
+
88
+ ### Non-Goals
89
+
90
+ `swarmauri_storage_github_release` owns gitHub Release storage adapter for Peagen. Its imports do not by themselves configure credentials, deploy a service, or certify the behavior of its consumers. Dependencies and neighboring packages retain their own documented responsibilities.
91
+
92
+ ---
93
+
94
+ ## Getting Started
95
+
96
+ ### Prerequisites
97
+
98
+ - A GitHub personal access token (PAT) or GitHub App token with sufficient
99
+ permissions to view, create and manage releases on the target repository.
100
+ - Network access to the GitHub REST API (provided by `PyGithub`).
101
+ - Python 3.10 through 3.14.
102
+
103
+ ### Installation
104
+
105
+ **Install uv (optional)**
106
+
107
+ ```bash
108
+ curl -LsSf https://astral.sh/uv/install.sh | sh
109
+ ```
110
+
111
+ **Add the package with uv**
112
+
113
+ ```bash
114
+ uv add swarmauri_storage_github_release
115
+ ```
116
+
117
+ **Add with Poetry**
118
+
119
+ ```bash
120
+ poetry add swarmauri_storage_github_release
121
+ ```
122
+
123
+ **Install with pip**
124
+
125
+ ```bash
126
+ pip install swarmauri_storage_github_release
127
+ ```
128
+
129
+ #### uv
130
+
131
+ <!-- readme-standards:begin installation.uv -->
132
+ ```bash
133
+ uv add swarmauri_storage_github_release
134
+ ```
135
+ <!-- readme-standards:end installation.uv -->
136
+
137
+ #### pip
138
+
139
+ <!-- readme-standards:begin installation.pip -->
140
+ ```bash
141
+ python -m pip install swarmauri_storage_github_release
142
+ ```
143
+ <!-- readme-standards:end installation.pip -->
144
+
145
+ #### Poetry
146
+
147
+ <!-- readme-standards:begin installation.poetry -->
148
+ ```bash
149
+ poetry add swarmauri_storage_github_release
150
+ ```
151
+ <!-- readme-standards:end installation.poetry -->
152
+
153
+ ### Quick Start
154
+
155
+ #### Example
156
+
157
+ <!-- readme-standards:begin example.quick-start -->
158
+ Source: [docs/readme/quick_start.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/docs/readme/quick_start.py).
159
+
160
+ ```python
161
+ from io import BytesIO
162
+
163
+ from pydantic import SecretStr
164
+
165
+ from swarmauri_storage_github_release import GithubReleaseStorageAdapter
166
+
167
+ adapter = GithubReleaseStorageAdapter(
168
+ token=SecretStr("ghp_example-token"),
169
+ org="example-org",
170
+ repo="example-repo",
171
+ tag="v1.0.0",
172
+ prefix="artifacts",
173
+ release_name="Example release",
174
+ message="Artifacts published by our workflow.",
175
+ )
176
+
177
+ print(adapter.root_uri)
178
+
179
+ uri = adapter.upload("artifact.txt", BytesIO(b"important payload"))
180
+ downloaded_payload = adapter.download("artifact.txt").read()
181
+ assets = list(adapter.iter_prefix(""))
182
+
183
+ print(uri)
184
+ print(downloaded_payload)
185
+ print(assets)
186
+ ```
187
+ <!-- readme-standards:end example.quick-start -->
188
+
189
+ #### Expected Result
190
+
191
+ The example demonstrates the documented `swarmauri_storage_github_release` source boundary or workflow. Complete its required configuration first. README CI checks the maintained source’s syntax and declarations; it does not claim that external services or the application workflow were exercised.
192
+
193
+ ---
194
+
195
+ ## Usage
196
+
197
+ ### Common Workflows
198
+
199
+ <!-- readme-standards:begin example.usage -->
200
+ Source: [docs/readme/usage.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/docs/readme/usage.py).
201
+
202
+ ```python
203
+ from io import BytesIO
204
+
205
+ from pydantic import SecretStr
206
+
207
+ from swarmauri_storage_github_release import GithubReleaseStorageAdapter
208
+
209
+ adapter = GithubReleaseStorageAdapter(
210
+ token=SecretStr("ghp_example-token"),
211
+ org="example-org",
212
+ repo="example-repo",
213
+ tag="v1.0.0",
214
+ prefix="artifacts",
215
+ release_name="Example release",
216
+ message="Artifacts published by our workflow.",
217
+ )
218
+
219
+ print(adapter.root_uri)
220
+
221
+ uri = adapter.upload("artifact.txt", BytesIO(b"important payload"))
222
+ downloaded_payload = adapter.download("artifact.txt").read()
223
+ assets = list(adapter.iter_prefix(""))
224
+
225
+ print(uri)
226
+ print(downloaded_payload)
227
+ print(assets)
228
+ ```
229
+ <!-- readme-standards:end example.usage -->
230
+
231
+ The code above demonstrates:
232
+
233
+ - `SecretStr` support for securely passing tokens.
234
+ - Automatic release creation when the `v1.0.0` tag does not exist.
235
+ - Prefix-aware uploads that produce the URI
236
+ `ghrel://example-org/example-repo/v1.0.0/artifacts/artifacts/artifact.txt`
237
+ (the asset key itself contains the prefix, so it appears in the base URI and
238
+ the returned asset key).
239
+ - Round-tripping an asset and enumerating stored keys via `iter_prefix`.
240
+
241
+ ### Configuration
242
+
243
+ Configure `swarmauri_storage_github_release` through the APIs in [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/swarmauri_storage_github_release/gh_release_storage_adapter.py); its [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/pyproject.toml) describes installation requirements, not an implicit service configuration. No additional package-global configuration contract is inferred from dependencies.
244
+
245
+ ### Error Handling
246
+
247
+ The inspected `swarmauri_storage_github_release` source raises `FileNotFoundError`. Handle these at the calling boundary and consult the implementation for the triggering conditions.
248
+
249
+ ### Best Practices
250
+
251
+ Use the explicit `swarmauri_storage_github_release` imports documented below and keep collaborator configuration with the caller. Run the package’s relevant tests after changing `GithubReleaseStorageAdapter`; an import or successful installation alone does not establish its runtime guarantees.
252
+
253
+ ---
254
+
255
+ ## Package Boundary
256
+
257
+ ### What It Owns
258
+
259
+ `swarmauri_storage_github_release` is located in `standards` and owns gitHub Release storage adapter for Peagen. Source-declared APIs include `GithubReleaseStorageAdapter`. The [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/pyproject.toml) records its direct dependency boundary.
260
+
261
+ ### Public API and Import Surfaces
262
+
263
+ Import namespace: `swarmauri_storage_github_release`.
264
+
265
+ Source-declared exports or types: `GithubReleaseStorageAdapter`.
266
+
267
+ Inspect [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/swarmauri_storage_github_release/gh_release_storage_adapter.py) for exact signatures; this inventory does not designate every internal module as stable.
268
+
269
+ ### Entry Points
270
+
271
+ <!-- readme-standards:begin entry-points -->
272
+ - `peagen.plugins.storage_adapters` → `gh_release` → `swarmauri_storage_github_release.gh_release_storage_adapter:GithubReleaseStorageAdapter`
273
+ - `swarmauri.storage_adapters` → `GithubReleaseStorageAdapter` → `swarmauri_storage_github_release.gh_release_storage_adapter:GithubReleaseStorageAdapter`
274
+ <!-- readme-standards:end entry-points -->
275
+
276
+ ### Injected Dependencies
277
+
278
+ The direct installation dependencies of `swarmauri_storage_github_release` are `pygithub`, `swarmauri-core`, `swarmauri-base`, `swarmauri-standard`. These declarations do not imply automatic provider selection. Pass collaborators through the explicit constructors or call signatures in [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/swarmauri_storage_github_release/gh_release_storage_adapter.py).
279
+
280
+ ### Protocol Consumers
281
+
282
+ No direct package-manifest dependency on `swarmauri_storage_github_release` was found in the audited three-repository inventory. External consumers may still use its documented imports or commands.
283
+
284
+ ### Extensions
285
+
286
+ For `swarmauri_storage_github_release`, use the source-declared public interfaces (`GithubReleaseStorageAdapter`) when composing or extending behavior. Its entry-point section below is authoritative for registered plugins; no additional extension loader is inferred from the package name.
287
+
288
+ ---
289
+
290
+ ## Operations and Readiness
291
+
292
+ ### Operational Requirements
293
+
294
+ Operate `swarmauri_storage_github_release` according to its actual entry points and collaborators. The dependency and Python requirements in the [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/pyproject.toml) are prerequisites; deployment topology, credentials, and readiness remain the responsibility of the consuming application unless explicitly documented above.
295
+
296
+ ### Health and Observability
297
+
298
+ This README does not establish a standalone health endpoint for `swarmauri_storage_github_release`. Observe the concrete caller’s results, exceptions, and existing test reports. An application that embeds this package must define its own health and telemetry contract.
299
+
300
+ ### Security and Resource Limits
301
+
302
+ Apply the input, credential, and resource constraints implemented in [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/swarmauri_storage_github_release/gh_release_storage_adapter.py). The `swarmauri_storage_github_release` README gate is a documentation check, not a security review or a substitute for the implementation’s limits and caller authorization.
303
+
304
+ ### Compatibility
305
+
306
+ This source version of `swarmauri_storage_github_release` declares Python `>=3.10,<3.15`. Consult its dependency constraints before upgrading. Source-version and registry-version badges have separate meanings; this migration makes no additional platform or interoperability certification claim.
307
+
308
+ ---
309
+
310
+ ## Verification
311
+
312
+ ### Tests
313
+
314
+ Run `python -m pytest tests/unit/test_readme_sources.py` from the `swarmauri_storage_github_release` package directory for the maintained example source checks (Python compilation and non-Python file presence). Existing package tests include:
315
+
316
+ - [tests/i9n/test_i9n__init__.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/tests/i9n/test_i9n__init__.py)
317
+ - [tests/unit/test_github_release_storage_adapter.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/tests/unit/test_github_release_storage_adapter.py)
318
+ - [tests/unit/test_readme_example.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/tests/unit/test_readme_example.py)
319
+
320
+ The repository README gate also checks the required heading tree, metadata, managed fragments, and referenced files.
321
+
322
+ ### Certification Status
323
+
324
+ No external certification is asserted for `swarmauri_storage_github_release` by this documentation migration. README conformance, example syntax, runtime tests, and protocol or security certification are distinct evidence scopes.
325
+
326
+ ### Evidence
327
+
328
+ The [README standards CI](https://github.com/swarmauri/swarmauri-sdk/actions/workflows/readme-standards.yml) records mechanical documentation results for its tested commit. The [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/swarmauri_storage_github_release/gh_release_storage_adapter.py) and example sources support the package-boundary description; external runtime behavior requires its own test evidence.
329
+
330
+ ---
331
+
332
+ ## FAQ
333
+
334
+ ### Why
335
+
336
+ **Why select this package?** `swarmauri_storage_github_release` provides gitHub Release storage adapter for Peagen; use its own API boundary rather than assuming neighboring packages are bundled or configured automatically.
337
+
338
+ ### How
339
+
340
+ **How do I start?** Install or synchronize the environment under Getting Started, follow the maintained example for `swarmauri_storage_github_release`, and consult [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/swarmauri_storage_github_release/gh_release_storage_adapter.py) for the exact types and signatures involved.
341
+
342
+ ### When
343
+
344
+ **When should I validate an upgrade?** Recheck `swarmauri_storage_github_release` whenever its source version, declared collaborators, configuration, or caller changes. Run relevant behavioral tests in addition to the README gate before promotion.
345
+
346
+ ---
347
+
348
+ ## Documentation and Related Packages
349
+
350
+ ### More Documentation
351
+
352
+ The [repository contribution guide](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md), [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/swarmauri_storage_github_release/gh_release_storage_adapter.py), and [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/pyproject.toml) provide the supporting context for `swarmauri_storage_github_release`. The [README policy](https://github.com/groupsum/readme-standards/blob/master/docs/outline.md) defines the common document structure.
353
+
354
+ ### Related Packages
355
+
356
+ - [swarmauri_base](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/20-bases/swarmauri_base/README.md): Reusable Swarmauri base classes, mixins, and dynamic Pydantic component models for composable intelligence infrastructure.
357
+ - [swarmauri_core](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/10-interfaces/swarmauri_core/README.md): Core interface contracts and shared types for Swarmauri composable intelligence infrastructure components.
358
+ - [swarmauri_standard](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/30-standard-kernel/swarmauri_standard/README.md): First-party Swarmauri standard components for agents, tools, parsers, vectors, model adapters, and composable intelligence workflows.
359
+
360
+ ### Project Links
361
+
362
+ <!-- readme-standards:begin project-links -->
363
+ - [pypi: swarmauri_storage_github_release](https://pypi.org/project/swarmauri_storage_github_release/)
364
+ <!-- readme-standards:end project-links -->
365
+
366
+ ---
367
+
368
+ ## Contributing
369
+
370
+ ### How to Contribute
371
+
372
+ If you want to contribute to swarmauri-sdk, read up on our
373
+ [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md)
374
+ that will help you get started.
375
+
376
+ ### Development Setup
377
+
378
+ Work from the `pkgs/40-standards/swarmauri_storage_github_release` checkout. Synchronize its declared development environment with uv, then run the relevant package tests and `python -m pytest tests/unit/test_readme_sources.py`. The repository’s dedicated README job installs `readme-standards==0.1.3` without resolving unrelated runtime packages.
379
+
380
+ ### Notes for Maintainers
381
+
382
+ **Working with directories**
383
+
384
+ Use the bulk helper methods to synchronise entire directory trees:
385
+
386
+ ```python
387
+ adapter.upload_dir("dist", prefix="binaries")
388
+ adapter.download_dir("binaries", "./downloads")
389
+ ```
390
+
391
+ Both helpers respect the adapter-level prefix and will mirror nested folders.
392
+
393
+ **Using ghrel:// URIs and configuration**
394
+
395
+ The `from_uri` class method creates adapters from an address such as:
396
+
397
+ ```python
398
+ adapter = GithubReleaseStorageAdapter.from_uri(
399
+ "ghrel://example-org/example-repo/v1.0.0/artifacts",
400
+ )
401
+ ```
402
+
403
+ When invoked this way the adapter builds an unauthenticated client
404
+ (`token=""`).
405
+
406
+ Any prefix encoded in the URI is respected, and the resulting instance exposes
407
+ the same API shown above. For private repositories or higher rate limits,
408
+ instantiate the adapter directly and provide a token.
409
+
410
+ **Controlling release metadata**
411
+
412
+ The constructor accepts additional keyword arguments to fine tune release
413
+ creation, including `release_name`, `message`, `draft`, and `prerelease`. These
414
+ parameters map directly to GitHub's release settings, allowing you to reuse the
415
+ adapter for production, staging, or nightly build workflows.
416
+
417
+ ---
418
+
419
+ ## Governance
420
+
421
+ ### Ownership and Decision Making
422
+
423
+ Changes to `swarmauri_storage_github_release` follow the maintainer review process of [swarmauri/swarmauri-sdk](https://github.com/swarmauri/swarmauri-sdk) and its contribution guide. Author attribution remains in the [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/pyproject.toml); this README does not assign new publishing or administrative authority.
424
+
425
+ ### Standards and Policies
426
+
427
+ `swarmauri_storage_github_release` follows the versioned [package-guide-v1 outline](https://github.com/groupsum/readme-standards/blob/master/docs/outline.md). All fixed headings, hierarchy, order, separators, and package-specific branding are checked by CI; reviewers assess the accuracy and usefulness of authored claims.
428
+
429
+ ### Lifecycle and Migration
430
+
431
+ The `swarmauri_storage_github_release` source version is `0.11.0`.
432
+
433
+ ---
434
+
435
+ ## License and Attribution
436
+
437
+ ### License
438
+
439
+ <!-- readme-standards:begin license -->
440
+ Licensed under `Apache-2.0`. See [LICENSE](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/LICENSE).
441
+ <!-- readme-standards:end license -->
442
+
443
+ ### Notices
444
+
445
+ <!-- readme-standards:begin notices -->
446
+ See [NOTICE](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_github_release/NOTICE) for attribution.
447
+ <!-- readme-standards:end notices -->
448
+
@@ -0,0 +1,8 @@
1
+ swarmauri_storage_github_release/__init__.py,sha256=zVY7XpMAyATHsPoIlF2Uhvu3jIWYXjxhYQoZV9P7OGY,470
2
+ swarmauri_storage_github_release/gh_release_storage_adapter.py,sha256=EYLLLvQopd1Nf25LLcgAm7wHeJdXd6-k4LF_ds_FgPs,6692
3
+ swarmauri_storage_github_release-0.11.0.dist-info/METADATA,sha256=gKLKPxp-Fnn_vYmImw5rWxT88pPzfNWcgFZ7pxISykU,24084
4
+ swarmauri_storage_github_release-0.11.0.dist-info/WHEEL,sha256=L-WvLdSBvJWHXv5zrQxDvNRnIgoBzLUpcbuiw19KCuQ,88
5
+ swarmauri_storage_github_release-0.11.0.dist-info/entry_points.txt,sha256=6d91NDUup0HedFEyI0MOA6PJiSTZMJ5xA9IvE9p5w8k,280
6
+ swarmauri_storage_github_release-0.11.0.dist-info/licenses/LICENSE,sha256=djUXOlCxLVszShEpZXshZ7v33G-2qIC_j9KXpWKZSzQ,11359
7
+ swarmauri_storage_github_release-0.11.0.dist-info/licenses/NOTICE,sha256=Tw1MAmYvK7TbdEagwL0CLMbCcIREzQgt7fSeG9tlTlM,212
8
+ swarmauri_storage_github_release-0.11.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.3.1
2
+ Generator: poetry-core 2.5.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -0,0 +1,7 @@
1
+ swarmauri_storage_github_release
2
+
3
+ Distribution: swarmauri_storage_github_release
4
+ Repository: https://github.com/swarmauri/swarmauri-sdk
5
+
6
+ Author attribution: Jacob Stewart.
7
+ Licensed under Apache-2.0; see LICENSE.
@@ -1,175 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: swarmauri_storage_github_release
3
- Version: 0.3.0.dev38
4
- Summary: GitHub Release storage adapter for Peagen
5
- License-Expression: Apache-2.0
6
- License-File: LICENSE
7
- Keywords: swarmauri,sdk,standards,storage,github,release
8
- Author: Jacob Stewart
9
- Author-email: jacob@swarmauri.com
10
- Requires-Python: >=3.10,<3.13
11
- Classifier: License :: OSI Approved :: Apache Software License
12
- Classifier: Programming Language :: Python :: 3
13
- Classifier: Programming Language :: Python :: 3.10
14
- Classifier: Programming Language :: Python :: 3.11
15
- Classifier: Programming Language :: Python :: 3.12
16
- Classifier: Operating System :: OS Independent
17
- Classifier: Programming Language :: Python
18
- Classifier: Programming Language :: Python :: 3 :: Only
19
- Requires-Dist: PyGithub
20
- Requires-Dist: swarmauri_base
21
- Requires-Dist: swarmauri_core
22
- Requires-Dist: swarmauri_standard
23
- Description-Content-Type: text/markdown
24
-
25
- ![Swarmauri Logo](https://github.com/swarmauri/swarmauri-sdk/blob/3d4d1cfa949399d7019ae9d8f296afba773dfb7f/assets/swarmauri.brand.theme.svg)
26
-
27
- <p align="center">
28
- <a href="https://pypi.org/project/swarmauri_storage_github_release/">
29
- <img src="https://img.shields.io/pypi/dm/swarmauri_storage_github_release" alt="PyPI - Downloads"/></a>
30
- <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_storage_github_release/">
31
- <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_storage_github_release.svg"/></a>
32
- <a href="https://pypi.org/project/swarmauri_storage_github_release/">
33
- <img src="https://img.shields.io/pypi/pyversions/swarmauri_storage_github_release" alt="PyPI - Python Version"/></a>
34
- <a href="https://pypi.org/project/swarmauri_storage_github_release/">
35
- <img src="https://img.shields.io/pypi/l/swarmauri_storage_github_release" alt="PyPI - License"/></a>
36
- <a href="https://pypi.org/project/swarmauri_storage_github_release/">
37
- <img src="https://img.shields.io/pypi/v/swarmauri_storage_github_release?label=swarmauri_storage_github_release&color=green" alt="PyPI - swarmauri_storage_github_release"/></a>
38
-
39
- </p>
40
-
41
- ---
42
-
43
- # Swarmauri GitHub Release Storage Adapter
44
-
45
- Stores and retrieves artifacts as assets on a GitHub release. The adapter is
46
- designed to plug directly into the Swarmauri/Peagen storage interfaces while
47
- still being usable as a standalone utility.
48
-
49
- ## Features
50
-
51
- - **Automatic release management** – a release is created on-demand when the
52
- requested tag does not already exist.
53
- - **`ghrel://` addressing** – the adapter exposes a `root_uri` and returns
54
- fully-qualified URIs (e.g. `ghrel://org/repo/tag/path`) from `upload` calls.
55
- - **Prefix-aware paths** – supply an optional `prefix` to group related assets
56
- underneath a pseudo-directory on the release.
57
- - **Bulk helpers** – use `upload_dir` and `download_dir` to synchronise entire
58
- directories, or `iter_prefix` to discover stored assets.
59
- - **Configuration friendly** – `GithubReleaseStorageAdapter.from_uri` reads
60
- credentials from the `GITHUB_TOKEN` environment variable for simple
61
- environment-driven configuration in workflows.
62
-
63
- ## Requirements
64
-
65
- - A GitHub personal access token (PAT) or GitHub App token with sufficient
66
- permissions to view, create and manage releases on the target repository.
67
- - Network access to the GitHub REST API (provided by `PyGithub`).
68
- - Python 3.10 through 3.12.
69
-
70
- ## Installation
71
-
72
- ### Install uv (optional)
73
-
74
- ```bash
75
- curl -LsSf https://astral.sh/uv/install.sh | sh
76
- ```
77
-
78
- ### Add the package with uv
79
-
80
- ```bash
81
- uv add swarmauri_storage_github_release
82
- ```
83
-
84
- ### Add with Poetry
85
-
86
- ```bash
87
- poetry add swarmauri_storage_github_release
88
- ```
89
-
90
- ### Install with pip
91
-
92
- ```bash
93
- pip install swarmauri_storage_github_release
94
- ```
95
-
96
- ## Usage
97
-
98
- ```python
99
- from io import BytesIO
100
-
101
- from pydantic import SecretStr
102
-
103
- from swarmauri_storage_github_release import GithubReleaseStorageAdapter
104
-
105
- adapter = GithubReleaseStorageAdapter(
106
- token=SecretStr("ghp_example-token"),
107
- org="example-org",
108
- repo="example-repo",
109
- tag="v1.0.0",
110
- prefix="artifacts",
111
- release_name="Example release",
112
- message="Artifacts published by our workflow.",
113
- )
114
-
115
- print(adapter.root_uri)
116
-
117
- uri = adapter.upload("artifact.txt", BytesIO(b"important payload"))
118
- downloaded_payload = adapter.download("artifact.txt").read()
119
- assets = list(adapter.iter_prefix(""))
120
-
121
- print(uri)
122
- print(downloaded_payload)
123
- print(assets)
124
- ```
125
-
126
- The code above demonstrates:
127
-
128
- - `SecretStr` support for securely passing tokens.
129
- - Automatic release creation when the `v1.0.0` tag does not exist.
130
- - Prefix-aware uploads that produce the URI
131
- `ghrel://example-org/example-repo/v1.0.0/artifacts/artifacts/artifact.txt`
132
- (the asset key itself contains the prefix, so it appears in the base URI and
133
- the returned asset key).
134
- - Round-tripping an asset and enumerating stored keys via `iter_prefix`.
135
-
136
- ## Working with directories
137
-
138
- Use the bulk helper methods to synchronise entire directory trees:
139
-
140
- ```python
141
- adapter.upload_dir("dist", prefix="binaries")
142
- adapter.download_dir("binaries", "./downloads")
143
- ```
144
-
145
- Both helpers respect the adapter-level prefix and will mirror nested folders.
146
-
147
- ## Using `ghrel://` URIs and configuration
148
-
149
- The `from_uri` class method creates adapters from an address such as:
150
-
151
- ```python
152
- adapter = GithubReleaseStorageAdapter.from_uri(
153
- "ghrel://example-org/example-repo/v1.0.0/artifacts",
154
- )
155
- ```
156
-
157
- When invoked this way the adapter builds an unauthenticated client
158
- (`token=""`).
159
-
160
- Any prefix encoded in the URI is respected, and the resulting instance exposes
161
- the same API shown above. For private repositories or higher rate limits,
162
- instantiate the adapter directly and provide a token.
163
-
164
- ### Controlling release metadata
165
-
166
- The constructor accepts additional keyword arguments to fine tune release
167
- creation, including `release_name`, `message`, `draft`, and `prerelease`. These
168
- parameters map directly to GitHub's release settings, allowing you to reuse the
169
- adapter for production, staging, or nightly build workflows.
170
-
171
- ## Want to help?
172
-
173
- If you want to contribute to swarmauri-sdk, read up on our
174
- [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md)
175
- that will help you get started.
@@ -1,7 +0,0 @@
1
- swarmauri_storage_github_release/__init__.py,sha256=zVY7XpMAyATHsPoIlF2Uhvu3jIWYXjxhYQoZV9P7OGY,470
2
- swarmauri_storage_github_release/gh_release_storage_adapter.py,sha256=sd-JL0_XhNAeAbjSFgqILz2lN8wthnGYnROG7Fv9U_Y,6450
3
- swarmauri_storage_github_release-0.3.0.dev38.dist-info/METADATA,sha256=Kj5uvVDzv6t9GY4ntCR6veaad5e3H0YnM8yl_44wS0s,6246
4
- swarmauri_storage_github_release-0.3.0.dev38.dist-info/WHEEL,sha256=kJCRJT_g0adfAJzTx2GUMmS80rTJIVHRCfG0DQgLq3o,88
5
- swarmauri_storage_github_release-0.3.0.dev38.dist-info/entry_points.txt,sha256=6d91NDUup0HedFEyI0MOA6PJiSTZMJ5xA9IvE9p5w8k,280
6
- swarmauri_storage_github_release-0.3.0.dev38.dist-info/licenses/LICENSE,sha256=djUXOlCxLVszShEpZXshZ7v33G-2qIC_j9KXpWKZSzQ,11359
7
- swarmauri_storage_github_release-0.3.0.dev38.dist-info/RECORD,,