Skip to content
A repository to access the Fuga objectstore with Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Connecting to Fuga ObjectStore with Python

A collection of Python Objects to connect to the Fuga ObjectStore. It is a small wrapper around boto.

To get started, download the '' file or copy paste it in your project, install the requirements.txt and then:

from fuga_object_store import FugaObjectStore

ACCESS_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
SECRET_KEY = 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'

with FugaObjectStore(ACCESS_KEY, SECRET_KEY, '<your-container-name>') as fuga:

This will list all the files in your container. You will now be able to get and delete files from your Container with:

with FugaObjectStore(ACCESS_KEY, SECRET_KEY, '<your-container-name>') as fuga:
    # or

The 'get' method will return the binary contents of the file and encode it as a hexadecimal number, this can be embedded in a html page. With the return_hex flag to False this method will return a bytes object. There are methods for uploading and downloading files. These will need a file-like object to save or load from. For example:

with FugaObjectStore(ACCESS_KEY, SECRET_KEY, '<your-container-name>') as fuga:
    with open("local/path/where/file-to-upload-to-objectstore", 'rb') as f:

    with open("local/path/where/file-to-download-from-objectstore", 'wb') as f:, load_from='file-to-download-from-objectstore')

FugaObjectStore class is a combination of the FugaContainer class and the FugaConnection class. The FugaContainer takes a FugaConnection-like object as its input and makes it possible to use its interface.

with FugaConnection(ACCESS_KEY, SECRET_KEY, '<your-container-name>') as fuga:

You will also be able to use these classes without context manager this way:

container = FugaConnection(ACCESS_KEY, SECRET_KEY)

interface = FugaContainer(container)
print(interface.list())  # Or upload and download files


Run the tests with flake8:

PYTHONPATH=. pytest && flake8 tests/
You can’t perform that action at this time.