Specifications

The philosophy behind this client is to allow you to make common operation as simply as possible. We want to provide helpers to make your development faster. If you think that one is missing, feel free to ask for it in the Github issues. Even better, you can contribute by directly adding it to the code.

The client is divided in eight modules:

  • person: functions related to studio members
  • project: functions related to running productions
  • asset: functions related to asset and asset types.
  • shot: functions related to shots, sequences and episodes.
  • scene: functions related to layout scenes (which will lead to shots).
  • task: functions related to tasks, task types and assignations.
  • files: functions related to file path generation.
  • user: functions related to current user data.
  • playlist: functions related to project playlists.
  • client: generic functions to deal with the API.

In the following, we are going to describe all functions available in the Gazu client.

gazu.asset

gazu.asset.all_asset_instances_for_asset(asset)[source]
Parameters:asset (str / dict) – The asset dict or the asset ID.
Returns:Asset instances existing for a given asset.
Return type:list
gazu.asset.all_asset_instances_for_shot(shot)[source]
Parameters:shot (str / dict) – The shot dict or the shot ID.
Returns:Asset instances existing for a given shot.
Return type:list
gazu.asset.all_asset_types()[source]
Returns:Asset types stored in the database.
Return type:list
gazu.asset.all_asset_types_for_project(project)[source]
Parameters:project (str / dict) – The project dict or the project ID.
Returns:Asset types from assets listed in given project.
Return type:list
gazu.asset.all_asset_types_for_shot(shot)[source]
Parameters:shot (str / dict) – The shot dict or the shot ID.
Returns:Asset types from assets casted in given shot.
Return type:list
gazu.asset.all_assets_for_episode(episode)[source]
Parameters:episode (str / dict) – The episode dict or the episode ID.
Returns:Assets stored in the database for given episode.
Return type:list
gazu.asset.all_assets_for_open_projects()[source]
Returns:Assets stored in the database for open projects.
Return type:list
gazu.asset.all_assets_for_project(project)[source]
Parameters:project (str / dict) – The project dict or the project ID.
Returns:Assets stored in the database for given project.
Return type:list
gazu.asset.all_assets_for_project_and_type(project, asset_type)[source]
Parameters:
  • project (str / dict) – The project dict or the project ID.
  • asset_type (str / dict) – The asset type dict or the asset type ID.
Returns:

Assets stored in the database for given project and asset type.

Return type:

list

gazu.asset.all_assets_for_shot(shot)[source]
Parameters:shot (str / dict) – The shot dict or the shot ID.
Returns:Assets stored in the database for given shot.
Return type:list
gazu.asset.all_scene_asset_instances_for_asset(asset)[source]
Parameters:asset (str / dict) – The asset dict or the asset ID.
Returns:Scene asset instances existing for a given asset.
Return type:list
gazu.asset.all_shot_asset_instances_for_asset(asset)[source]
Parameters:asset (str / dict) – The asset dict or the asset ID.
Returns:Asset instances existing for a given asset.
Return type:list
gazu.asset.disable_asset_instance(asset_instance)[source]

Set active flag of given asset instance to False.

Parameters:asset_instance (str / dict) – The asset instance dict or ID.
gazu.asset.enable_asset_instance(asset_instance)[source]

Set active flag of given asset instance to True.

Parameters:asset_instance (str / dict) – The asset instance dict or ID.
gazu.asset.get_asset(asset_id)[source]
Parameters:asset_id (str) – Id of claimed asset.
Returns:Asset matching given ID.
Return type:dict
gazu.asset.get_asset_by_name(project, name, asset_type=None)[source]
Parameters:
  • project (str / dict) – The project dict or the project ID.
  • name (str) – The asset name
  • asset_type (str / dict) – Asset type dict or ID (optional).
Returns:

Asset matching given name for given project and asset type.

Return type:

dict

gazu.asset.get_asset_instance(asset_instance_id)[source]
Parameters:asset_instance_id (str) – Id of claimed asset instance.
Returns:Asset Instance matching given ID.
Return type:dict
gazu.asset.get_asset_type(asset_id)[source]
Parameters:asset_type_id (str) – Id of claimed asset type.
Returns:Asset Type matching given ID.
Return type:dict
gazu.asset.get_asset_type_by_name(name)[source]
Parameters:asset_type_id (str) – Id of claimed asset type.
Returns:Asset Type matching given name.
Return type:dict
gazu.asset.new_asset(project, asset_type, name, description='', extra_data={}, episode_id=None)[source]

Create a new asset in the database for given project and asset type.

Parameters:
  • project (str / dict) – The project dict or the project ID.
  • asset_type (str / dict) – The asset type dict or the asset type ID.
  • name (str) – Asset name.
  • description (str) – Additional information.
  • extra_data (dict) – Free field to add any kind of metadata.
Returns:

Created asset.

Return type:

dict

gazu.asset.new_asset_asset_instance(asset, asset_to_instantiate, description='')[source]

Creates a new asset instance for given asset. The instance number is automatically generated (increment highest number).

Parameters:
  • asset (str / dict) – The asset dict or the shot ID.
  • asset_instance (str / dict) – The asset instance dict or ID.
  • description (str) – Additional information (optional)
Returns:

Created asset instance.

Return type:

(dict)

gazu.asset.new_asset_type(name)[source]

Create a new asset type in the database.

Parameters:name (str) – The name of asset type to create.
Returns:Created asset type.
Return type:(dict)
gazu.asset.remove_asset(asset, force=False)[source]

Remove given asset from database.

Parameters:asset (dict) – Asset to remove.
gazu.asset.remove_asset_type(asset_type)[source]

Remove given asset type from database.

Parameters:asset_type (dict) – Asset type to remove.
gazu.asset.update_asset(asset)[source]

Save given asset data into the API. It assumes that the asset already exists.

Parameters:asset (dict) – Asset to save.
gazu.asset.update_asset_type(asset_type)[source]

Save given asset type data into the API. It assumes that the asset type already exists.

Parameters:asset_type (dict) – Asset Type to save.

gazu.client

gazu.client.build_path_with_params(path, params)[source]

Add params to a path using urllib encoding

Parameters:
  • path (str) – The url base path
  • params (dict) – The parameters to add as a dict
Returns:

the builded path

Return type:

str

gazu.client.check_status(request, path)[source]

Raise an exception related to status code, if the status code does not match a success code. Print error message when it’s relevant.

Parameters:

request (Request) – The request to validate.

Returns:

Status code

Return type:

int

Raises:
  • ParameterException – when 400 response occurs
  • NotAuthenticatedException – when 401 response occurs
  • RouteNotFoundException – when 404 response occurs
  • NotAllowedException – when 403 response occurs
  • MethodNotAllowedException – when 405 response occurs
  • TooBigFileException – when 413 response occurs
  • ServerErrorException – when 500 response occurs
gazu.client.create(model_name, data)[source]

Create an entry for given model and data.

Returns:Created entry
Return type:dict
gazu.client.delete(path, params=None)[source]

Run a get request toward given path for configured host.

Returns:The request result.
gazu.client.download(path, file_path)[source]

Download file located at file_path to given url path.

Parameters:
  • path (str) – The url path to download file from.
  • file_path (str) – The location to store the file on the hard drive.
Returns:

Request response object.

Return type:

Response

gazu.client.fetch_all(path, params=None)[source]
Parameters:path (str) – The path for which we want to retrieve all entries.
Returns:All entries stored in database for a given model. You can add a filter to the model name like this: “tasks?project_id=project-id”
Return type:list
gazu.client.fetch_first(path, params=None)[source]
Parameters:path (str) – The path for which we want to retrieve the first entry.
Returns:The first entry for which a model is required.
Return type:dict
gazu.client.fetch_one(model_name, id)[source]

Function dedicated at targeting routes that returns a single model instance.

Parameters:
  • model_name (str) – Model type name.
  • id (str) – Model instance ID.
Returns:

The model instance matching id and model name.

Return type:

dict

gazu.client.get(path, json_response=True, params=None)[source]

Run a get request toward given path for configured host.

Returns:The request result.
gazu.client.get_api_version()[source]
Returns:Current version of the API.
Return type:str
gazu.client.get_current_user()[source]
Returns:User database information for user linked to auth tokens.
Return type:dict
gazu.client.get_event_host()[source]
Returns:Host on which listening for events.
gazu.client.get_full_url(path)[source]
Parameters:path (str) – The path to integrate to host url.
Returns:The result of joining configured host url with given path.
gazu.client.get_host()[source]
Returns:Host on which requests are sent.
gazu.client.host_is_up()[source]
Returns:True if the host is up
gazu.client.make_auth_header()[source]
Returns:Headers required to authenticate.
gazu.client.post(path, data)[source]

Run a post request toward given path for configured host.

Returns:The request result.
gazu.client.put(path, data)[source]

Run a put request toward given path for configured host.

Returns:The request result.
gazu.client.set_event_host(new_host)[source]
Returns:Set currently configured host on which listening for events.
gazu.client.set_host(new_host)[source]
Returns:Set currently configured host on which requests are sent.
gazu.client.set_tokens(new_tokens)[source]

Store authentication token to reuse them for all requests.

Parameters:new_tokens (dict) – Tokens to use for authentication.
gazu.client.upload(path, file_path)[source]

Upload file located at file_path to given url path.

Parameters:
  • path (str) – The url path to upload file.
  • file_path (str) – The file location on the hard drive.
Returns:

Request response object.

Return type:

Response

gazu.client.url_path_join(*items)[source]

Make it easier to build url path by joining every arguments with a ‘/’ character.

Parameters:items (list) – Path elements

gazu.entity

gazu.entity.all_entities()[source]

Retrieve all entity types

gazu.entity.all_entity_types()[source]

Retrieve all entity types

gazu.entity.get_entity(entity_id)[source]
Returns:Retrieve entity matching given ID (It can be an entity of any kind: asset, shot, sequence or episode).
Return type:dict
gazu.entity.get_entity_type(entity_type_id)[source]
Returns:Retrieve entity type matching given ID (It can be an entity type of any kind).
gazu.entity.get_entity_types()[source]
Returns:All entities types available in the API.
Return type:list
gazu.entity.new_entity_type(name)[source]

Creates an entity type with the given name.

Parameters:name (str) – The name of the entity type
Returns:The created entity type
Return type:dict

gazu.files

gazu.files.all_output_files_for_asset_instance(asset_instance, temporal_entity=None, task_type=None, output_type=None, name=None, representation=None)[source]
Parameters:
  • asset_instance (str / dict) – The instance dict or ID.
  • temporal_entity (str / dict) – Shot dict or ID (or scene or sequence).
  • task_type (str / dict) – The task type dict or ID.
  • output_type (str / dict) – The output_type dict or ID.
  • name (str) – The file name
  • representation (str) – The file representation
Returns:

Output files for a given asset instance, temporal entity, output type, task_type, name and representation

Return type:

list

gazu.files.all_output_files_for_entity(entity, output_type=None, task_type=None, name=None, representation=None)[source]
Parameters:
  • entity (str / dict) – The entity dict or ID.
  • output_type (str / dict) – The output type dict or ID.
  • task_type (str / dict) – The task type dict or ID.
  • name (str) – The file name
  • representation (str) – The file representation
Returns:

Output files for a given entity (asset or shot), output type, task_type, name and representation

Return type:

list

gazu.files.all_output_types()[source]
Returns:Output types listed in database.
Return type:list
gazu.files.all_output_types_for_asset_instance(asset_instance, temporal_entity)[source]
Returns:Output types for given asset instance and entity (shot or scene).
Return type:list
gazu.files.all_output_types_for_entity(entity)[source]
Parameters:entity (str / dict) – The entity dict or the entity ID.
Returns:All output types linked to output files for given entity.
Return type:list
gazu.files.all_softwares()[source]
Returns:Software versions listed in database.
Return type:dict
gazu.files.build_asset_instance_output_file_path(asset_instance, temporal_entity, output_type, task_type, name='main', representation='', mode='output', revision=0, nb_elements=1, sep='/')[source]

From the fie path template configured at the project level and arguments, it builds a file path location where to store related DCC output file.

Parameters:
  • entity (temporal) – Asset instance for which a file
  • required. (is) –
  • entity – Temporal entity scene or shot in which
  • asset instance appeared. (the) –
  • output_type (str / id) – Output type of the generated file.
  • task_type (str / id) – Task type related to output file.
  • name (str) – Additional suffix for the working file name.
  • mode (str) – Allow to select a template inside the template.
  • representation (str) – Allow to select a template inside the template.
  • revision (int) – File revision.
  • nb_elements (str) – To represent an image sequence, the amount of file is needed.
  • sep (str) – OS separator.
Returns:

Generated output file path for given asset instance, task type and output type (without extension).

gazu.files.build_entity_output_file_path(entity, output_type, task_type, name='main', mode='output', representation='', revision=0, nb_elements=1, sep='/')[source]

From the fie path template configured at the project level and arguments, it builds a file path location where to store related DCC output file.

Parameters:
  • entity (str / id) – Entity for which an output file is needed.
  • output_type (str / id) – Output type of the generated file.
  • task_type (str / id) – Task type related to output file.
  • name (str) – Additional suffix for the working file name.
  • mode (str) – Allow to select a template inside the template.
  • representation (str) – Allow to select a template inside the template.
  • revision (int) – File revision.
  • nb_elements (str) – To represent an image sequence, the amount of file is needed.
  • sep (str) – OS separator.
Returns:

Generated output file path for given entity, task type and output type (without extension).

gazu.files.build_working_file_path(task, name='main', mode='working', software=None, revision=1, sep='/')[source]

From the fie path template configured at the project level and arguments, it builds a file path location where to store related DCC file.

Parameters:
  • task (str / id) – Task related to working file.
  • name (str) – Additional suffix for the working file name.
  • mode (str) – Allow to select a template inside the template.
  • software (str / id) – Software at the origin of the file.
  • revision (int) – File revision.
  • sep (str) – OS separator.
Returns:

Generated working file path for given task (without extension).

gazu.files.download_preview_file(preview_file, file_path)[source]

Download given preview file and save it at given location.

Parameters:
  • preview_file (str / dict) – The preview file dict or ID.
  • file_path (str) – Location on hard drive where to save the file.
gazu.files.download_preview_file_thumbnail(preview_file, file_path)[source]

Download given preview file thumbnail and save it at given location.

Parameters:
  • preview_file (str / dict) – The preview file dict or ID.
  • file_path (str) – Location on hard drive where to save the file.
gazu.files.get_all_working_files_for_entity(entity, task=None, name=None)[source]

Retrieves all the working files of a given entity and specied parameters

gazu.files.get_last_asset_instance_output_revision(asset_instance, temporal_entity, output_type, task_type, name='master')[source]

Generate last output revision for given asset instance.

gazu.files.get_last_entity_output_revision(entity, output_type, task_type, name='master')[source]
Parameters:
  • entity (str / dict) – The entity dict or ID.
  • output_type (str / dict) – The entity dict or ID.
  • task_type (str / dict) – The entity dict or ID.
  • name (str) – The output name
Returns:

Last revision of ouput files for given entity, output type and task type.

Return type:

int

gazu.files.get_last_output_files_for_asset_instance(asset_instance, temporal_entity, task_type=None, output_type=None, name=None, representation=None)[source]
Parameters:
  • asset_instance (str / dict) – The asset instance dict or ID.
  • temporal_entity (str / dict) – The temporal entity dict or ID.
Returns:

last output files for given asset instance and temporal entity where it appears.

Return type:

list

gazu.files.get_last_output_files_for_entity(entity, output_type=None, task_type=None, name=None, representation=None)[source]
Parameters:
  • entity (str / dict) – The entity dict or ID.
  • output_type (str / dict) – The output type dict or ID.
  • task_type (str / dict) – The task type dict or ID.
  • name (str) – The file name
  • representation (str) – The file representation
Returns:

Last output files for a given entity (asset or shot), output type, task_type, name and representation

Return type:

list

gazu.files.get_last_working_file_revision(task, name='main')[source]
Parameters:
  • task (str / dict) – The task dict or the task ID.
  • name (str) – File name suffix (optional)
Returns:

Last revisions stored in the API for given task and given file name suffx.

Return type:

dict

gazu.files.get_last_working_files(task)[source]
Parameters:task (str / dict) – The task dict or the task ID.
Returns:Keys are working file names and values are last working file availbable for given name.
Return type:dict
gazu.files.get_next_asset_instance_output_revision(asset_instance, temporal_entity, output_type, task_type, name='master')[source]
Parameters:
  • asset_instance (str / dict) – The asset instance dict or ID.
  • temporal_entity (str / dict) – The temporal entity dict or ID.
  • output_type (str / dict) – The entity dict or ID.
  • task_type (str / dict) – The entity dict or ID.
Returns:

Next revision of ouput files available for given asset insance temporal entity, output type and task type.

Return type:

int

gazu.files.get_next_entity_output_revision(entity, output_type, task_type, name='main')[source]
Parameters:
  • entity (str / dict) – The entity dict or ID.
  • output_type (str / dict) – The entity dict or ID.
  • task_type (str / dict) – The entity dict or ID.
Returns:

Next revision of ouput files available for given entity, output type and task type.

Return type:

int

gazu.files.get_output_file(output_file_id)[source]
Parameters:output_file_id (str) – ID of claimed output file.
Returns:Output file matching given ID.
Return type:dict
gazu.files.get_output_file_by_path(path)[source]
Parameters:output_file_id (str) – Path of claimed output file.
Returns:Output file matching given path.
Return type:dict
gazu.files.get_output_type(output_type_id)[source]
Parameters:output_type_id (str) – ID of claimed output type.
Returns:Output type matching given ID.
Return type:dict
gazu.files.get_output_type_by_name(output_type_name)[source]
Parameters:output_type_name (str) – name of claimed output type.
Returns:Output type matching given name.
Return type:dict
gazu.files.get_software(software_id)[source]
Parameters:software_id (str) – ID of claimed output type.
Returns:Software object corresponding to given ID.
Return type:dict
gazu.files.get_software_by_name(software_name)[source]
Parameters:software_name (str) – Name of claimed output type.
Returns:Software object corresponding to given name.
Return type:dict
gazu.files.get_working_file(working_file_id)[source]
Parameters:working_file_id (str) – ID of claimed working file.
Returns:Working file corresponding to given ID.
Return type:dict
gazu.files.get_working_files_for_task(task)[source]
Parameters:task (str / dict) – The task dict or the task ID.
Returns:Working files related to given task.
Return type:list
gazu.files.new_asset_instance_output_file(asset_instance, temporal_entity, output_type, task_type, comment, name='master', mode='output', working_file=None, person=None, revision=0, nb_elements=1, representation='', sep='/')[source]

Create a new output file for given asset instance, temporal entity, task type and output type. It generates and store the expected path and sets a revision number (last revision + 1).

Parameters:
  • entity (str / id) – Entity for which an output file is needed.
  • output_type (str / id) – Output type of the generated file.
  • task_type (str / id) – Task type related to output file.
  • comment (str) – Comment related to created revision.
  • working_file (str / id) – Working file which is the source of the
generated file.
person (str / id): Author of the file. name (str): Additional suffix for the working file name. mode (str): Allow to select a template inside the template. revision (int): File revision. nb_elements (str): To represent an image sequence, the amount of file
needed.
representation (str): Differientate file extensions. It can be useful
to build folders based on extensions like abc, jpg, cetc.
sep (str): OS separator.
Returns:Created output file.
gazu.files.new_entity_output_file(entity, output_type, task_type, comment, working_file=None, person=None, name='main', mode='output', revision=0, nb_elements=1, representation='', sep='/')[source]

Create a new output file for given entity, task type and output type. It generates and store the expected path and sets a revision number (last revision + 1).

Parameters:
  • entity (str / id) – Entity for which an output file is needed.
  • output_type (str / id) – Output type of the generated file.
  • task_type (str / id) – Task type related to output file.
  • comment (str) – Comment related to created revision.
  • working_file (str / id) – Working file which is the source of the
  • file. (generated) –
  • person (str / id) – Author of the file.
  • name (str) – Additional suffix for the working file name.
  • mode (str) – Allow to select a template inside the template.
  • revision (int) – File revision.
  • nb_elements (str) – To represent an image sequence, the amount of file is needed.
  • representation (str) – Differientate file extensions. It can be useful
  • build folders based on extensions like abc, jpg, etc. (to) –
  • sep (str) – OS separator.
Returns:

Created output file.

gazu.files.new_output_type(name, short_name)[source]

Create a new output type in database.

Parameters:
  • name (str) – Name of created output type.
  • short_name (str) – Name shorten to represente the type in UIs.
Returns:

Created output type.

Return type:

dict

gazu.files.new_software(name, short_name, file_extension)[source]

Create a new software in datatabase.

Parameters:
  • name (str) – Name of created software.
  • short_name (str) – Short representation of software name (for UIs).
  • file_extension (str) – Main file extension generated by given software.
Returns:

Created software.

Return type:

dict

gazu.files.new_working_file(task, name='main', mode='working', software=None, comment='', person=None, revision=0, sep='/')[source]

Create a new working_file for given task. It generates and store the expected path for given task and options. It sets a revision number (last revision + 1).

Parameters:
  • task (str / id) – Task related to working file.
  • name (str) – Additional suffix for the working file name.
  • mode (str) – Allow to select a template inside the template.
  • software (str / id) – Software at the origin of the file.
  • comment (str) – Comment related to created revision.
  • person (str / id) – Author of the file.
  • revision (int) – File revision.
  • sep (str) – OS separator.
Returns:

Created working file.

gazu.files.set_project_file_tree(project, file_tree_name)[source]

(Deprecated) Set given file tree template on given project. This template will be used to generate file paths. The template is selected from sources. It is found by using given name.

Parameters:project (str / dict) – The project file dict or ID.
Returns:Modified project.
Return type:dict
gazu.files.update_comment(working_file, comment)[source]

Update the file comment in database for given working file.

Parameters:working_file (str / dict) – The working file dict or ID.
Returns:Modified working file
Return type:dict
gazu.files.update_modification_date(working_file)[source]

Update modification date of given working file with current time (now).

Parameters:working_file (str / dict) – The working file dict or ID.
Returns:Modified working file
Return type:dict
gazu.files.update_output_file(output_file, data)[source]

Update the data of given output file.

Parameters:output_file (str / dict) – The output file dict or ID.
Returns:Modified output file
Return type:dict
gazu.files.update_project_file_tree(project, file_tree)[source]

Set given dict as file tree template on given project. This template will be used to generate file paths.

Parameters:
  • project (str / dict) – The project dict or ID.
  • file_tree (dict) – The file tree template to set on project.
Returns:

Modified project.

Return type:

dict

gazu.person

gazu.person.all_organisations()[source]
Returns:Organisations listed in database.
Return type:list
gazu.person.all_persons()[source]
Returns:Persons listed in database.
Return type:list
gazu.person.get_person(id)[source]
Parameters:id (str) – An uuid identifying a person.
Returns:Person corresponding to given id.
Return type:dict
gazu.person.get_person_by_desktop_login(desktop_login)[source]
Parameters:desktop_login (str) – Login used to sign in on the desktop computer.
Returns:Person corresponding to given desktop computer login.
Return type:dict
gazu.person.get_person_by_email(email)[source]
Parameters:email (str) – User’s email.
Returns:Person corresponding to given email.
Return type:dict
gazu.person.get_person_by_full_name(full_name)[source]
Parameters:full_name (str) – User’s full name
Returns:Person corresponding to given name.
Return type:dict
gazu.person.get_presence_log(year, month)[source]
Parameters:
  • year (int) –
  • month (int) –
Returns:

The presence log table for given month and year.

gazu.person.new_person(first_name, last_name, email, phone='', role='user', desktop_login='')[source]

Create a new person based on given parameters. His/her password will is set automatically to default.

Parameters:
  • first_name (str) –
  • last_name (str) –
  • email (str) –
  • phone (str) –
  • role (str) – user, manager, admin (wich match CG artist, Supervisor and studio manager)
  • desktop_login (str) – The login the users uses to log on its computer.
Returns:

Created person.

Return type:

dict

gazu.person.set_avatar(person, file_path)[source]

Upload picture and set it as avatar for given person.

Parameters:
  • person (str / dict) – The person dict or the person ID.
  • file_path (str) – Path where the avatar file is located on the hard drive.

gazu.project

gazu.project.all_open_projects()[source]
Returns:Open projects stored in the database.
gazu.project.all_project_status()[source]
Returns:Project status listed in database.
Return type:list
gazu.project.all_projects()[source]
Returns:Projects stored in the database.
Return type:list
gazu.project.get_project(project_id)[source]
Parameters:project_id (str) – ID of claimed project.
Returns:Project corresponding to given id.
Return type:dict
gazu.project.get_project_by_name(project_name)[source]
Parameters:project_name (str) – Name of claimed project.
Returns:Project corresponding to given name.
Return type:dict
gazu.project.new_project(name, production_type='short')[source]

Creates a new project.

Parameters:
  • name (str) – Name of the project to create.
  • production_type (str) – short, featurefilm, tvshow
Returns:

Created project.

Return type:

dict

gazu.project.remove_project(project, force=False)[source]

Remove given project from database. (Prior to do that, make sure, there is no asset or shot left).

Parameters:project (dict / str) – Project to remove.
gazu.project.update_project(project)[source]

Save given project data into the API. Metadata are fully replaced by the ones set on given project.

Parameters:project (dict) – The project to update.
Returns:Updated project.
Return type:dict
gazu.project.update_project_data(project, data={})[source]

Update the metadata for the provided project. Keys that are not provided are not changed.

Parameters:
  • project (dict / ID) – The project dict or id to save in database.
  • data (dict) – Free field to set metadata of any kind.
Returns:

Updated project.

Return type:

dict

gazu.shot

gazu.shot.add_asset_instance_to_shot(shot, asset_instance)[source]

Link a new asset instance to given shot.

Parameters:
  • shot (str / dict) – The shot dict or the shot ID.
  • asset_instance (str / dict) – The asset instance dict or ID.
Returns:

Related shot.

Return type:

dict

gazu.shot.all_asset_instances_for_shot(shot)[source]
Parameters:shot (str / dict) – The shot dict or the shot ID.
Returns:Asset instances linked to given shot.
Return type:list
gazu.shot.all_episodes_for_project(project)[source]
Parameters:project (str / dict) – The project dict or the project ID.
Returns:Episodes from database for given project.
Return type:list
gazu.shot.all_previews_for_shot(shot)[source]
Parameters:shot (str / dict) – The shot dict or the shot ID.
Returns:Previews from database for given shot.
Return type:list
gazu.shot.all_sequences_for_episode(episode)[source]
Parameters:sequence (str / dict) – The sequence dict or the sequence ID.
Returns:Sequences which are children of given episode.
Return type:list
gazu.shot.all_sequences_for_project(project)[source]
Parameters:sequence (str / dict) – The sequence dict or the sequence ID.
Returns:Sequences from database for given project.
Return type:list
gazu.shot.all_shots_for_project(project)[source]
Parameters:project (str / dict) – The project dict or the project ID.
Returns:Shots from database or for given project.
Return type:list
gazu.shot.all_shots_for_sequence(sequence)[source]
Parameters:sequence (str / dict) – The sequence dict or the sequence ID.
Returns:Shots which are children of given sequence.
Return type:list
gazu.shot.get_asset_instances_for_shot(shot)[source]

Return the list of asset instances linked to given shot.

gazu.shot.get_episode(episode_id)[source]
Parameters:episode_id (str) – Id of claimed episode.
Returns:Episode corresponding to given episode ID.
Return type:dict
gazu.shot.get_episode_by_name(project, episode_name)[source]
Parameters:
  • project (str / dict) – The project dict or the project ID.
  • episode_name (str) – Name of claimed episode.
Returns:

Episode corresponding to given name and project.

Return type:

dict

gazu.shot.get_episode_from_sequence(sequence)[source]
Parameters:sequence (str / dict) – The sequence dict or the sequence ID.
Returns:Episode which is parent of given sequence.
Return type:dict
gazu.shot.get_sequence(sequence_id)[source]
Parameters:sequence_id (str) – ID of claimed sequence.
Returns:Sequence corresponding to given sequence ID.
Return type:dict
gazu.shot.get_sequence_by_name(project, sequence_name, episode=None)[source]
Parameters:
  • project (str / dict) – The project dict or the project ID.
  • sequence_name (str) – Name of claimed sequence.
  • episode (str / dict) – The episode dict or the episode ID (optional).
Returns:

Seqence corresponding to given name and project (and episode in case of TV Show).

Return type:

dict

gazu.shot.get_sequence_from_shot(shot)[source]
Parameters:shot (str / dict) – The shot dict or the shot ID.
Returns:Sequence which is parent of given shot.
Return type:dict
gazu.shot.get_shot(shot_id)[source]
Parameters:episode_id (str) – Id of claimed episode.
Returns:Shot corresponding to given shot ID.
Return type:dict
gazu.shot.get_shot_by_name(sequence, shot_name)[source]
Parameters:
  • sequence (str / dict) – The sequence dict or the sequence ID.
  • shot_name (str) – Name of claimed shot.
Returns:

Shot corresponding to given name and sequence.

Return type:

dict

gazu.shot.new_episode(project, name)[source]

Create an episode for given project.

Parameters:
  • project (str / dict) – The project dict or the project ID.
  • name (str) – The name of the episode to create.
Returns:

Created episode.

Return type:

dict

gazu.shot.new_sequence(project, episode, name)[source]

Create a sequence for given project and episode.

Parameters:
  • project (str / dict) – The project dict or the project ID.
  • episode (str / dict) – The episode dict or the episode ID.
  • name (str) – The name of the sequence to create.
Returns:

Created sequence.

gazu.shot.new_shot(project, sequence, name, frame_in=None, frame_out=None, data={})[source]

Create a shot for given sequence and project. Add frame in and frame out parameters to shot extra data. Allow to set metadata too.

Parameters:
  • project (str / dict) – The project dict or the project ID.
  • sequence (str / dict) – The sequence dict or the sequence ID.
  • name (str) – The name of the shot to create.
  • frame_in (int) –
  • frame_out (int) –
  • data (dict) – Free field to set metadata of any kind.
Returns:

Created shot.

gazu.shot.remove_asset_instance_from_shot(shot, asset_instance)[source]

Remove link between an asset instance and given shot.

Parameters:
  • shot (str / dict) – The shot dict or the shot ID.
  • asset_instance (str / dict) – The asset instance dict or ID.
gazu.shot.remove_episode(episode)[source]

Remove given episode and related from database.

Parameters:episode (dict / str) – Episode to remove.
gazu.shot.remove_sequence(sequence)[source]

Remove given sequence and related from database.

Parameters:sequence (dict / str) – Sequence to remove.
gazu.shot.remove_shot(shot, force=False)[source]

Remove given shot from database.

Parameters:shot (dict / str) – Shot to remove.
gazu.shot.update_shot(shot)[source]

Save given shot data into the API. Metadata are fully replaced by the ones set on given shot.

Parameters:shot (dict) – The shot dict to update.
Returns:Updated shot.
Return type:dict
gazu.shot.update_shot_data(shot, data={})[source]

Update the metadata for the provided shot. Keys that are not provided are not changed.

Parameters:
  • shot (dict / ID) – The shot dicto or ID to save in database.
  • data (dict) – Free field to set metadata of any kind.
Returns:

Updated shot.

Return type:

dict

gazu.task

gazu.task.add_comment(task, task_status, comment='')[source]

Add comment to given task. Each comment requires a task_status. Since the addition of comment triggers a task status change. Comment text can be empty.

Parameters:
  • task (str / dict) – The task dict or the task ID.
  • task_status (str / dict) – The task status dict or ID.
  • comment (str) – Comment text
Returns:

Created comment.

Return type:

dict

gazu.task.add_preview(task, comment, preview_file_path)[source]

Add a preview to given comment. It it’s a movie, it must be mentioned in the option.

Parameters:
  • task (str / dict) – The task dict or the task ID.
  • comment (str / dict) – The comment or the comment ID.
  • preview_file_path (str) – Path of the file to upload as preview.
Returns:

Created preview file model.

Return type:

dict

gazu.task.add_time_spent(task, person, date, duration)[source]

Add given duration to the already logged duration for given task and person at a given date. Durations must be set in seconds. Date format is YYYY-MM-DD.

Parameters:
  • task (str / dict) – The task dict or the task ID.
  • person (str / dict) – The person who spent the time on given task.
  • date (str) – The date for which time spent must be added.
  • duration (int) – The duration to add on the time spent on given task.
Returns:

Updated time spent entry.

Return type:

dict

gazu.task.all_comments_for_task(task)[source]
Parameters:task (str / dict) – The task dict or the task ID.
Returns:Comments linked to the given task.
gazu.task.all_done_tasks_for_person(person)[source]
Returns:Tasks that are done for given person (only for open projects).
Return type:list
gazu.task.all_task_statuses()[source]
Returns:Task statuses stored in database.
Return type:list
gazu.task.all_task_types()[source]
Returns:Task types stored in database.
Return type:list
gazu.task.all_task_types_for_asset(asset)[source]
Parameters:asset (str / dict) – The asset dict or the asset ID.
Returns:Task types of tasks related to given asset.
Return type:list
gazu.task.all_task_types_for_episode(episode)[source]
Returns:Task types of tasks linked directly to given episode.
Return type:list
gazu.task.all_task_types_for_scene(scene)[source]
Parameters:scene (str / dict) – The scene dict or the scene ID.
Returns:Task types of tasks linked to given scene.
Return type:list
gazu.task.all_task_types_for_sequence(sequence)[source]
Parameters:sequence (str / dict) – The sequence dict or the sequence ID.
Returns:Task types of tasks linked directly to given sequence.
Return type:list
gazu.task.all_task_types_for_shot(shot)[source]
Parameters:shot (str / dict) – The shot dict or the shot ID.
Returns
list: Task types of task linked to given shot.
gazu.task.all_tasks_for_asset(asset)[source]
Parameters:asset (str / dict) – The asset dict or the asset ID.
Returns:Tasks directly linked to given asset.
Return type:list
gazu.task.all_tasks_for_entity_and_task_type(entity, task_type)[source]
Parameters:
  • entity (str / dict) – The entity dict or the entity ID.
  • task_type (str / dict) – The task type dict or ID.
Returns:

Tasks for given entity or task type.

Return type:

list

gazu.task.all_tasks_for_episode(episode)[source]

Retrieve all tasks directly linked to given episode.

gazu.task.all_tasks_for_person(person)[source]
Returns:Tasks that are not done for given person (only for open projects).
Return type:list
gazu.task.all_tasks_for_scene(scene)[source]
Parameters:sequence (str / dict) – The scene dict or the scene ID.
Returns:Tasks linked to given scene.
Return type:list
gazu.task.all_tasks_for_sequence(sequence)[source]
Parameters:sequence (str / dict) – The sequence dict or the sequence ID.
Returns
list: Tasks linked to given sequence.
gazu.task.all_tasks_for_shot(shot)[source]
Parameters:shot (str / dict) – The shot dict or the shot ID.
Returns:Tasks linked to given shot.
Return type:list
gazu.task.all_tasks_for_task_status(project, task_type, task_status)[source]
Parameters:
  • project (str / dict) – The project dict or the project ID.
  • task_type (str / dict) – The task type dict or ID.
  • task_status (str / dict) – The task status dict or ID.
Returns:

Tasks set at given status for given project and task type.

Return type:

list

gazu.task.assign_task(task, person)[source]

Assign one Person to a Task. :param task: The task dict or the task ID. :type task: str / dict :param person: The person dict or the person ID. :type person: str / dict

Returns:(dict) the affected Task
gazu.task.get_last_comment_for_task(task)[source]
Parameters:task (str / dict) – The task dict or the task ID.
Returns:Last comment posted for given task.
gazu.task.get_task(task_id)[source]
Parameters:task_id (str) – Id of claimed task.
Returns:Task matching given ID.
Return type:dict
gazu.task.get_task_by_name(entity, task_type, name='main')[source]

Deprecated.

Parameters:
  • entity (str / dict) – The entity dict or the entity ID.
  • task_type (str / dict) – The task type dict or ID.
  • name (str) – Name of the task to look for.
Returns:

Task matching given name for given entity and task type.

gazu.task.get_task_by_path(project, file_path, entity_type='shot')[source]
Parameters:
  • project (str / dict) – The project dict or the project ID.
  • file_path (str) – The file path to find a related task.
  • entity_type (str) – asset, shot or scene.
Returns:

A task from given file path. This function requires context: the project related to the given path and the related entity type.

Return type:

dict

gazu.task.get_task_status(task)[source]
Parameters:task (str / dict) – The task dict or the task ID.
Returns:A task status object corresponding to status set on given task.
gazu.task.get_task_status_by_name(name)[source]
Parameters:name (str / dict) – The name of claimed task status.
Returns:Task status matching given name.
Return type:dict
gazu.task.get_task_status_by_short_name(task_status_short_name)[source]
Parameters:short_name (str / dict) – The short name of claimed task status.
Returns:Task status matching given short name.
Return type:dict
gazu.task.get_task_type(task_type_id)[source]
Parameters:task_type_id (str) – Id of claimed task type.
Returns:Task type matching given ID.
Return type:dict
gazu.task.get_task_type_by_name(task_type_name)[source]
Parameters:task_type_name (str) – Name of claimed task type.
Returns:Task type object for given name.
Return type:dict
gazu.task.get_time_spent(task, date)[source]

Get the time spent by CG artists on a task at a given date. A field contains the total time spent. Durations are given in seconds. Date format is YYYY-MM-DD.

Parameters:
  • task (str / dict) – The task dict or the task ID.
  • date (str) – The date for which time spent is required.
Returns:

A dict with person ID as key and time spent object as value.

Return type:

dict

gazu.task.new_task(entity, task_type, name='main', task_status=None, assigner=None, assignees=None)[source]

Create a new task for given entity and task type.

Parameters:
  • entity (dict) – Entity for which task is created.
  • task_type (dict) – Task type of created task.
  • name (str) – Name of the task (default is “main”).
  • task_status (dict) – The task status to set (default status is Todo).
  • assigner (dict) – Person who assigns the task.
  • assignees (list) – List of people assigned to the task.
Returns:

Created task.

gazu.task.new_task_status(name, short_name, color)[source]

Create a new task status with the given name, short name and color.

Parameters:
  • name (str) – The name of the task status
  • short_name (str) – The short name of the task status
  • color (str) – The color of the task status has an hexadecimal string
  • # as first character. ex (with) – #00FF00
Returns:

The created task status

Return type:

dict

gazu.task.new_task_type(name)[source]

Create a new task type with the given name.

Parameters:name (str) – The name of the task type
Returns:The created task type
Return type:dict
gazu.task.remove_task(task)[source]

Remove given task from database.

Parameters:task (str / dict) – The task dict or the task ID.
gazu.task.remove_task_status(task_status)[source]

Remove given task status from database.

Parameters:task_status (str / dict) – The task status dict or ID.
gazu.task.set_main_preview(entity, preview_file)[source]

Set given preview as thumbnail of given entity.

Parameters:
  • task (str / dict) – The task dict or the task ID.
  • preview_file (str / dict) – The preview file dict or ID.
Returns:

Created preview file model.

Return type:

dict

gazu.task.set_time_spent(task, person, date, duration)[source]

Set the time spent by a CG artist on a given task at a given date. Durations must be set in seconds. Date format is YYYY-MM-DD.

Parameters:
  • task (str / dict) – The task dict or the task ID.
  • person (str / dict) – The person who spent the time on given task.
  • date (str) – The date for which time spent must be set.
  • duration (int) – The duration of the time spent on given task.
Returns:

Created time spent entry.

Return type:

dict

gazu.task.start_task(task)[source]

Change a task status to WIP and set its real start date to now.

Parameters:task (str / dict) – The task dict or the task ID.
Returns:Modified task.
Return type:dict
gazu.task.task_to_review(task, person, comment, revision=1, change_status=True)[source]

Deprecated. Mark given task as pending, waiting for approval. Author is given through the person argument.

Parameters:
  • task (str / dict) – The task dict or the task ID.
  • person (str / dict) – The person dict or the person ID.
  • comment (str) – Comment text
  • revision (int) – Force revision of related preview file
  • change_status (bool) – If set to false, the task status is not changed.
Returns:

Modified task

Return type:

dict

gazu.user

gazu.user.all_asset_types_for_project(project)[source]
Parameters:project (str / dict) – The project dict or the project ID.
Returns:Asset types for which the user has a task assigned for given project.
Return type:list
gazu.user.all_assets_for_asset_type_and_project(project, asset_type)[source]
Parameters:
  • project (str / dict) – The project dict or the project ID.
  • asset_type (str / dict) – The asset type dict or ID.
Returns:

Assets for given project and asset type and for which the user has a task assigned.

Return type:

list

gazu.user.all_episodes_for_project(project)[source]
Parameters:project (str / dict) – The project dict or the project ID.
Returns:Episodes for which user has tasks assigned for given project.
Return type:list
gazu.user.all_open_projects()[source]
Returns:Projects for which the user is part of the team. Admins see all projects
Return type:list
gazu.user.all_scenes_for_sequence(sequence)[source]
Parameters:sequence (str / dict) – The sequence dict or the sequence ID.
Returns:Scenes for which user has tasks assigned for given sequence.
Return type:list
gazu.user.all_sequences_for_project(project)[source]
Parameters:project (str / dict) – The project dict or the project ID.
Returns:Sequences for which user has tasks assigned for given project.
Return type:list
gazu.user.all_shots_for_sequence(sequence)[source]
Parameters:sequence (str / dict) – The sequence dict or the sequence ID.
Returns:Shots for which user has tasks assigned for given sequence.
Return type:list
gazu.user.all_task_types_for_asset(asset)[source]
Parameters:asset (str / dict) – The asset dict or the asset ID.
Returns:Task Types of tasks assigned to current user for given asset.
Return type:list
gazu.user.all_task_types_for_scene(scene)[source]
Parameters:scene (str / dict) – The scene dict or the scene ID.
Returns:Task Types of tasks assigned to current user for given scene.
Return type:list
gazu.user.all_task_types_for_sequence(sequence)[source]

return the list of task_tyes for given asset and current user.

gazu.user.all_task_types_for_shot(shot)[source]
Parameters:shot (str / dict) – The shot dict or the shot ID.
Returns:Task Types of tasks assigned to current user for given shot.
Return type:list
gazu.user.all_tasks_for_asset(asset)[source]
Parameters:asset (str / dict) – The asset dict or the asset ID.
Returns:Tasks for given asset and current user.
Return type:list
gazu.user.all_tasks_for_scene(scene)[source]
Parameters:scene (str / dict) – The scene dict or the scene ID.
Returns:Tasks assigned to current user for given scene.
Return type:list
gazu.user.all_tasks_for_sequence(sequence)[source]

Return the list of tasks for given asset and current user.

gazu.user.all_tasks_for_shot(shot)[source]
Parameters:shot (str / dict) – The shot dict or the shot ID.
Returns:Tasks assigned to current user for given shot.
Return type:list
gazu.user.all_tasks_to_do()[source]
Returns:Tasks assigned to current user which are not complete.
Return type:list
gazu.user.log_desktop_session_log_in()[source]

Add a log entry to mention that the user logged in his computer.

Returns:Desktop session log entry.
Return type:dict

gazu.playlist

gazu.playlist.all_playlists()[source]
Returns:All playlists for all projects.
Return type:list
gazu.playlist.all_playlists_for_project(project)[source]
Parameters:project (str / dict) – The project dict or the project ID.
Returns:All playlists for the given project
Return type:list
gazu.playlist.all_shots_for_playlist(playlist)[source]
Parameters:playlist (str / dict) – The playlist dict or the playlist ID.
Returns:All shots linked to the given playlist
Return type:list
gazu.playlist.get_playlist(playlist)[source]
Parameters:playlist (str / dict) – The playlist dict or the playlist ID.
Returns:playlist object for given id.
Return type:dict
gazu.playlist.get_playlist_by_name(project, name)[source]
Parameters:
  • project (str / dict) – The project dict or the project ID.
  • name (str) – The playlist name
Returns:

Playlist matching given name for given project.

Return type:

dict

gazu.playlist.new_playlist(project, name)[source]

Create a new playlist in the database for given project.

Parameters:
  • project (str / dict) – The project dict or the project ID.
  • name (str) – Playlist name.
Returns:

Created playlist.

Return type:

dict

gazu.playlist.update_playlist(playlist)[source]

Save given playlist data into the API. Metadata are fully replaced by the ones set on given playlist.

Parameters:playlist (dict) – The playlist dict to update.
Returns:Updated playlist.
Return type:dict

gazu.exceptions

exception gazu.exception.AuthFailedException[source]

Error raised when user credentials are wrong.

exception gazu.exception.MethodNotAllowedException[source]

Error raised when a 405 error (method not handled) is sent by the API.

exception gazu.exception.NotAllowedException[source]

Error raised when a 403 error (not authorized) is sent by the API.

exception gazu.exception.NotAuthenticatedException[source]

Error raised when a 401 error (not authenticated) is sent by the API.

exception gazu.exception.ParameterException[source]

Error raised when a 400 error (argument error) is sent by the API.

exception gazu.exception.RouteNotFoundException[source]

Error raised when a 404 error (not found) is sent by the API.

exception gazu.exception.ServerErrorException[source]

Error raised when a 500 error (server error) is sent by the API.

exception gazu.exception.TooBigFileException[source]

Error raised when a 413 error (payload too big error) is sent by the API.

exception gazu.exception.UploadFailedException[source]

Error raised when an error while uploading a file, mainly to handle cases where processing that occurs on the remote server fails.