Skip to main content

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

MethodDescriptionReturn type
list_objectsLists all object metadata from TruStoragelist(str)
get_objectGets an object from Storage and returns it as a streambytes
get_directoryDownloads all objects from TruStorage and saves to the specified local directoryNone
put_objectUploads the content object to TruStorage under the name keyNone
put_directoryUploads all files from specified local directory to the TruStorageNone
move_objectsMoves keys/prefixes to the new keys/prefixesNone
delete_objectsDeletes keys/prefixes from TruStorageNone