swarmauri_storage_memory 0.1.0.dev29__tar.gz → 0.11.0__tar.gz

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.
@@ -0,0 +1,7 @@
1
+ swarmauri_storage_memory
2
+
3
+ Distribution: swarmauri_storage_memory
4
+ Repository: https://github.com/swarmauri/swarmauri-sdk
5
+
6
+ Author attribution: Jacob Stewart.
7
+ Licensed under Apache-2.0; see LICENSE.
@@ -0,0 +1,362 @@
1
+ Metadata-Version: 2.4
2
+ Name: swarmauri_storage_memory
3
+ Version: 0.11.0
4
+ Summary: In-memory storage adapter for SwarmauriSDK
5
+ License-Expression: Apache-2.0
6
+ License-File: LICENSE
7
+ License-File: NOTICE
8
+ Keywords: swarmauri,sdk,standards,storage,memory,in-memory,adapter
9
+ Author: Jacob Stewart
10
+ Author-email: jacob@swarmauri.com
11
+ Requires-Python: >=3.10,<3.15
12
+ Classifier: Development Status :: 1 - Planning
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
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_memory
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_memory</strong></p>
32
+ <p align="center">In-memory storage adapter for SwarmauriSDK</p>
33
+ <p align="center">
34
+ <a href="https://pypi.org/project/swarmauri_storage_memory/"><img alt="pypi: swarmauri_storage_memory" src="https://img.shields.io/pypi/v/swarmauri_storage_memory?labelColor=1E293B&amp;color=1D4ED8"></a>
35
+ <a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/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_memory/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_memory/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_memory/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_memory/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_memory/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_memory/"><img alt="Monthly PyPI downloads: swarmauri_storage_memory" src="https://img.shields.io/pypi/dm/swarmauri_storage_memory?labelColor=1E293B&amp;color=0E7490"></a>
44
+ <a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/README.md"><img alt="README hits: swarmauri_storage_memory" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/pkgs/40-standards/swarmauri_storage_memory/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_memory/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_memory/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
+ In-memory storage adapter for SwarmauriSDK workflows. This adapter is ideal for
63
+ unit tests, demos, or short-lived workloads where you want to avoid persistent
64
+ storage and rely entirely on process memory.
65
+
66
+ ### Why This Package
67
+
68
+ `swarmauri_storage_memory` isolates this responsibility: In-memory storage adapter for SwarmauriSDK. Its [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/swarmauri_storage_memory/__init__.py) exposes `MemoryStorageAdapter`, 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_memory` when your integration needs in-memory storage adapter for SwarmauriSDK. Match the imports below to your application boundary and install its declared dependencies before using the example.
73
+
74
+ ### Features
75
+
76
+ - Keeps uploaded artifacts in an in-memory dictionary for fast access.
77
+ - Supports optional key prefixes to scope uploads and downloads.
78
+ - Provides helper methods for bulk upload/download operations.
79
+ - Emits ``memory://`` URIs so downstream components can trace stored artifacts.
80
+ - Supports Python 3.10 through 3.14.
81
+
82
+ ### Non-Goals
83
+
84
+ `swarmauri_storage_memory` owns in-memory storage adapter for SwarmauriSDK. 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.
85
+
86
+ ---
87
+
88
+ ## Getting Started
89
+
90
+ ### Prerequisites
91
+
92
+ Python `>=3.10,<3.15` is required. The [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/pyproject.toml) declares runtime dependencies including `swarmauri-core`, `swarmauri-base`, `swarmauri-standard`. Read the example’s inputs and service requirements before execution.
93
+
94
+ ### Installation
95
+
96
+ Install the package with your preferred Python packaging tool:
97
+
98
+ ```bash
99
+ uv pip install swarmauri_storage_memory
100
+ ```
101
+
102
+ ```bash
103
+ pip install swarmauri_storage_memory
104
+ ```
105
+
106
+ #### uv
107
+
108
+ <!-- readme-standards:begin installation.uv -->
109
+ ```bash
110
+ uv add swarmauri_storage_memory
111
+ ```
112
+ <!-- readme-standards:end installation.uv -->
113
+
114
+ #### pip
115
+
116
+ <!-- readme-standards:begin installation.pip -->
117
+ ```bash
118
+ python -m pip install swarmauri_storage_memory
119
+ ```
120
+ <!-- readme-standards:end installation.pip -->
121
+
122
+ #### Poetry
123
+
124
+ <!-- readme-standards:begin installation.poetry -->
125
+ ```bash
126
+ poetry add swarmauri_storage_memory
127
+ ```
128
+ <!-- readme-standards:end installation.poetry -->
129
+
130
+ ### Quick Start
131
+
132
+ #### Example
133
+
134
+ <!-- readme-standards:begin example.quick-start -->
135
+ Source: [docs/readme/quick_start.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/docs/readme/quick_start.py).
136
+
137
+ ```python
138
+ import io
139
+
140
+ from swarmauri_storage_memory import MemoryStorageAdapter
141
+
142
+ adapter = MemoryStorageAdapter(prefix="session")
143
+
144
+ uri = adapter.upload("example.txt", io.BytesIO(b"hello"))
145
+ print("Stored at:", uri)
146
+
147
+ downloaded = adapter.download("example.txt").read().decode("utf-8")
148
+ print("Contents:", downloaded)
149
+
150
+ keys = list(adapter.iter_prefix(""))
151
+ print("Keys:", keys)
152
+ ```
153
+ <!-- readme-standards:end example.quick-start -->
154
+
155
+ #### Expected Result
156
+
157
+ The example demonstrates the documented `swarmauri_storage_memory` 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.
158
+
159
+ ---
160
+
161
+ ## Usage
162
+
163
+ ### Common Workflows
164
+
165
+ <!-- readme-standards:begin example.usage -->
166
+ Source: [docs/readme/usage.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/docs/readme/usage.py).
167
+
168
+ ```python
169
+ import io
170
+
171
+ from swarmauri_storage_memory import MemoryStorageAdapter
172
+
173
+ adapter = MemoryStorageAdapter(prefix="session")
174
+
175
+ uri = adapter.upload("example.txt", io.BytesIO(b"hello"))
176
+ print("Stored at:", uri)
177
+
178
+ downloaded = adapter.download("example.txt").read().decode("utf-8")
179
+ print("Contents:", downloaded)
180
+
181
+ keys = list(adapter.iter_prefix(""))
182
+ print("Keys:", keys)
183
+ ```
184
+ <!-- readme-standards:end example.usage -->
185
+
186
+ The adapter above stores data purely in memory, making it suitable for
187
+ lightweight or ephemeral workflows. Use ``upload_dir`` and ``download_dir`` for
188
+ bulk transfers when you need to stage many artifacts in memory at once.
189
+
190
+ ### Configuration
191
+
192
+ Configure `swarmauri_storage_memory` through the APIs in [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/swarmauri_storage_memory/__init__.py); its [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/pyproject.toml) describes installation requirements, not an implicit service configuration. No additional package-global configuration contract is inferred from dependencies.
193
+
194
+ ### Error Handling
195
+
196
+ The inspected `swarmauri_storage_memory` source raises `FileNotFoundError`. Handle these at the calling boundary and consult the implementation for the triggering conditions.
197
+
198
+ ### Best Practices
199
+
200
+ Use the explicit `swarmauri_storage_memory` imports documented below and keep collaborator configuration with the caller. Run the package’s relevant tests after changing `MemoryStorageAdapter`; an import or successful installation alone does not establish its runtime guarantees.
201
+
202
+ ---
203
+
204
+ ## Package Boundary
205
+
206
+ ### What It Owns
207
+
208
+ `swarmauri_storage_memory` is located in `standards` and owns in-memory storage adapter for SwarmauriSDK. Source-declared APIs include `MemoryStorageAdapter`. The [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/pyproject.toml) records its direct dependency boundary.
209
+
210
+ ### Public API and Import Surfaces
211
+
212
+ Import namespace: `swarmauri_storage_memory`.
213
+
214
+ Source-declared exports or types: `MemoryStorageAdapter`.
215
+
216
+ Inspect [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/swarmauri_storage_memory/__init__.py) for exact signatures; this inventory does not designate every internal module as stable.
217
+
218
+ ### Entry Points
219
+
220
+ <!-- readme-standards:begin entry-points -->
221
+ - `peagen.plugins.storage_adapters` → `memory` → `swarmauri_storage_memory.memory_storage_adapter:MemoryStorageAdapter`
222
+ - `swarmauri.storage_adapters` → `MemoryStorageAdapter` → `swarmauri_storage_memory.memory_storage_adapter:MemoryStorageAdapter`
223
+ <!-- readme-standards:end entry-points -->
224
+
225
+ ### Injected Dependencies
226
+
227
+ The direct installation dependencies of `swarmauri_storage_memory` are `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_memory/swarmauri_storage_memory/__init__.py).
228
+
229
+ ### Protocol Consumers
230
+
231
+ No direct package-manifest dependency on `swarmauri_storage_memory` was found in the audited three-repository inventory. External consumers may still use its documented imports or commands.
232
+
233
+ ### Extensions
234
+
235
+ For `swarmauri_storage_memory`, use the source-declared public interfaces (`MemoryStorageAdapter`) 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.
236
+
237
+ ---
238
+
239
+ ## Operations and Readiness
240
+
241
+ ### Operational Requirements
242
+
243
+ Operate `swarmauri_storage_memory` 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_memory/pyproject.toml) are prerequisites; deployment topology, credentials, and readiness remain the responsibility of the consuming application unless explicitly documented above.
244
+
245
+ ### Health and Observability
246
+
247
+ This README does not establish a standalone health endpoint for `swarmauri_storage_memory`. 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.
248
+
249
+ ### Security and Resource Limits
250
+
251
+ Apply the input, credential, and resource constraints implemented in [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/swarmauri_storage_memory/__init__.py). The `swarmauri_storage_memory` README gate is a documentation check, not a security review or a substitute for the implementation’s limits and caller authorization.
252
+
253
+ ### Compatibility
254
+
255
+ This source version of `swarmauri_storage_memory` 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.
256
+
257
+ ---
258
+
259
+ ## Verification
260
+
261
+ ### Tests
262
+
263
+ Run `python -m pytest tests/unit/test_readme_sources.py` from the `swarmauri_storage_memory` package directory for the maintained example source checks (Python compilation and non-Python file presence). Existing package tests include:
264
+
265
+ - [tests/unit/test_memory_storage_adapter.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/tests/unit/test_memory_storage_adapter.py)
266
+
267
+ The repository README gate also checks the required heading tree, metadata, managed fragments, and referenced files.
268
+
269
+ ### Certification Status
270
+
271
+ No external certification is asserted for `swarmauri_storage_memory` by this documentation migration. README conformance, example syntax, runtime tests, and protocol or security certification are distinct evidence scopes.
272
+
273
+ ### Evidence
274
+
275
+ 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_memory/swarmauri_storage_memory/__init__.py) and example sources support the package-boundary description; external runtime behavior requires its own test evidence.
276
+
277
+ ---
278
+
279
+ ## FAQ
280
+
281
+ ### Why
282
+
283
+ **Why select this package?** `swarmauri_storage_memory` provides in-memory storage adapter for SwarmauriSDK; use its own API boundary rather than assuming neighboring packages are bundled or configured automatically.
284
+
285
+ ### How
286
+
287
+ **How do I start?** Install or synchronize the environment under Getting Started, follow the maintained example for `swarmauri_storage_memory`, and consult [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/swarmauri_storage_memory/__init__.py) for the exact types and signatures involved.
288
+
289
+ ### When
290
+
291
+ **When should I validate an upgrade?** Recheck `swarmauri_storage_memory` whenever its source version, declared collaborators, configuration, or caller changes. Run relevant behavioral tests in addition to the README gate before promotion.
292
+
293
+ ---
294
+
295
+ ## Documentation and Related Packages
296
+
297
+ ### More Documentation
298
+
299
+ 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_memory/swarmauri_storage_memory/__init__.py), and [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/pyproject.toml) provide the supporting context for `swarmauri_storage_memory`. The [README policy](https://github.com/groupsum/readme-standards/blob/master/docs/outline.md) defines the common document structure.
300
+
301
+ ### Related Packages
302
+
303
+ - [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.
304
+ - [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.
305
+ - [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.
306
+
307
+ ### Project Links
308
+
309
+ <!-- readme-standards:begin project-links -->
310
+ - [pypi: swarmauri_storage_memory](https://pypi.org/project/swarmauri_storage_memory/)
311
+ <!-- readme-standards:end project-links -->
312
+
313
+ ---
314
+
315
+ ## Contributing
316
+
317
+ ### How to Contribute
318
+
319
+ If you want to contribute to swarmauri-sdk, read up on our
320
+ [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md)
321
+ that will help you get started.
322
+
323
+ ### Development Setup
324
+
325
+ Work from the `pkgs/40-standards/swarmauri_storage_memory` 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.
326
+
327
+ ### Notes for Maintainers
328
+
329
+ Edit authored prose directly in this `swarmauri_storage_memory` README. Update source examples in `docs/readme/`, then run `readme-standards render --root . --write` from the package directory and review the diff. Required headings and generated blocks come from package-guide-v1.
330
+
331
+ ---
332
+
333
+ ## Governance
334
+
335
+ ### Ownership and Decision Making
336
+
337
+ Changes to `swarmauri_storage_memory` 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_memory/pyproject.toml); this README does not assign new publishing or administrative authority.
338
+
339
+ ### Standards and Policies
340
+
341
+ `swarmauri_storage_memory` 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.
342
+
343
+ ### Lifecycle and Migration
344
+
345
+ The `swarmauri_storage_memory` source version is `0.11.0`.
346
+
347
+ ---
348
+
349
+ ## License and Attribution
350
+
351
+ ### License
352
+
353
+ <!-- readme-standards:begin license -->
354
+ Licensed under `Apache-2.0`. See [LICENSE](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/LICENSE).
355
+ <!-- readme-standards:end license -->
356
+
357
+ ### Notices
358
+
359
+ <!-- readme-standards:begin notices -->
360
+ See [NOTICE](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/NOTICE) for attribution.
361
+ <!-- readme-standards:end notices -->
362
+
@@ -0,0 +1,335 @@
1
+ # swarmauri_storage_memory
2
+
3
+ <!-- readme-standards:begin branding -->
4
+ <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>
5
+ <p align="center"><strong>swarmauri_storage_memory</strong></p>
6
+ <p align="center">In-memory storage adapter for SwarmauriSDK</p>
7
+ <p align="center">
8
+ <a href="https://pypi.org/project/swarmauri_storage_memory/"><img alt="pypi: swarmauri_storage_memory" src="https://img.shields.io/pypi/v/swarmauri_storage_memory?labelColor=1E293B&amp;color=1D4ED8"></a>
9
+ <a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/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>
10
+ <a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/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>
11
+ <a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/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>
12
+ <a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/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>
13
+ <a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/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>
14
+ <a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/NOTICE"><img alt="Notice: attribution" src="https://img.shields.io/static/v1?label=Notice&amp;message=attribution&amp;labelColor=1E293B&amp;color=86198F"></a>
15
+ </p>
16
+ <p align="center">
17
+ <a href="https://pypi.org/project/swarmauri_storage_memory/"><img alt="Monthly PyPI downloads: swarmauri_storage_memory" src="https://img.shields.io/pypi/dm/swarmauri_storage_memory?labelColor=1E293B&amp;color=0E7490"></a>
18
+ <a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/README.md"><img alt="README hits: swarmauri_storage_memory" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/pkgs/40-standards/swarmauri_storage_memory/README.md.svg?label=README%20hits&amp;labelColor=1E293B&amp;color=0E7490"></a>
19
+ </p>
20
+ <p align="center">
21
+ <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>
22
+ <a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/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>
23
+ <a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/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>
24
+ <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>
25
+ <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>
26
+ </p>
27
+ <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>
28
+ <!-- readme-standards:end branding -->
29
+
30
+ ---
31
+
32
+ ## Overview
33
+
34
+ ### Summary
35
+
36
+ In-memory storage adapter for SwarmauriSDK workflows. This adapter is ideal for
37
+ unit tests, demos, or short-lived workloads where you want to avoid persistent
38
+ storage and rely entirely on process memory.
39
+
40
+ ### Why This Package
41
+
42
+ `swarmauri_storage_memory` isolates this responsibility: In-memory storage adapter for SwarmauriSDK. Its [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/swarmauri_storage_memory/__init__.py) exposes `MemoryStorageAdapter`, allowing consumers to select this package without treating adjacent packages as part of its public contract.
43
+
44
+ ### When to Use
45
+
46
+ Choose `swarmauri_storage_memory` when your integration needs in-memory storage adapter for SwarmauriSDK. Match the imports below to your application boundary and install its declared dependencies before using the example.
47
+
48
+ ### Features
49
+
50
+ - Keeps uploaded artifacts in an in-memory dictionary for fast access.
51
+ - Supports optional key prefixes to scope uploads and downloads.
52
+ - Provides helper methods for bulk upload/download operations.
53
+ - Emits ``memory://`` URIs so downstream components can trace stored artifacts.
54
+ - Supports Python 3.10 through 3.14.
55
+
56
+ ### Non-Goals
57
+
58
+ `swarmauri_storage_memory` owns in-memory storage adapter for SwarmauriSDK. 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.
59
+
60
+ ---
61
+
62
+ ## Getting Started
63
+
64
+ ### Prerequisites
65
+
66
+ Python `>=3.10,<3.15` is required. The [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/pyproject.toml) declares runtime dependencies including `swarmauri-core`, `swarmauri-base`, `swarmauri-standard`. Read the example’s inputs and service requirements before execution.
67
+
68
+ ### Installation
69
+
70
+ Install the package with your preferred Python packaging tool:
71
+
72
+ ```bash
73
+ uv pip install swarmauri_storage_memory
74
+ ```
75
+
76
+ ```bash
77
+ pip install swarmauri_storage_memory
78
+ ```
79
+
80
+ #### uv
81
+
82
+ <!-- readme-standards:begin installation.uv -->
83
+ ```bash
84
+ uv add swarmauri_storage_memory
85
+ ```
86
+ <!-- readme-standards:end installation.uv -->
87
+
88
+ #### pip
89
+
90
+ <!-- readme-standards:begin installation.pip -->
91
+ ```bash
92
+ python -m pip install swarmauri_storage_memory
93
+ ```
94
+ <!-- readme-standards:end installation.pip -->
95
+
96
+ #### Poetry
97
+
98
+ <!-- readme-standards:begin installation.poetry -->
99
+ ```bash
100
+ poetry add swarmauri_storage_memory
101
+ ```
102
+ <!-- readme-standards:end installation.poetry -->
103
+
104
+ ### Quick Start
105
+
106
+ #### Example
107
+
108
+ <!-- readme-standards:begin example.quick-start -->
109
+ Source: [docs/readme/quick_start.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/docs/readme/quick_start.py).
110
+
111
+ ```python
112
+ import io
113
+
114
+ from swarmauri_storage_memory import MemoryStorageAdapter
115
+
116
+ adapter = MemoryStorageAdapter(prefix="session")
117
+
118
+ uri = adapter.upload("example.txt", io.BytesIO(b"hello"))
119
+ print("Stored at:", uri)
120
+
121
+ downloaded = adapter.download("example.txt").read().decode("utf-8")
122
+ print("Contents:", downloaded)
123
+
124
+ keys = list(adapter.iter_prefix(""))
125
+ print("Keys:", keys)
126
+ ```
127
+ <!-- readme-standards:end example.quick-start -->
128
+
129
+ #### Expected Result
130
+
131
+ The example demonstrates the documented `swarmauri_storage_memory` 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.
132
+
133
+ ---
134
+
135
+ ## Usage
136
+
137
+ ### Common Workflows
138
+
139
+ <!-- readme-standards:begin example.usage -->
140
+ Source: [docs/readme/usage.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/docs/readme/usage.py).
141
+
142
+ ```python
143
+ import io
144
+
145
+ from swarmauri_storage_memory import MemoryStorageAdapter
146
+
147
+ adapter = MemoryStorageAdapter(prefix="session")
148
+
149
+ uri = adapter.upload("example.txt", io.BytesIO(b"hello"))
150
+ print("Stored at:", uri)
151
+
152
+ downloaded = adapter.download("example.txt").read().decode("utf-8")
153
+ print("Contents:", downloaded)
154
+
155
+ keys = list(adapter.iter_prefix(""))
156
+ print("Keys:", keys)
157
+ ```
158
+ <!-- readme-standards:end example.usage -->
159
+
160
+ The adapter above stores data purely in memory, making it suitable for
161
+ lightweight or ephemeral workflows. Use ``upload_dir`` and ``download_dir`` for
162
+ bulk transfers when you need to stage many artifacts in memory at once.
163
+
164
+ ### Configuration
165
+
166
+ Configure `swarmauri_storage_memory` through the APIs in [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/swarmauri_storage_memory/__init__.py); its [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/pyproject.toml) describes installation requirements, not an implicit service configuration. No additional package-global configuration contract is inferred from dependencies.
167
+
168
+ ### Error Handling
169
+
170
+ The inspected `swarmauri_storage_memory` source raises `FileNotFoundError`. Handle these at the calling boundary and consult the implementation for the triggering conditions.
171
+
172
+ ### Best Practices
173
+
174
+ Use the explicit `swarmauri_storage_memory` imports documented below and keep collaborator configuration with the caller. Run the package’s relevant tests after changing `MemoryStorageAdapter`; an import or successful installation alone does not establish its runtime guarantees.
175
+
176
+ ---
177
+
178
+ ## Package Boundary
179
+
180
+ ### What It Owns
181
+
182
+ `swarmauri_storage_memory` is located in `standards` and owns in-memory storage adapter for SwarmauriSDK. Source-declared APIs include `MemoryStorageAdapter`. The [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/pyproject.toml) records its direct dependency boundary.
183
+
184
+ ### Public API and Import Surfaces
185
+
186
+ Import namespace: `swarmauri_storage_memory`.
187
+
188
+ Source-declared exports or types: `MemoryStorageAdapter`.
189
+
190
+ Inspect [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/swarmauri_storage_memory/__init__.py) for exact signatures; this inventory does not designate every internal module as stable.
191
+
192
+ ### Entry Points
193
+
194
+ <!-- readme-standards:begin entry-points -->
195
+ - `peagen.plugins.storage_adapters` → `memory` → `swarmauri_storage_memory.memory_storage_adapter:MemoryStorageAdapter`
196
+ - `swarmauri.storage_adapters` → `MemoryStorageAdapter` → `swarmauri_storage_memory.memory_storage_adapter:MemoryStorageAdapter`
197
+ <!-- readme-standards:end entry-points -->
198
+
199
+ ### Injected Dependencies
200
+
201
+ The direct installation dependencies of `swarmauri_storage_memory` are `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_memory/swarmauri_storage_memory/__init__.py).
202
+
203
+ ### Protocol Consumers
204
+
205
+ No direct package-manifest dependency on `swarmauri_storage_memory` was found in the audited three-repository inventory. External consumers may still use its documented imports or commands.
206
+
207
+ ### Extensions
208
+
209
+ For `swarmauri_storage_memory`, use the source-declared public interfaces (`MemoryStorageAdapter`) 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.
210
+
211
+ ---
212
+
213
+ ## Operations and Readiness
214
+
215
+ ### Operational Requirements
216
+
217
+ Operate `swarmauri_storage_memory` 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_memory/pyproject.toml) are prerequisites; deployment topology, credentials, and readiness remain the responsibility of the consuming application unless explicitly documented above.
218
+
219
+ ### Health and Observability
220
+
221
+ This README does not establish a standalone health endpoint for `swarmauri_storage_memory`. 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.
222
+
223
+ ### Security and Resource Limits
224
+
225
+ Apply the input, credential, and resource constraints implemented in [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/swarmauri_storage_memory/__init__.py). The `swarmauri_storage_memory` README gate is a documentation check, not a security review or a substitute for the implementation’s limits and caller authorization.
226
+
227
+ ### Compatibility
228
+
229
+ This source version of `swarmauri_storage_memory` 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.
230
+
231
+ ---
232
+
233
+ ## Verification
234
+
235
+ ### Tests
236
+
237
+ Run `python -m pytest tests/unit/test_readme_sources.py` from the `swarmauri_storage_memory` package directory for the maintained example source checks (Python compilation and non-Python file presence). Existing package tests include:
238
+
239
+ - [tests/unit/test_memory_storage_adapter.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/tests/unit/test_memory_storage_adapter.py)
240
+
241
+ The repository README gate also checks the required heading tree, metadata, managed fragments, and referenced files.
242
+
243
+ ### Certification Status
244
+
245
+ No external certification is asserted for `swarmauri_storage_memory` by this documentation migration. README conformance, example syntax, runtime tests, and protocol or security certification are distinct evidence scopes.
246
+
247
+ ### Evidence
248
+
249
+ 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_memory/swarmauri_storage_memory/__init__.py) and example sources support the package-boundary description; external runtime behavior requires its own test evidence.
250
+
251
+ ---
252
+
253
+ ## FAQ
254
+
255
+ ### Why
256
+
257
+ **Why select this package?** `swarmauri_storage_memory` provides in-memory storage adapter for SwarmauriSDK; use its own API boundary rather than assuming neighboring packages are bundled or configured automatically.
258
+
259
+ ### How
260
+
261
+ **How do I start?** Install or synchronize the environment under Getting Started, follow the maintained example for `swarmauri_storage_memory`, and consult [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/swarmauri_storage_memory/__init__.py) for the exact types and signatures involved.
262
+
263
+ ### When
264
+
265
+ **When should I validate an upgrade?** Recheck `swarmauri_storage_memory` whenever its source version, declared collaborators, configuration, or caller changes. Run relevant behavioral tests in addition to the README gate before promotion.
266
+
267
+ ---
268
+
269
+ ## Documentation and Related Packages
270
+
271
+ ### More Documentation
272
+
273
+ 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_memory/swarmauri_storage_memory/__init__.py), and [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/pyproject.toml) provide the supporting context for `swarmauri_storage_memory`. The [README policy](https://github.com/groupsum/readme-standards/blob/master/docs/outline.md) defines the common document structure.
274
+
275
+ ### Related Packages
276
+
277
+ - [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.
278
+ - [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.
279
+ - [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.
280
+
281
+ ### Project Links
282
+
283
+ <!-- readme-standards:begin project-links -->
284
+ - [pypi: swarmauri_storage_memory](https://pypi.org/project/swarmauri_storage_memory/)
285
+ <!-- readme-standards:end project-links -->
286
+
287
+ ---
288
+
289
+ ## Contributing
290
+
291
+ ### How to Contribute
292
+
293
+ If you want to contribute to swarmauri-sdk, read up on our
294
+ [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md)
295
+ that will help you get started.
296
+
297
+ ### Development Setup
298
+
299
+ Work from the `pkgs/40-standards/swarmauri_storage_memory` 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.
300
+
301
+ ### Notes for Maintainers
302
+
303
+ Edit authored prose directly in this `swarmauri_storage_memory` README. Update source examples in `docs/readme/`, then run `readme-standards render --root . --write` from the package directory and review the diff. Required headings and generated blocks come from package-guide-v1.
304
+
305
+ ---
306
+
307
+ ## Governance
308
+
309
+ ### Ownership and Decision Making
310
+
311
+ Changes to `swarmauri_storage_memory` 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_memory/pyproject.toml); this README does not assign new publishing or administrative authority.
312
+
313
+ ### Standards and Policies
314
+
315
+ `swarmauri_storage_memory` 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.
316
+
317
+ ### Lifecycle and Migration
318
+
319
+ The `swarmauri_storage_memory` source version is `0.11.0`.
320
+
321
+ ---
322
+
323
+ ## License and Attribution
324
+
325
+ ### License
326
+
327
+ <!-- readme-standards:begin license -->
328
+ Licensed under `Apache-2.0`. See [LICENSE](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/LICENSE).
329
+ <!-- readme-standards:end license -->
330
+
331
+ ### Notices
332
+
333
+ <!-- readme-standards:begin notices -->
334
+ See [NOTICE](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/NOTICE) for attribution.
335
+ <!-- readme-standards:end notices -->
@@ -1,24 +1,23 @@
1
1
  [project]
2
2
  name = "swarmauri_storage_memory"
3
- version = "0.1.0.dev29"
4
- authors = [
5
- { name = "Jacob Stewart", email = "jacob@swarmauri.com" }
6
- ]
3
+ version = "0.11.0"
4
+ authors = [{ name = "Jacob Stewart", email = "jacob@swarmauri.com" }]
7
5
  description = "In-memory storage adapter for SwarmauriSDK"
8
6
  readme = "README.md"
9
7
  license = "Apache-2.0"
10
8
  repository = "http://github.com/swarmauri/swarmauri-sdk"
11
- requires-python = ">=3.10,<3.13"
9
+ requires-python = ">=3.10,<3.15"
12
10
  classifiers = [
13
11
  "Development Status :: 1 - Planning",
14
- "License :: OSI Approved :: Apache Software License",
12
+ "Operating System :: OS Independent",
13
+ "Programming Language :: Python",
15
14
  "Programming Language :: Python :: 3",
15
+ "Programming Language :: Python :: 3 :: Only",
16
16
  "Programming Language :: Python :: 3.10",
17
17
  "Programming Language :: Python :: 3.11",
18
18
  "Programming Language :: Python :: 3.12",
19
- "Operating System :: OS Independent",
20
- "Programming Language :: Python",
21
- "Programming Language :: Python :: 3 :: Only",
19
+ "Programming Language :: Python :: 3.13",
20
+ "Programming Language :: Python :: 3.14",
22
21
  ]
23
22
  dependencies = [
24
23
  "swarmauri_core",
@@ -34,12 +33,61 @@ keywords = [
34
33
  "in-memory",
35
34
  "adapter",
36
35
  ]
36
+ license-files = ["LICENSE", "NOTICE"]
37
37
 
38
38
  [tool.uv.sources]
39
39
  swarmauri_core = { workspace = true }
40
40
  swarmauri_base = { workspace = true }
41
41
  swarmauri_standard = { workspace = true }
42
42
 
43
+ [tool.readme_standards]
44
+ policy = "package-guide-v1"
45
+ readme = "README.md"
46
+ brand = "swarmauri"
47
+ brand_catalog = "../../../tools/readme/brands.toml"
48
+ repository = "https://github.com/swarmauri/swarmauri-sdk"
49
+ ref = "master"
50
+ package_path = "pkgs/40-standards/swarmauri_storage_memory"
51
+ layer = "standards"
52
+ lifecycle = "active"
53
+ license_file = "LICENSE"
54
+ notice_file = "NOTICE"
55
+
56
+ [tool.readme_standards.distributions.pypi]
57
+ name = "swarmauri_storage_memory"
58
+ published = true
59
+
60
+ [tool.readme_standards.examples.quick_start]
61
+ source = "docs/readme/quick_start.py"
62
+ test = "tests/unit/test_readme_sources.py"
63
+ language = "python"
64
+ expected_exit_code = 0
65
+
66
+ [tool.readme_standards.examples.usage]
67
+ source = "docs/readme/usage.py"
68
+ test = "tests/unit/test_readme_sources.py"
69
+ language = "python"
70
+ expected_exit_code = 0
71
+
72
+ [tool.readme_standards.statuses.readme]
73
+ label = "CI gate"
74
+ url = "https://github.com/swarmauri/swarmauri-sdk/actions/workflows/readme-standards.yml"
75
+
76
+ [tool.readme_standards.statuses.tests]
77
+ label = "example source"
78
+ url = "https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/tests/unit/test_readme_sources.py"
79
+
80
+ [tool.readme_standards.statuses.certification]
81
+ label = "not certified"
82
+ url = "https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_storage_memory/README.md#certification-status"
83
+
84
+ [tool.readme_standards.statuses.governance]
85
+ label = "repository policy"
86
+ url = "https://github.com/swarmauri/swarmauri-sdk/blob/master/tools/readme/POLICY.md"
87
+
88
+ [tool.readme_standards.statuses.evidence]
89
+ label = "source and CI"
90
+ url = "https://github.com/swarmauri/swarmauri-sdk/actions/workflows/readme-standards.yml"
43
91
  [project.entry-points.'swarmauri.storage_adapters']
44
92
  MemoryStorageAdapter = "swarmauri_storage_memory.memory_storage_adapter:MemoryStorageAdapter"
45
93
 
@@ -78,9 +126,10 @@ dev = [
78
126
  "pytest-xdist>=3.6.1",
79
127
  "pytest-json-report>=1.5.0",
80
128
  "python-dotenv",
81
- "requests>=2.32.3",
129
+ "httpx>=0.27",
82
130
  "flake8>=7.0",
83
131
  "pytest-timeout>=2.3.1",
84
132
  "ruff>=0.9.9",
85
133
  "pytest-benchmark>=4.0.0",
134
+ "readme-standards==0.1.3; python_version >= \"3.11\"",
86
135
  ]
@@ -4,8 +4,9 @@ from __future__ import annotations
4
4
 
5
5
  import io
6
6
  import os
7
+ from collections.abc import Iterable
7
8
  from pathlib import Path
8
- from typing import BinaryIO, Iterable
9
+ from typing import BinaryIO
9
10
 
10
11
  from swarmauri_base.ComponentBase import ComponentBase
11
12
  from swarmauri_base.storage import StorageAdapterBase
@@ -17,14 +18,11 @@ class MemoryStorageAdapter(StorageAdapterBase):
17
18
 
18
19
  def __init__(self, *, prefix: str = "", **kwargs) -> None:
19
20
  super().__init__(**kwargs)
20
- self._prefix = prefix.lstrip("/")
21
+ self._prefix = self.normalize_prefix(prefix)
21
22
  self._store: dict[str, bytes] = {}
22
23
 
23
24
  def _full_key(self, key: str) -> str:
24
- key = key.lstrip("/")
25
- if self._prefix:
26
- return f"{self._prefix}/{key}" if key else self._prefix
27
- return key
25
+ return self.compose_key(self._prefix, key, allow_empty=True)
28
26
 
29
27
  @property
30
28
  def root_uri(self) -> str:
@@ -35,9 +33,10 @@ class MemoryStorageAdapter(StorageAdapterBase):
35
33
 
36
34
  def upload(self, key: str, data: BinaryIO) -> str:
37
35
  """Store *data* in memory and return the artifact URI."""
36
+ normalized_key = self.normalize_key(key)
38
37
  full_key = self._full_key(key)
39
38
  self._store[full_key] = data.read()
40
- return f"{self.root_uri}{key.lstrip('/')}"
39
+ return f"{self.root_uri}{normalized_key}"
41
40
 
42
41
  def download(self, key: str) -> BinaryIO:
43
42
  """Return a :class:`BytesIO` with the stored contents."""
@@ -54,7 +53,7 @@ class MemoryStorageAdapter(StorageAdapterBase):
54
53
  for path in base.rglob("*"):
55
54
  if path.is_file():
56
55
  rel = path.relative_to(base)
57
- key = os.path.join(prefix, rel.as_posix())
56
+ key = self.compose_key(prefix, rel.as_posix())
58
57
  with path.open("rb") as fh:
59
58
  self.upload(key, fh)
60
59
 
@@ -75,7 +74,7 @@ class MemoryStorageAdapter(StorageAdapterBase):
75
74
  rel = key[len(base) :].lstrip("/") if base else key
76
75
  if not rel:
77
76
  continue
78
- target = dest_root / rel
77
+ target = self.download_target_for_key(dest_root, rel)
79
78
  target.parent.mkdir(parents=True, exist_ok=True)
80
79
  target.write_bytes(payload)
81
80
 
@@ -84,7 +83,7 @@ class MemoryStorageAdapter(StorageAdapterBase):
84
83
  self._store.pop(self._full_key(object_key), None)
85
84
 
86
85
  @classmethod
87
- def from_uri(cls, uri: str) -> "MemoryStorageAdapter":
86
+ def from_uri(cls, uri: str) -> MemoryStorageAdapter:
88
87
  """Instantiate the adapter from a ``memory://`` URI."""
89
88
  prefix = uri.removeprefix("memory://").strip("/")
90
89
  return cls(prefix=prefix)
@@ -1,97 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: swarmauri_storage_memory
3
- Version: 0.1.0.dev29
4
- Summary: In-memory storage adapter for SwarmauriSDK
5
- License-Expression: Apache-2.0
6
- License-File: LICENSE
7
- Keywords: swarmauri,sdk,standards,storage,memory,in-memory,adapter
8
- Author: Jacob Stewart
9
- Author-email: jacob@swarmauri.com
10
- Requires-Python: >=3.10,<3.13
11
- Classifier: Development Status :: 1 - Planning
12
- Classifier: License :: OSI Approved :: Apache Software License
13
- Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.10
15
- Classifier: Programming Language :: Python :: 3.11
16
- Classifier: Programming Language :: Python :: 3.12
17
- Classifier: Operating System :: OS Independent
18
- Classifier: Programming Language :: Python
19
- Classifier: Programming Language :: Python :: 3 :: Only
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_memory/">
29
- <img src="https://img.shields.io/pypi/dm/swarmauri_storage_memory" alt="PyPI - Downloads"/></a>
30
- <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_storage_memory/">
31
- <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_storage_memory.svg"/></a>
32
- <a href="https://pypi.org/project/swarmauri_storage_memory/">
33
- <img src="https://img.shields.io/pypi/pyversions/swarmauri_storage_memory" alt="PyPI - Python Version"/></a>
34
- <a href="https://pypi.org/project/swarmauri_storage_memory/">
35
- <img src="https://img.shields.io/pypi/l/swarmauri_storage_memory" alt="PyPI - License"/></a>
36
- <a href="https://pypi.org/project/swarmauri_storage_memory/">
37
- <img src="https://img.shields.io/pypi/v/swarmauri_storage_memory?label=swarmauri_storage_memory&color=green" alt="PyPI - swarmauri_storage_memory"/></a>
38
-
39
- </p>
40
-
41
- ---
42
-
43
- # Swarmauri Memory Storage Adapter
44
-
45
- In-memory storage adapter for SwarmauriSDK workflows. This adapter is ideal for
46
- unit tests, demos, or short-lived workloads where you want to avoid persistent
47
- storage and rely entirely on process memory.
48
-
49
- ## Features
50
-
51
- - Keeps uploaded artifacts in an in-memory dictionary for fast access.
52
- - Supports optional key prefixes to scope uploads and downloads.
53
- - Provides helper methods for bulk upload/download operations.
54
- - Emits ``memory://`` URIs so downstream components can trace stored artifacts.
55
- - Supports Python 3.10 through 3.12.
56
-
57
- ## Installation
58
-
59
- Install the package with your preferred Python packaging tool:
60
-
61
- ```bash
62
- uv pip install swarmauri_storage_memory
63
- ```
64
-
65
- ```bash
66
- pip install swarmauri_storage_memory
67
- ```
68
-
69
- ## Usage
70
-
71
- ```python
72
- import io
73
-
74
- from swarmauri_storage_memory import MemoryStorageAdapter
75
-
76
- adapter = MemoryStorageAdapter(prefix="session")
77
-
78
- uri = adapter.upload("example.txt", io.BytesIO(b"hello"))
79
- print("Stored at:", uri)
80
-
81
- downloaded = adapter.download("example.txt").read().decode("utf-8")
82
- print("Contents:", downloaded)
83
-
84
- keys = list(adapter.iter_prefix(""))
85
- print("Keys:", keys)
86
- ```
87
-
88
- The adapter above stores data purely in memory, making it suitable for
89
- lightweight or ephemeral workflows. Use ``upload_dir`` and ``download_dir`` for
90
- bulk transfers when you need to stage many artifacts in memory at once.
91
-
92
- ## Want to help?
93
-
94
- If you want to contribute to swarmauri-sdk, read up on our
95
- [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md)
96
- that will help you get started.
97
-
@@ -1,72 +0,0 @@
1
- ![Swarmauri Logo](https://github.com/swarmauri/swarmauri-sdk/blob/3d4d1cfa949399d7019ae9d8f296afba773dfb7f/assets/swarmauri.brand.theme.svg)
2
-
3
- <p align="center">
4
- <a href="https://pypi.org/project/swarmauri_storage_memory/">
5
- <img src="https://img.shields.io/pypi/dm/swarmauri_storage_memory" alt="PyPI - Downloads"/></a>
6
- <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_storage_memory/">
7
- <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_storage_memory.svg"/></a>
8
- <a href="https://pypi.org/project/swarmauri_storage_memory/">
9
- <img src="https://img.shields.io/pypi/pyversions/swarmauri_storage_memory" alt="PyPI - Python Version"/></a>
10
- <a href="https://pypi.org/project/swarmauri_storage_memory/">
11
- <img src="https://img.shields.io/pypi/l/swarmauri_storage_memory" alt="PyPI - License"/></a>
12
- <a href="https://pypi.org/project/swarmauri_storage_memory/">
13
- <img src="https://img.shields.io/pypi/v/swarmauri_storage_memory?label=swarmauri_storage_memory&color=green" alt="PyPI - swarmauri_storage_memory"/></a>
14
-
15
- </p>
16
-
17
- ---
18
-
19
- # Swarmauri Memory Storage Adapter
20
-
21
- In-memory storage adapter for SwarmauriSDK workflows. This adapter is ideal for
22
- unit tests, demos, or short-lived workloads where you want to avoid persistent
23
- storage and rely entirely on process memory.
24
-
25
- ## Features
26
-
27
- - Keeps uploaded artifacts in an in-memory dictionary for fast access.
28
- - Supports optional key prefixes to scope uploads and downloads.
29
- - Provides helper methods for bulk upload/download operations.
30
- - Emits ``memory://`` URIs so downstream components can trace stored artifacts.
31
- - Supports Python 3.10 through 3.12.
32
-
33
- ## Installation
34
-
35
- Install the package with your preferred Python packaging tool:
36
-
37
- ```bash
38
- uv pip install swarmauri_storage_memory
39
- ```
40
-
41
- ```bash
42
- pip install swarmauri_storage_memory
43
- ```
44
-
45
- ## Usage
46
-
47
- ```python
48
- import io
49
-
50
- from swarmauri_storage_memory import MemoryStorageAdapter
51
-
52
- adapter = MemoryStorageAdapter(prefix="session")
53
-
54
- uri = adapter.upload("example.txt", io.BytesIO(b"hello"))
55
- print("Stored at:", uri)
56
-
57
- downloaded = adapter.download("example.txt").read().decode("utf-8")
58
- print("Contents:", downloaded)
59
-
60
- keys = list(adapter.iter_prefix(""))
61
- print("Keys:", keys)
62
- ```
63
-
64
- The adapter above stores data purely in memory, making it suitable for
65
- lightweight or ephemeral workflows. Use ``upload_dir`` and ``download_dir`` for
66
- bulk transfers when you need to stage many artifacts in memory at once.
67
-
68
- ## Want to help?
69
-
70
- If you want to contribute to swarmauri-sdk, read up on our
71
- [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md)
72
- that will help you get started.