Minio/S3 client VFS abstraction library
Project description
rick-vfs
Minio/S3 client VFS abstraction library
Rick-vfs is a high-level abstraction library for file operations on local repositories (a locally accessible folder) and Minio/S3 object storage systems. The main goal is to provide a set of common interface functions with analogous behaviour, to interact with both scenarios.
The intention of "analogous behaviour" is to mimick overall intent and response type, when possible. There will always be differences between invoking a given method on two different backends.
Example:
from io import BytesIO
from minio import Minio
from rick_vfs.s3 import MinioBucket, MinioVfs
client = Minio(
"localhost:9010",
secure=False,
access_key="SomeTestUser",
secret_key="SomeTestPassword",
)
# initialize bucket
volume = MinioBucket(client, 'my-bucket')
# initialize VFS object
vfs = MinioVfs(volume)
# create directory
vfs.mkdir("contents/files")
# create file from buffer
buf = BytesIO(b'the quick brown fox jumps over the lazy dog')
vfs.write_file(buf, 'contents/files/my_test_file')
# read file
contents = vfs.read_file('my_test_file')
# print contents
print(str(contents.getbuffer().tobytes(), 'utf-8'))
# list bucket contents
print("Bucket contents:")
for item in vfs.ls():
print(item.object_name)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rick_vfs-1.0.0.tar.gz
(15.8 kB
view details)
File details
Details for the file rick_vfs-1.0.0.tar.gz
.
File metadata
- Download URL: rick_vfs-1.0.0.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50a83f876654494fc43a6cd260e667e0f62c8ee1a35f01c97863b530f6e68c00 |
|
MD5 | 677f71cfe532a9b4ad09f343b7a94ab5 |
|
BLAKE2b-256 | 61f47877f4efc013297ac2f5e3717b7a5f41e9b56531ba52969a3c27ee96977b |