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.dev29.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.dev29.tar.gz.

File metadata

  • Download URL: swarmauri_storage_memory-0.1.0.dev29.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.dev29.tar.gz
Algorithm Hash digest
SHA256 de536ee345c840da6997844cb5711a21f0b1bfd96d08c36961c7fb6936814d6c
MD5 4616db0a4e5adbe8f7a7b450905f9ac0
BLAKE2b-256 7344e814ef577b7431c0abf0bba5f468aa15ccc41d8c05bf618de8a6352a024a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: swarmauri_storage_memory-0.1.0.dev29-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.dev29-py3-none-any.whl
Algorithm Hash digest
SHA256 be196371a550a6c5672da8c97fbba45ae60184f52a68519c891b584aeeb6559a
MD5 c6f3b6d5567bba449a735ed06139e390
BLAKE2b-256 f8efb56d8a1c7e19870619e066209be421d60eb1d29d10e1e0721862ea96f521

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