Aquarium()

class Aquarium(api_url='', token=None, api_version='v1', domain=None, strict_dotmap=False)

This class describes the main class of Aquarium

Parameters:
  • api_url (string) – Specify the URL of the API.

  • token (string, optional) – Specify the authentication token, to avoid signin()

  • api_version (string, optional) – Specify the API version you want to use (default : v1).

  • domain (string, optional) – Specify the domain used for unauthenticated requests. Mainly for Aquarium Fatfish Lab dev or local Aquarium server without DNS

  • strict_dotmap (boolean, optional) – Specify if the dotmap should create new property dynamically (default : False). Set to True to have default Python behaviour like on Dict()

Variables:
  • token – Get the current token (populated after a first signin())

  • events (Events) – Access to Events class

  • edge (Edge) – Access to Edge class

  • item (Item) – Access to Item class

  • asset (Asset) – Access to Asset subclass

  • playlist (Playlist) – Access to Playlist subclass

  • project (Project) – Access to Project subclass

  • shot (Shot) – Access to Shot subclass

  • task (Task) – Access to Task subclass

  • template (Template) – Access to Template subclass

  • bot (Bot) – Access to Bot subclass

  • user (User) – Access to User subclass

  • usergroup (Usergroup) – Access to Usergroup subclass

  • organisation (Organisation) – Access to Organisation subclass

  • utils (Utils) – Access to Utils class

cast(data={})

Creates an item or edge instance from a dictionary

Parameters:

data (dictionary) – The object item or edge from Aquarium API

Returns:

Instance of Edge or Item or items subclass

Return type:

Edge | Item : [Asset | Project | Shot | Task | Template | User | Usergroup]

connect(email='', password='')

Alias of signin()

create_user(email, name=None, aquarium_url=None)

Create a new user

Parameters:
  • email (string) – The email of the new user

  • name (string, optional) – The name of the new user

  • aquarium_url (string, optional (default is api_url used during module initialisation)) – The Aquarium Studio interface url. Useful if API url is not the same as Aquarium Studio interface.

Returns:

User object

Return type:

User

do_request(*args, **kwargs)

Execute a request to the API

Parameters:
  • args (tuple) – Parameters used to send the request : HTTP verb, API endpoint

  • kwargs (dictionary) – Headers, data and parameters used for the request

Returns:

Request response

Return type:

List or dictionary

forgot_password(email, aquarium_url=None)

Start forgot password procedure. User will receive an email to reset its password.

Parameters:
  • email (string) – Email of the user who forgot its password

  • aquarium_url (string, optional (default is api_url used during module initialisation)) – The Aquarium Studio interface url. Useful if API url is not the same as Aquarium Studio interface.

Returns:

True or False

Return type:

boolean

get_current_user()

Alias of get_current()

Returns:

A User instance of the connected user.

Return type:

User object

get_file(file_path)

Get stored file on Aquarium server

Parameters:

file_path (string) – The file path from item property (Exemple: /files/file_id.jpg)

Returns:

The file

Return type:

list

get_server_status()

Gets the server status.

Returns:

The server status

Return type:

dictionary

get_users()

Get all users

Returns:

List of all users

Return type:

List of User

logout()

Alias of signout()

me()

Alias of get_current_user()

Returns:

A User instance of the connected user.

Return type:

User object

mine()

Alias of get_profile()

Returns:

User, Usergroups and Organisations object

Return type:

Dict {user: User, usergroups: [Usergroup], organisations: [Organisation]}

ping()

Ping Aquarium server

Returns:

Ping response: pong

Return type:

string

query(meshql='', aliases={})

Query entities

Tip

For better performances, we advice you to use the function traverse()

Parameters:
  • meshql (string) – The meshql string

  • aliases (dictionary) – The aliases used in the meshql query

Returns:

List of item, edge or VIEW used in the meshql query

Return type:

list

signin(email='', password='')

Sign in a user with its email and password

Parameters:
  • email (string) – The email of the user

  • password (string) – The password of the user

signout()

Sign out current user by clearing the stored authentication token

Note

After a signout(), you need to use a signin() before sending authenticated requests

Returns:

None

upload_file(path='')

Uploads a file on the server

Note

The file is just uploaded to Aquarium. The metadata are not saved on any item. Use update_data() to save them on an item. You can also directly upload a file on an item with upload_file().

Parameters:

path (string) – The path of the file to upload

Returns:

The file metadata on Aquarium

Return type:

dictionary