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 Discord

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.11.0.dev1.tar.gz (7.7 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.11.0.dev1.tar.gz.

File metadata

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

File hashes

Hashes for swarmauri_storage_memory-0.11.0.dev1.tar.gz
Algorithm Hash digest
SHA256 8911e44ee878a4188d5718fdbeee25257a552103a03f680ca3389da11baca6e8
MD5 c3527c4ad0641b2facf67b49dbee0373
BLAKE2b-256 c3aa9f1ba9aa2a2e7af918d6a4c99a53814e33f38ef52e73c6a95f4ef0478c1a

See more details on using hashes here.

File details

Details for the file swarmauri_storage_memory-0.11.0.dev1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for swarmauri_storage_memory-0.11.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 a54b266f002805d548aecc8fab2be72f4df381f4e584de1a986210d7f06eac6d
MD5 0ffb446890e343f278f2f2e16c729c24
BLAKE2b-256 4c509e87c4dd5f30f6293a796b7e0e9a90110af232f8059c71de06d500838f16

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