from gjirafatech.truai.storage import TruStorageClient
storage = TruStorageClient()
page1 = storage.list_objects(prefix="directory/data")
page2 = storage.list_objects(prefix="directory/data", last_key=page1[-1])
stream = storage.get_object(key="directory/file.ext")
storage.get_directory(prefix="directory/", directory="/home/jovyan/data/")
f = open("directory/file.txt", "r")
storage.put_object(key="directory/file.txt", content=f, content_type="text/plain")
storage.put_directory(directory="/home/jovyan/data/", prefix="directory/")
storage.move_objects(
keys={
"directory/file.ext": "directory/data.ext",
"directory/sample.csv": "raw-data/sample.csv",
}
)
storage.move_objects(
prefixes={
"directory1/": "directory2/",
"raw-data/": "data/",
}
)
storage.delete_objects(keys=["directory/file.ext", "directory/sample.csv"])
storage.delete_objects(prefixes=["directory/", "raw-data/"])