TruStorageClient
TruStorageClient is part of TruAI SDK that deals with file managment utilizing the Storage API from GjirafaTech Captain. You can manage your files on TruAI Platform, or directly through this module of Python SDK.
This guide will show you how to import, configure and use Tru AI Storage Module, to read and write file to Tru AI Storage.
Configuration
To start using TruStorageClient module you first need to import the package
from gjirafatech.truai.storage import TruStorageClient
After importing the package you have to initialize an object of the TruStorageClient class.
storage = TruStorageClient()
Methods
Method | Description | Return type |
---|---|---|
list_objects | Lists all object metadata from TruStorage | list(str) |
get_object | Gets an object from Storage and returns it as a stream | bytes |
get_directory | Downloads all objects from TruStorage and saves to the specified local directory | None |
put_object | Uploads the content object to TruStorage under the name key | None |
put_directory | Uploads all files from specified local directory to the TruStorage | None |
move_objects | Moves keys/prefixes to the new keys/prefixes | None |
delete_objects | Deletes keys/prefixes from TruStorage | None |