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)
Object lock
The S3 backend supports the full set of S3 object-lock primitives — bucket lock
configuration, versioning, per-object retention (GOVERNANCE / COMPLIANCE), legal
hold, governance-bypass deletion and version-targeted operations. Lock support is
exposed through the VfsObjectLock and VfsLockableVolume capability interfaces, so
a backend can be probed with isinstance():
from rick_vfs import VfsObjectLock
if isinstance(vfs, VfsObjectLock):
vfs.enable_legal_hold("my-object")
See Object lock & versioning for details.
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
File details
Details for the file rick_vfs-2.0.0.tar.gz.
File metadata
- Download URL: rick_vfs-2.0.0.tar.gz
- Upload date:
- Size: 18.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1baec2d289ef37572bda81533d0de48130e9335211da0ca1b7956bb91ee581b
|
|
| MD5 |
bafce28e5de2971dd54114453dcd1956
|
|
| BLAKE2b-256 |
ca0c77c0bc9aabc9f5e953aab91fd7518605b5b1b790536c59f2808909208987
|
Provenance
The following attestation bundles were made for rick_vfs-2.0.0.tar.gz:
Publisher:
publish.yml on oddbit-project/rick_vfs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rick_vfs-2.0.0.tar.gz -
Subject digest:
b1baec2d289ef37572bda81533d0de48130e9335211da0ca1b7956bb91ee581b - Sigstore transparency entry: 1797843346
- Sigstore integration time:
-
Permalink:
oddbit-project/rick_vfs@73e8dba9957537fdf695d8d81c414a6f37044a63 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/oddbit-project
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@73e8dba9957537fdf695d8d81c414a6f37044a63 -
Trigger Event:
workflow_dispatch
-
Statement type: