Swarmauri MinIO Storage Adapter
Peagen storage adapter that saves artifacts to a MinIO or any S3-compatible bucket using the official minio Python client.
Features
- Automatically creates the target bucket if it does not already exist.
- Optional
prefixargument to scope uploads without changing your keys. - Implements
upload,download,upload_dir,download_dir, anditer_prefixhelpers for working with single files or directories. - Exposes a
root_uridescribing the bucket and prefix (minio[s]://endpoint/bucket/prefix/). MinioStorageAdapter.from_uri()reads credentials fromMINIO_ACCESS_KEYandMINIO_SECRET_KEYenvironment variables for zero-copy configuration.
Installation
Using uv
uv add swarmauri_storage_minio
# or install into an existing environment
uv pip install swarmauri_storage_minio
Using Poetry
poetry add swarmauri_storage_minio
Using pip
pip install swarmauri_storage_minio
Usage
The adapter wraps a MinIO client instance. When you instantiate it, the bucket is created if it does not already exist. Use the secure flag for HTTPS endpoints (True by default) and supply a prefix when you want to namespace all uploads under a directory.
from swarmauri_storage_minio import MinioStorageAdapter
import io
adapter = MinioStorageAdapter(
endpoint="localhost:9000",
access_key="minio",
secret_key="minio123",
bucket="peagen",
secure=False,
prefix="examples/",
)
uri = adapter.upload("artifact.txt", io.BytesIO(b"data"))
print(uri)
downloaded = adapter.download("artifact.txt").read()
print(downloaded.decode("utf-8"))
Note: If you store credentials as
SecretStr, call.get_secret_value()when passing them to the adapter.
Config-driven instantiation
The adapter can also be created from a URI. Credentials are loaded from environment variables.
from swarmauri_storage_minio import MinioStorageAdapter
adapter = MinioStorageAdapter.from_uri("minio://localhost:9000/peagen/examples/")
print(adapter.root_uri)
Want to help?
If you want to contribute to swarmauri-sdk, read up on our guidelines for contributing that will help you get started.
Metadata
Release files for swarmauri_storage_minio 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| swarmauri_storage_minio-0.2.0.tar.gz | 8.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| swarmauri_storage_minio-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.4 kB
Release files / swarmauri_storage_minio-0.2.0.tar.gz
| Download URL | swarmauri_storage_minio-0.2.0.tar.gz |
|---|---|
| Size | 8.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6c31356f7e837f96ea54e3bfba72fa0b8eebf6072c83b5b51b619e810999313c
|
|
BLAKE2b-256 checksum How to use checksums |
1d7756fb12b55c546331b9b6ad4bcca224dbd2b8a469bc076ef07fd1fc05c4f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","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}
|
Release files / swarmauri_storage_minio-0.2.0-py3-none-any.whl
| Download URL | swarmauri_storage_minio-0.2.0-py3-none-any.whl |
|---|---|
| Size | 9.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7491c06aab103df999ea26364804e42addef4505e95e89b591c0cf1ed8c6b4af
|
|
BLAKE2b-256 checksum How to use checksums |
7e293e757221755ab609da5ebf4e7e07194d6aeda073a46a622e66f7a91edcd9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","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}
|