Skip to main content

In-memory storage adapter for SwarmauriSDK

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_storage_memory


Swarmauri Memory Storage Adapter

In-memory storage adapter for SwarmauriSDK workflows. This adapter is ideal for unit tests, demos, or short-lived workloads where you want to avoid persistent storage and rely entirely on process memory.

Features

  • Keeps uploaded artifacts in an in-memory dictionary for fast access.
  • Supports optional key prefixes to scope uploads and downloads.
  • Provides helper methods for bulk upload/download operations.
  • Emits memory:// URIs so downstream components can trace stored artifacts.
  • Supports Python 3.10 through 3.12.

Installation

Install the package with your preferred Python packaging tool:

uv pip install swarmauri_storage_memory
pip install swarmauri_storage_memory

Usage

import io

from swarmauri_storage_memory import MemoryStorageAdapter

adapter = MemoryStorageAdapter(prefix="session")

uri = adapter.upload("example.txt", io.BytesIO(b"hello"))
print("Stored at:", uri)

downloaded = adapter.download("example.txt").read().decode("utf-8")
print("Contents:", downloaded)

keys = list(adapter.iter_prefix(""))
print("Keys:", keys)

The adapter above stores data purely in memory, making it suitable for lightweight or ephemeral workflows. Use upload_dir and download_dir for bulk transfers when you need to stage many artifacts in memory at once.

Want to help?

If you want to contribute to swarmauri-sdk, read up on our guidelines for contributing that will help you get started.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swarmauri_storage_memory-0.1.0.dev24.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file swarmauri_storage_memory-0.1.0.dev24.tar.gz.

File metadata

  • Download URL: swarmauri_storage_memory-0.1.0.dev24.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for swarmauri_storage_memory-0.1.0.dev24.tar.gz
Algorithm Hash digest
SHA256 7d04c4a22a74bf77343d2925ef8109de87e4b379758b96192840cbb58d3841cc
MD5 7b88eb1ca9a6f1b13a6b88356213337c
BLAKE2b-256 dee8bbc7fd2e99fe5505f9f41cedb8129394fa424a5f2deed3d2f59a675fb791

See more details on using hashes here.

File details

Details for the file swarmauri_storage_memory-0.1.0.dev24-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_storage_memory-0.1.0.dev24-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for swarmauri_storage_memory-0.1.0.dev24-py3-none-any.whl
Algorithm Hash digest
SHA256 77aab10d340b5ad88c6f0f7b2915b4762f6b43305e91008f07914c3002c80492
MD5 4b36cba463e2482a696472b04765921d
BLAKE2b-256 aa962caeee954c38d34d4acffe5029dd6bcb2781e9e6334be25e09e5c7e7ecdf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page