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 multiple modules:

  • asset: functions related to asset and asset types.

  • cache: functions related to the cache.

  • casting: functions related to casting.

  • client: generic functions to deal with the API.

  • concept: functions related to concepts.

  • edit: functions related to edits.

  • entity: functions related to entities.

  • exceptions: exceptions raised by Gazu.

  • files: functions related to file path generation.

  • person: functions related to studio members.

  • playlist: functions related to project playlists.

  • project: functions related to running productions.

  • scene: functions related to layout scenes (which will lead to shots).

  • shot: functions related to shots, sequences and episodes.

  • sync: functions related to sync.

  • task: functions related to tasks, task types and assignations.

  • user: functions related to current user data.

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

gazu

gazu.log_in(email, password, totp=None, email_otp=None, fido_authentication_response=None, recovery_code=None, client=<gazu.client.KitsuClient object>)[source]
gazu.get_host(client=<gazu.client.KitsuClient object>)[source]
gazu.set_host(url, client=<gazu.client.KitsuClient object>)[source]
gazu.send_email_otp(email, client=<gazu.client.KitsuClient object>)[source]
gazu.log_out(client=<gazu.client.KitsuClient object>)[source]
gazu.refresh_token(client=<gazu.client.KitsuClient object>)[source]
gazu.get_event_host(client=<gazu.client.KitsuClient object>)[source]
gazu.set_event_host(url, client=<gazu.client.KitsuClient object>)[source]

gazu.asset

gazu.asset.all_asset_instances_for_asset(asset, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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(client=<gazu.client.KitsuClient object>)[source]
Returns:

Asset types stored in the database.

Return type:

list

gazu.asset.all_asset_types_for_project(project, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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(client=<gazu.client.KitsuClient object>)[source]
Returns:

Assets stored in the database for open projects.

Return type:

list

gazu.asset.all_assets_for_project(project, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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_type_id, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[source]
Parameters:

name (str) – name of asset type.

Returns:

Asset Type matching given name.

Return type:

dict

gazu.asset.get_asset_type_from_asset(asset, client=<gazu.client.KitsuClient object>)[source]
Parameters:

asset (dict) – The asset dict.

Returns:

Asset type which is the type of given asset.

Return type:

dict

gazu.asset.get_asset_url(asset, client=<gazu.client.KitsuClient object>)[source]
Parameters:

asset (str / dict) – The asset dict or the asset ID.

Returns:

Web url associated to the given asset

Return type:

url (str)

gazu.asset.get_episode_from_asset(asset, client=<gazu.client.KitsuClient object>)[source]
Parameters:

asset (dict) – The asset dict.

Returns:

Episode which is parent of given asset.

Return type:

dict

gazu.asset.new_asset(project, asset_type, name, description='', extra_data={}, episode=None, client=<gazu.client.KitsuClient object>)[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.

  • episode (str / dict) – The episode this asset is linked to.

Returns:

Created asset.

Return type:

dict

gazu.asset.new_asset_asset_instance(asset, asset_to_instantiate, description='', client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[source]

Remove given asset from database.

Parameters:

asset (dict) – Asset to remove.

gazu.asset.remove_asset_type(asset_type, client=<gazu.client.KitsuClient object>)[source]

Remove given asset type from database.

Parameters:

asset_type (dict) – Asset type to remove.

gazu.asset.update_asset(asset, client=<gazu.client.KitsuClient object>)[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_data(asset, data={}, client=<gazu.client.KitsuClient object>)[source]

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

Parameters:
  • asset (dict / ID) – The asset dict or ID to save in database.

  • data (dict) – Free field to set metadata of any kind.

Returns:

Updated asset.

Return type:

dict

gazu.asset.update_asset_type(asset_type, client=<gazu.client.KitsuClient object>)[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.cache

gazu.cache.cache(function, maxsize=300, expire=120)[source]

Decorator that generate cache wrapper and that adds cache feature to target function. A max cache size and and expiration time (in seconds) can be set too.

Parameters:
  • function (func) – Decorated function:

  • maxsize – Number of value stored in cache (300 by default).

  • expire – Time to live in seconds of stored value (disabled by default)

gazu.cache.clear_all()[source]

Clear all cached functions.

gazu.cache.disable()[source]

Disable caching on all decorated functions.

gazu.cache.enable()[source]

Enable caching on all decorated functions.

gazu.cache.get_cache_key(args, kwargs)[source]

Serialize arguments to get a cache key. It will be used to store function results.

Returns:

generated key

Return type:

str

gazu.cache.get_value(cache_store, key)[source]

It generates a deep copy of the requested value. It’s needed because if a pointer is returned, the value can be changed. Which leads to a modified cache and unexpected results.

Returns:

Value matching given key inside given cache store

gazu.cache.insert_value(function, cache_store, args, kwargs)[source]

Serialize function call arguments and store function result in given cache store.

Parameters:
  • function (func) – The function to cache value for.

  • cache_store (dict) – The cache which will contain the value to cache.

  • args – The arguments for which a cache must be set.

  • kwargs – The arguments for which a cache must be set.

Returns:

The cached value.

gazu.cache.is_cache_enabled(state)[source]
Parameters:

state – The state describing the cache state.

Returns:

True if cache is enabled for given state.

gazu.cache.is_cache_expired(memo, state, key)[source]

Check if cache is expired (outdated) for given wrapper state and cache key.

Parameters:
  • memo (dict) – The function cache

  • state (dict) – The parameters of the cache (enabled, expire, maxsize)

  • key – The key to check

Returns:

True if cache value is expired.

gazu.cache.remove_oldest_entry(memo, maxsize)[source]

Remove the oldest cache entry if there is more value stored than allowed.

Params:

memo (dict): Cache used for function memoization. maxsize (int): Maximum number of entries for the cache.

Returns:

Oldest entry for given cache.

gazu.casting

Parameters:

project (dict) – The project

Returns:

Entity links for given project.

Return type:

dict

gazu.casting.get_asset_cast_in(asset, client=<gazu.client.KitsuClient object>)[source]

Return entity list where given asset is casted. :param asset: The asset dict :type asset: dict

Returns:

Entity list where given asset is casted.

Return type:

dict

gazu.casting.get_asset_casting(asset, client=<gazu.client.KitsuClient object>)[source]

Return casting for given asset. [{“asset_id”: “asset-1”, “nb_occurences”: 3}]} :param asset: The asset dict :type asset: dict

Returns:

Casting for given asset.

Return type:

dict

gazu.casting.get_asset_type_casting(project, asset_type, client=<gazu.client.KitsuClient object>)[source]

Return casting for given 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.

Returns:

Casting of the given asset_type.

Return type:

dict

gazu.casting.get_episode_casting(episode, client=<gazu.client.KitsuClient object>)[source]

Return casting for given episode. [{“episode_id”: “episode-1”, “nb_occurences”: 3}]} :param episode: The episode dict :type episode: dict

Returns:

Casting for given episode.

Return type:

dict

gazu.casting.get_sequence_casting(sequence, client=<gazu.client.KitsuClient object>)[source]

Return casting for given sequence.

Parameters:

sequence (dict) – The sequence dict

Returns:

Casting of the given sequence.

Return type:

dict

gazu.casting.get_shot_casting(shot, client=<gazu.client.KitsuClient object>)[source]

Return casting for given shot.

Parameters:

shot (dict) – The shot dict

Returns:

Casting of the given shot.

Return type:

dict

gazu.casting.update_asset_casting(project, asset, casting, client=<gazu.client.KitsuClient object>)[source]

Change casting of given asset with given casting (list of asset ids displayed into the asset).

Parameters:
  • asset (str / dict) – The asset dict or the asset ID.

  • casting (dict) – The casting description.

Returns:

Related asset.

Return type:

dict

gazu.casting.update_episode_casting(project, episode, casting, client=<gazu.client.KitsuClient object>)[source]

Change casting of given episode with given casting (list of asset ids displayed into the episode).

Parameters:
  • episode (str / dict) – The episode dict or the episode ID.

  • casting (dict) – The casting description.

  • Excasting = [{“asset_id”: “asset-1”, “nb_occurences”: 3}]

Returns:

Related episode.

Return type:

dict

gazu.casting.update_shot_casting(project, shot, casting, client=<gazu.client.KitsuClient object>)[source]

Change casting of given shot with given casting (list of asset ids displayed into the shot).

Parameters:
  • shot (str / dict) – The shot dict or the shot ID.

  • casting (dict) – The casting description.

  • Excasting = [{“asset_id”: “asset-1”, “nb_occurences”: 3}]

Returns:

Related shot.

Return type:

dict

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, client=None)[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:
gazu.client.create(model_name, data, client=<gazu.client.KitsuClient object>)[source]

Create an entry for given model and data.

Parameters:
  • model (str) – The model type involved

  • data (str) – The data to use for creation

Returns:

Created entry

Return type:

dict

gazu.client.delete(path, params=None, client=<gazu.client.KitsuClient object>)[source]

Run a delete request toward given path for configured host.

Returns:

The request result.

gazu.client.download(path, file_path, params=None, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[source]

Run a get request toward given path for configured host.

Returns:

The request result.

gazu.client.get_api_url_from_host(client=<gazu.client.KitsuClient object>)[source]
Returns:

Zou url, retrieved from host.

gazu.client.get_api_version(client=<gazu.client.KitsuClient object>)[source]
Returns:

Current version of the API.

Return type:

str

gazu.client.get_current_user(client=<gazu.client.KitsuClient object>)[source]
Returns:

User database information for user linked to auth tokens.

Return type:

dict

gazu.client.get_event_host(client=<gazu.client.KitsuClient object>)[source]
Returns:

Host on which listening for events.

gazu.client.get_file_data_from_url(url, full=False, client=<gazu.client.KitsuClient object>)[source]

Return data found at given url.

gazu.client.get_full_url(path, client=<gazu.client.KitsuClient object>)[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(client=<gazu.client.KitsuClient object>)[source]
Returns:

Host on which requests are sent.

gazu.client.host_is_up(client=<gazu.client.KitsuClient object>)[source]
Returns:

True if the host is up.

gazu.client.host_is_valid(client=<gazu.client.KitsuClient object>)[source]

Check if the host is valid by simulating a fake login. :returns: True if the host is valid.

gazu.client.import_data(model_name, data, client=<gazu.client.KitsuClient object>)[source]
Parameters:
  • model_name (str) – The data model to import

  • data (dict) – The data to import

gazu.client.make_auth_header(client=<gazu.client.KitsuClient object>)[source]
Returns:

Headers required to authenticate.

gazu.client.post(path, data, client=<gazu.client.KitsuClient object>)[source]

Run a post request toward given path for configured host.

Returns:

The request result.

gazu.client.put(path, data, client=<gazu.client.KitsuClient object>)[source]

Run a put request toward given path for configured host.

Returns:

The request result.

gazu.client.set_event_host(new_host, client=<gazu.client.KitsuClient object>)[source]
Returns:

Set currently configured host on which listening for events.

gazu.client.set_host(new_host, client=<gazu.client.KitsuClient object>)[source]
Returns:

Set currently configured host on which requests are sent.

gazu.client.set_tokens(new_tokens, client=<gazu.client.KitsuClient object>)[source]

Store authentication token to reuse them for all requests.

Parameters:

new_tokens (dict) – Tokens to use for authentication.

gazu.client.update(model_name, model_id, data, client=<gazu.client.KitsuClient object>)[source]

Update an entry for given model, id and data.

Parameters:
  • model (str) – The model type involved

  • id (str) – The target model id

  • data (dict) – The data to update

Returns:

Updated entry

Return type:

dict

gazu.client.upload(path, file_path, data={}, extra_files=[], client=<gazu.client.KitsuClient object>)[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.concept

gazu.concept.all_concepts(client=<gazu.client.KitsuClient object>)[source]
Returns:

All concepts from database.

Return type:

list

gazu.concept.all_concepts_for_project(project, client=<gazu.client.KitsuClient object>)[source]
Parameters:

project (str / dict) – The project dict or the project ID.

Returns:

Concepts from database or for given project.

Return type:

list

gazu.concept.all_previews_for_concept(concept, client=<gazu.client.KitsuClient object>)[source]
Parameters:

concept (str / dict) – The concept dict or the concept ID.

Returns:

Previews from database for given concept.

Return type:

list

gazu.concept.get_concept(concept_id, client=<gazu.client.KitsuClient object>)[source]
Parameters:

concept_id (str) – ID of claimed concept.

Returns:

Concept corresponding to given concept ID.

Return type:

dict

gazu.concept.get_concept_by_name(project, concept_name, client=<gazu.client.KitsuClient object>)[source]
Parameters:
  • project (str / dict) – The project dict or the project ID.

  • concept_name (str) – Name of claimed concept.

Returns:

Concept corresponding to given name and project.

Return type:

dict

gazu.concept.new_concept(project, name, description=None, data={}, entity_concept_links=[], client=<gazu.client.KitsuClient object>)[source]

Create a concept for given project. Allow to set metadata too.

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

  • name (str) – The name of the concept to create.

  • data (dict) – Free field to set metadata of any kind.

  • entity_concept_links (list) – List of entities to tag.

Returns:

Created concept.

gazu.concept.remove_concept(concept, force=False, client=<gazu.client.KitsuClient object>)[source]

Remove given concept from database.

Parameters:

concept (dict / str) – Concept to remove.

gazu.concept.update_concept(concept, client=<gazu.client.KitsuClient object>)[source]

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

Parameters:

concept (dict) – The concept dict to update.

Returns:

Updated concept.

Return type:

dict

gazu.edit

gazu.edit.all_edits_for_project(project, client=<gazu.client.KitsuClient object>)[source]
Parameters:

project (str / dict) – The project dict or the project ID.

Returns:

Edits from database or for given project.

Return type:

list

gazu.edit.all_previews_for_edit(edit, client=<gazu.client.KitsuClient object>)[source]
Parameters:

edit (str / dict) – The edit dict or the edit ID.

Returns:

Previews from database for given edit.

Return type:

list

gazu.edit.get_edit(edit_id, client=<gazu.client.KitsuClient object>)[source]
Parameters:

edit_id (str) – ID of claimed edit.

Returns:

Edit corresponding to given edit ID.

Return type:

dict

gazu.edit.get_edit_by_name(project, edit_name, client=<gazu.client.KitsuClient object>)[source]
Parameters:
  • project (str / dict) – The project dict or the project ID.

  • edit_name (str) – Name of claimed edit.

Returns:

Edit corresponding to given name and sequence.

Return type:

dict

gazu.edit.get_edit_url(edit, client=<gazu.client.KitsuClient object>)[source]
Parameters:

edit (str / dict) – The edit dict or the edit ID.

Returns:

Web url associated to the given edit

Return type:

url (str)

gazu.edit.new_edit(project, name, description=None, data={}, episode=None, client=<gazu.client.KitsuClient object>)[source]

Create an edit for given project (and episode if given). Allow to set metadata too.

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

  • name (str) – The name of the edit to create.

  • description (str) – The description of the edit to create.

  • data (dict) – Free field to set metadata of any kind.

  • episode (str / dict) – The episode dict or the episode ID.

Returns:

Created edit.

gazu.edit.remove_edit(edit, force=False, client=<gazu.client.KitsuClient object>)[source]

Remove given edit from database.

Parameters:

edit (dict / str) – Edit to remove.

gazu.edit.update_edit(edit, client=<gazu.client.KitsuClient object>)[source]

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

Parameters:

edit (dict) – The edit dict to update.

Returns:

Updated edit.

Return type:

dict

gazu.edit.update_edit_data(edit, data={}, client=<gazu.client.KitsuClient object>)[source]

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

Parameters:
  • edit (dict / ID) – The edit dict or ID to save in database.

  • data (dict) – Free field to set metadata of any kind.

Returns:

Updated edit.

Return type:

dict

gazu.entity

gazu.entity.all_entities(client=<gazu.client.KitsuClient object>)[source]
Returns:

Retrieve all entities

Return type:

list

gazu.entity.all_entities_with_tasks_linked_to_entity(entity, client=<gazu.client.KitsuClient object>)[source]
Parameters:

entity (dict) – Entity to get linked entities.

Returns:

Retrieve all entities linked to given entity.

Return type:

list

gazu.entity.all_entity_types(client=<gazu.client.KitsuClient object>)[source]
Returns:

Entity types listed in database.

Return type:

list

gazu.entity.get_entity(entity_id, client=<gazu.client.KitsuClient object>)[source]
Parameters:

entity_id (str) – ID of claimed entity.

Returns:

Retrieve entity matching given ID (it can be an entity of any kind: asset, shot, sequence, episode, etc).

Return type:

dict

gazu.entity.get_entity_by_name(entity_name, project=None, client=<gazu.client.KitsuClient object>)[source]
Parameters:
  • name (str) – The name of the claimed entity.

  • project (str, dict) – Project ID or dict.

Returns:

Retrieve entity matching given name (and project if given).

gazu.entity.get_entity_type(entity_type_id, client=<gazu.client.KitsuClient object>)[source]
Parameters:

entity_type_id (str) – ID of claimed entity type.

Returns:

Retrieve entity type matching given ID (It can be an entity type of any kind).

gazu.entity.get_entity_type_by_name(entity_type_name, client=<gazu.client.KitsuClient object>)[source]
Parameters:

entity_type_name (str) – The name of the claimed entity type

Returns:

Retrieve entity type matching given name.

gazu.entity.guess_from_path(project_id, path, sep='/')[source]

Get list of possible project file tree templates matching a file path and data ids corresponding to template tokens.

Parameters:
  • project_id (str) – Project id of given file

  • file_path (str) – Path to a file

  • sep (str) – File path separator, defaults to “/”

Returns:

dictionnaries with the corresponding entities and template name.

Return type:

list

gazu.entity.new_entity_type(name, client=<gazu.client.KitsuClient object>)[source]

Creates an entity type with the given name.

Parameters:

name (str, client=default) – The name of the entity type

Returns:

The created entity type

Return type:

dict

gazu.entity.remove_entity(entity, force=False, client=<gazu.client.KitsuClient object>)[source]

Remove given entity from database.

Parameters:

entity (dict) – Entity to remove.

gazu.exceptions

exception gazu.exception.AuthFailedException[source]

Error raised when user credentials are wrong.

exception gazu.exception.DownloadFileException[source]

Error raised when a file can’t be downloaded.

exception gazu.exception.FileDoesntExistException[source]

Error raised when a file should be existed when we submit a preview.

exception gazu.exception.HostException[source]

Error raised when host is not valid.

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.ProjectDoesntExistException[source]

Error raised when a project isn’t available.

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.TaskMustBeADictException[source]

Error raised when a task should be a dict.

exception gazu.exception.TaskStatusNotFoundException[source]

Error raised when a task status is not found.

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.

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, file_status=None, client=<gazu.client.KitsuClient object>)[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

  • file_status (str / dict) – The file status

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, file_status=None, client=<gazu.client.KitsuClient object>)[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

  • file_status (str / dict) – The file status

Returns:

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

Return type:

list

gazu.files.all_output_files_for_project(project, output_type=None, task_type=None, name=None, representation=None, file_status=None, client=<gazu.client.KitsuClient object>)[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

  • file_status (str / dict) – The file status

Returns:

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

Return type:

list

gazu.files.all_output_types(client=<gazu.client.KitsuClient object>)[source]
Returns:

Output types listed in database.

Return type:

list

gazu.files.all_output_types_for_asset_instance(asset_instance, temporal_entity, client=<gazu.client.KitsuClient object>)[source]
Returns:

Output types for given asset instance and entity (shot or scene).

Return type:

list

gazu.files.all_output_types_for_entity(entity, client=<gazu.client.KitsuClient object>)[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(client=<gazu.client.KitsuClient object>)[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='/', client=<gazu.client.KitsuClient object>)[source]

From the file 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

  • appeared. (the asset instance) –

  • 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='/', client=<gazu.client.KitsuClient object>)[source]

From the file 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='/', client=<gazu.client.KitsuClient object>)[source]

From the file 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_attachment_file(attachment_file, file_path, client=<gazu.client.KitsuClient object>)[source]

Download given attachment file and save it at given location.

Parameters:
  • attachment_file (str / dict) – The attachment file dict or ID.

  • file_path (str) – Location on hard drive where to save the file.

gazu.files.download_person_avatar(person, file_path, client=<gazu.client.KitsuClient object>)[source]

Download given person’s avatar and save it at given location. :param person: The person dict or ID. :type person: str / dict :param file_path: Location on hard drive where to save the file. :type file_path: str

gazu.files.download_preview_file(preview_file, file_path, client=<gazu.client.KitsuClient object>)[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_cover(preview_file, file_path, client=<gazu.client.KitsuClient object>)[source]

Download given preview file cover and save it at given location. :param preview_file: The preview file dict or ID. :type preview_file: str / dict :param file_path: Location on hard drive where to save the file. :type file_path: str

gazu.files.download_preview_file_thumbnail(preview_file, file_path, client=<gazu.client.KitsuClient object>)[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.download_project_avatar(project, file_path, client=<gazu.client.KitsuClient object>)[source]

Download given project’s avatar and save it at given location. :param project: The project dict or ID. :type project: str / dict :param file_path: Location on hard drive where to save the file. :type file_path: str

gazu.files.download_working_file(working_file, file_path=None, client=<gazu.client.KitsuClient object>)[source]

Download given working file and save it at given location.

Parameters:
  • working_file (str / dict) – The working file dict or ID.

  • file_path (str) – Location on hard drive where to save the file.

gazu.files.get_all_attachment_files_for_task(task, client=<gazu.client.KitsuClient object>)[source]

Retrieves all the attachment files for a given task.

Parameters:

task (str, id) – Target task

gazu.files.get_all_preview_files_for_task(task, client=<gazu.client.KitsuClient object>)[source]

Retrieves all the preview files for a given task.

Parameters:

task (str, id) – Target task

gazu.files.get_all_working_files_for_entity(entity, task=None, name=None, client=<gazu.client.KitsuClient object>)[source]

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

gazu.files.get_attachment_file(attachment_file_id, client=<gazu.client.KitsuClient object>)[source]

Return attachment file object corresponding to given ID.

Parameters:

attachment_file_id (str) – The attachment file ID.

gazu.files.get_file_status(status_id, client=<gazu.client.KitsuClient object>)[source]

Return file status object corresponding to given ID.

Parameters:

status_id (str) – The files status ID.

gazu.files.get_file_status_by_name(name, client=<gazu.client.KitsuClient object>)[source]

Return file status object corresponding to given name

Parameters:

name (str) – The files status name.

gazu.files.get_last_asset_instance_output_revision(asset_instance, temporal_entity, output_type, task_type, name='master', client=<gazu.client.KitsuClient object>)[source]

Generate last output revision for given asset instance.

gazu.files.get_last_entity_output_revision(entity, output_type, task_type, name='master', client=<gazu.client.KitsuClient object>)[source]
Parameters:
  • entity (str / dict, client=default) – The entity dict or ID.

  • output_type (str / dict, client=default) – The entity dict or ID.

  • task_type (str / dict, client=default) – The entity dict or ID.

  • name (str, client=default) – 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, file_status=None, client=<gazu.client.KitsuClient object>)[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 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

  • file_status (str / dict) – The file status

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, file_status=None, client=<gazu.client.KitsuClient object>)[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

  • file_status (str / dict) – The file status

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', client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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', client=<gazu.client.KitsuClient object>)[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', client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[source]
Parameters:

path (str) – Path of claimed output file.

Returns:

Output file matching given path.

Return type:

dict

gazu.files.get_output_type(output_type_id, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[source]
Parameters:

output_type_name (str) – name of claimed output type.

Returns:

Output type matching given name.

Return type:

dict

gazu.files.get_preview_file(preview_file_id, client=<gazu.client.KitsuClient object>)[source]
Parameters:

preview_file_id (str) – ID of claimed preview file.

Returns:

Preview file corresponding to given ID.

Return type:

dict

gazu.files.get_preview_file_url(preview_file, client=<gazu.client.KitsuClient object>)[source]

Return given preview file URL

Parameters:

preview_file (str / dict) – The preview file dict or ID.

gazu.files.get_software(software_id, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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='/', file_status_id=None, client=<gazu.client.KitsuClient object>)[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. file_status_id (id): The id of the file status to set at creation

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='/', file_status_id=None, client=<gazu.client.KitsuClient object>)[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

  • abc (to build folders based on extensions like) –

  • jpg

  • etc.

  • sep (str) – OS separator.

  • file_status_id (id) – The id of the file status to set at creation

Returns:

Created output file.

gazu.files.new_file_status(name, color, client=<gazu.client.KitsuClient object>)[source]

Create a new file status if not existing yet.

gazu.files.new_output_type(name, short_name, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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='/', client=<gazu.client.KitsuClient object>)[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.remove_preview_file(preview_file, client=<gazu.client.KitsuClient object>)[source]

Remove given preview file from database.

Parameters:

preview_file (str / dict) – The preview_file dict or ID.

gazu.files.set_project_file_tree(project, file_tree_name, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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_preview(preview_file, data, client=<gazu.client.KitsuClient object>)[source]

Update the data of given preview file.

Parameters:

preview_file (str / dict) – The preview file dict or ID.

Returns:

Modified preview file

Return type:

dict

gazu.files.update_project_file_tree(project, file_tree, client=<gazu.client.KitsuClient object>)[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.files.upload_person_avatar(person, file_path, client=<gazu.client.KitsuClient object>)[source]

Upload given file as person avatar.

Parameters:
  • person (str / dict) – The person dict or the person ID.

  • file_path (str) – Path of the file to upload as avatar.

gazu.files.upload_project_avatar(project, file_path, client=<gazu.client.KitsuClient object>)[source]

Upload given file as project avatar.

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

  • file_path (str) – Path of the file to upload as avatar.

gazu.files.upload_working_file(working_file, file_path, client=<gazu.client.KitsuClient object>)[source]

Save given file in working file storage.

Parameters:
  • working_file (str / dict) – The working file dict or ID.

  • file_path (str) – Location on hard drive where to save the file.

gazu.person

gazu.person.all_departments(client=<gazu.client.KitsuClient object>)[source]
Returns:

Departments listed in database.

Return type:

list

gazu.person.all_organisations(client=<gazu.client.KitsuClient object>)[source]
Returns:

Organisations listed in database.

Return type:

list

gazu.person.all_persons(client=<gazu.client.KitsuClient object>)[source]
Returns:

Persons listed in database.

Return type:

list

gazu.person.change_password_for_person(person, password, client=<gazu.client.KitsuClient object>)[source]

Change the password for given person.

Parameters:
  • person (str / dict) – The person dict or the person ID.

  • password (str) – The new password.

Returns:

success or not.

Return type:

dict

gazu.person.get_all_month_time_spents(id, date, client=<gazu.client.KitsuClient object>)[source]
Parameters:
  • id (str) – An uuid identifying a person.

  • date (datetime.date) – The date of the month to query.

Returns:

All of the person’s time spents for the given month.

Return type:

list

gazu.person.get_department(department_id, client=<gazu.client.KitsuClient object>)[source]
Parameters:

department_id (str) – An uuid identifying a department.

Returns:

Department corresponding to given department_id.

Return type:

dict

gazu.person.get_department_by_name(name, client=<gazu.client.KitsuClient object>)[source]
Parameters:

name (str) – Department name.

Returns:

Department corresponding to given name.

Return type:

dict

gazu.person.get_organisation(client=<gazu.client.KitsuClient object>)[source]
Returns:

Database information for organisation linked to auth tokens.

Return type:

dict

gazu.person.get_person(id, relations=False, client=<gazu.client.KitsuClient object>)[source]
Parameters:
  • id (str) – An uuid identifying a person.

  • relations (bool) – Whether to get the relations for the given person.

Returns:

Person corresponding to given id.

Return type:

dict

gazu.person.get_person_by_desktop_login(desktop_login, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, first_name=None, last_name=None, client=<gazu.client.KitsuClient object>)[source]
Parameters:
  • full_name (str) – User’s full name

  • first_name (str) – User’s first name

  • last_name (str) – User’s last name

Returns:

Person corresponding to given name.

Return type:

dict

gazu.person.get_person_url(person, client=<gazu.client.KitsuClient object>)[source]
Parameters:

person (str / dict) – The person dict or the person ID.

Returns:

Web url associated to the given person

Return type:

url (str)

gazu.person.get_presence_log(year, month, client=<gazu.client.KitsuClient object>)[source]
Parameters:
  • year (int) –

  • month (int) –

Returns:

The presence log table for given month and year.

gazu.person.get_time_spents_range(person_id, start_date, end_date, client=<gazu.client.KitsuClient object>)[source]

Gets the time spents of the current user for the given date range.

Parameters:
  • person_id (str) – An uuid identifying a person.

  • start_date (str) – The first day of the date range as a date string with the following format: YYYY-MM-DD

  • end_date (str) – The last day of the date range as a date string with the following format: YYYY-MM-DD

Returns:

All of the person’s time spents

Return type:

list

gazu.person.new_bot(name, email, role='user', departments=[], active=True, expiration_date=None, client=<gazu.client.KitsuClient object>)[source]

Create a new bot based on given parameters. His access token will be in the return dict.

Parameters:
  • name (str) – the name of the bot.

  • email (str) – the email of the bot.

  • role (str) – user, manager, admin (wich match CG artist, Supervisor and studio manager)

  • departments (list) – The departments for the person.

  • active (bool) – Whether the person is active or not.

  • expiration_date (str) – The expiration date for the bot.

Returns:

Created bot.

Return type:

dict

gazu.person.new_department(name, color='', archived=False, client=<gazu.client.KitsuClient object>)[source]

Create a new departement based on given parameters.

Parameters:
  • name (str) – the name of the departement.

  • color (str) – the color of the departement.

  • archived (bool) – Whether the departement is archived or not.

Returns:

Created departement.

Return type:

dict

gazu.person.new_person(first_name, last_name, email, phone='', role='user', desktop_login='', departments=[], password=None, active=True, contract_type='open-ended', client=<gazu.client.KitsuClient object>)[source]

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

Parameters:
  • first_name (str) – the first name of the person.

  • last_name (str) – the last name of the person.

  • email (str) – the email of the person.

  • phone (str) – the phone number of the person.

  • 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.

  • departments (list) – The departments for the person.

  • password (str) – The password for the person.

  • active (bool) – Whether the person is active or not.

Returns:

Created person.

Return type:

dict

gazu.person.remove_bot(bot, force=False, client=<gazu.client.KitsuClient object>)[source]

Remove given bot from database.

Parameters:

bot (dict) – Bot to remove.

gazu.person.remove_person(person, force=False, client=<gazu.client.KitsuClient object>)[source]

Remove given person from database.

Parameters:

person (dict) – Person to remove.

gazu.person.set_avatar(person, file_path, client=<gazu.client.KitsuClient object>)[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.person.update_bot(bot, client=<gazu.client.KitsuClient object>)[source]

Update a bot.

Parameters:

bot (dict) – The bot dict that needs to be upgraded.

Returns:

The updated bot.

Return type:

dict

gazu.person.update_person(person, client=<gazu.client.KitsuClient object>)[source]

Update a person.

Parameters:

person (dict) – The person dict that needs to be upgraded.

Returns:

The updated person.

Return type:

dict

gazu.playlist

gazu.playlist.add_entity_to_playlist(playlist, entity, preview_file=None, persist=True, client=<gazu.client.KitsuClient object>)[source]

Add an entity to the playlist, use the last uploaded preview as revision to review.

Parameters:
  • playlist (dict) – Playlist object to modify.

  • entity (str / dict) – The entity to add or its ID.

  • preview_file (str / dict) – Set it to force a give revision to review.

  • persist (bool) – Set it to True to save the result to the API.

Returns:

Updated playlist.

Return type:

dict

gazu.playlist.all_playlists(client=<gazu.client.KitsuClient object>)[source]
Returns:

All playlists for all projects.

Return type:

list

gazu.playlist.all_playlists_for_episode(episode, client=<gazu.client.KitsuClient object>)[source]
Parameters:

episode (str / dict) – The episode dict or the episode ID.

Returns:

All playlists for the given episode.

Return type:

list

gazu.playlist.all_playlists_for_project(project, client=<gazu.client.KitsuClient object>, page=1)[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, client=<gazu.client.KitsuClient object>)[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_entity_preview_files(entity, client=<gazu.client.KitsuClient object>)[source]

Get all preview files grouped by task type for a given entity.

Parameters:

entity (str / dict) – The entity to retrieve files from or its ID.

Returns:

A dict where keys are task type IDs and value array of revisions.

Return type:

dict

gazu.playlist.get_playlist(playlist, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, episode=None, for_entity='shot', for_client=False, client=<gazu.client.KitsuClient object>)[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.remove_entity_from_playlist(playlist, entity, persist=True, client=<gazu.client.KitsuClient object>)[source]

Remove all occurences of a given entity from a playlist.

Parameters:
  • playlist (dict) – Playlist object to modify

  • entity (str / dict) – the entity to remove or its ID

Returns:

Updated playlist.

Return type:

dict

gazu.playlist.update_entity_preview(playlist, entity, preview_file, persist=True, client=<gazu.client.KitsuClient object>)[source]

Remove all occurences of a given entity from a playlist.

Parameters:
  • playlist (dict) – Playlist object to modify

  • entity (str / dict) – the entity to add or its ID

Returns:

Updated playlist.

Return type:

dict

gazu.playlist.update_playlist(playlist, client=<gazu.client.KitsuClient object>)[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.project

gazu.project.add_metadata_descriptor(project, name, entity_type, data_type='string', choices=[], for_client=False, departments=[], client=<gazu.client.KitsuClient object>)[source]

Create a new metadata descriptor for a project.

Parameters:
  • project (dict / ID) – The project dict or id.

  • name (str) – The name of the metadata descriptor

  • entity_type (str) – asset, shot or scene.

  • choices (list) – A list of possible values, empty list for free values.

  • for_client (bool) – Wheter it should be displayed in Kitsu or not.

  • departments (list) – A list of departments dict or id.

Returns:

Created metadata descriptor.

Return type:

dict

gazu.project.add_person_to_team(project, person, client=<gazu.client.KitsuClient object>)[source]

Add a person to the team project.

Parameters:
  • project (dict / ID) – The project dict or id.

  • person (dict / ID) – The person dict or id.

gazu.project.all_metadata_descriptors(project, client=<gazu.client.KitsuClient object>)[source]

Get all the metadata descriptors.

Parameters:

project (dict / ID) – The project dict or id.

Returns:

The metadata descriptors.

Return type:

list

gazu.project.all_open_projects(client=<gazu.client.KitsuClient object>)[source]
Returns:

Open projects stored in the database.

gazu.project.all_project_status(client=<gazu.client.KitsuClient object>)[source]
Returns:

Project status listed in database.

Return type:

list

gazu.project.all_projects(client=<gazu.client.KitsuClient object>)[source]
Returns:

Projects stored in the database.

Return type:

list

gazu.project.close_project(project, client=<gazu.client.KitsuClient object>)[source]

Closes the provided project.

Parameters:

project (dict / ID) – The project dict or id to save in database.

Returns:

Updated project.

Return type:

dict

gazu.project.get_metadata_descriptor(project, metadata_descriptor_id, client=<gazu.client.KitsuClient object>)[source]

Retrieve a the metadata descriptor matching given ID.

Parameters:
  • project (dict / ID) – The project dict or id.

  • metadata_descriptor_id (dict / ID) – The metadata descriptor dict or id.

Returns:

The metadata descriptor matching the ID.

Return type:

dict

gazu.project.get_metadata_descriptor_by_field_name(project, field_name, client=<gazu.client.KitsuClient object>)[source]

Get a metadata descriptor matchind given project and name.

Parameters:
  • project (dict / ID) – The project dict or id.

  • metadata_descriptor_id (dict / ID) – The metadata descriptor dict or id.

Returns:

The metadata descriptor matchind the ID.

Return type:

dict

gazu.project.get_project(project_id, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[source]
Parameters:

project_name (str) – Name of claimed project.

Returns:

Project corresponding to given name.

Return type:

dict

gazu.project.get_project_status_by_name(project_status_name, client=<gazu.client.KitsuClient object>)[source]
Parameters:

project_status_name (str) – Name of claimed project status.

Returns:

Project status corresponding to given name.

Return type:

dict

gazu.project.get_project_url(project, section='assets', client=<gazu.client.KitsuClient object>)[source]
Parameters:
  • project (str / dict) – The project dict or the project ID.

  • section (str) – The section we want to open in the browser.

Returns:

Web url associated to the given project

Return type:

url (str)

gazu.project.get_team(project, client=<gazu.client.KitsuClient object>)[source]

Get team for project.

Parameters:

project (dict / ID) – The project dict or id.

gazu.project.new_project(name, production_type='short', team=[], asset_types=[], task_statuses=[], task_types=[], production_style='2d3d', client=<gazu.client.KitsuClient object>)[source]

Creates a new project.

Parameters:
  • name (str) – Name of the project to create.

  • production_type (str) – short, featurefilm, tvshow.

  • team (list) – Team of the project.

  • asset_types (list) – Asset types of the project.

  • task_statuses (list) – Task statuses of the project.

  • task_types (list) – Task types of the project.

  • production_style (str) – 2d, 3d, 2d3d, ar, vfx, stop-motion, motion-design, archviz, commercial, catalog, immersive, nft, video-game, vr.

Returns:

Created project.

Return type:

dict

gazu.project.remove_metadata_descriptor(project, metadata_descriptor_id, force=False, client=<gazu.client.KitsuClient object>)[source]

Remove a metadata descriptor.

Parameters:
  • project (dict / ID) – The project dict or id.

  • metadata_descriptor_id (dict / ID) – The metadata descriptor dict or id.

gazu.project.remove_person_from_team(project, person, client=<gazu.client.KitsuClient object>)[source]

Remove a person from the team project.

Parameters:
  • project (dict / ID) – The project dict or id.

  • person (dict / ID) – The person dict or id.

gazu.project.remove_project(project, force=False, client=<gazu.client.KitsuClient object>)[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_metadata_descriptor(project, metadata_descriptor, client=<gazu.client.KitsuClient object>)[source]

Update a metadata descriptor.

Parameters:
  • project (dict / ID) – The project dict or id.

  • metadata_descriptor (dict) – The metadata descriptor that needs to be updated.

Returns:

The updated metadata descriptor.

Return type:

dict

gazu.project.update_project(project, client=<gazu.client.KitsuClient object>)[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={}, client=<gazu.client.KitsuClient object>)[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.scene

gazu.scene.add_shot_to_scene(scene, shot, client=<gazu.client.KitsuClient object>)[source]

Link a shot to a scene to mark the fact it was generated out from that scene.

gazu.scene.all_asset_instances_for_scene(scene, client=<gazu.client.KitsuClient object>)[source]

Return the list of asset instances listed in a scene.

gazu.scene.all_camera_instances_for_scene(scene, client=<gazu.client.KitsuClient object>)[source]

Return the list of camera instances listed in a scene.

gazu.scene.all_scenes(project=None, client=<gazu.client.KitsuClient object>)[source]

Retrieve all scenes.

gazu.scene.all_scenes_for_project(project, client=<gazu.client.KitsuClient object>)[source]

Retrieve all scenes for given project.

gazu.scene.all_scenes_for_sequence(sequence, client=<gazu.client.KitsuClient object>)[source]

Retrieve all scenes which are children from given sequence.

gazu.scene.all_shots_for_scene(scene, client=<gazu.client.KitsuClient object>)[source]

Return the list of shots issued from given scene.

gazu.scene.get_asset_instance_by_name(scene, name, client=<gazu.client.KitsuClient object>)[source]

Returns the asset instance of the scene that has the given name.

gazu.scene.get_scene(scene_id, client=<gazu.client.KitsuClient object>)[source]

Return scene corresponding to given scene ID.

gazu.scene.get_scene_by_name(sequence, scene_name, client=<gazu.client.KitsuClient object>)[source]

Returns scene corresponding to given sequence and name.

gazu.scene.get_sequence_from_scene(scene, client=<gazu.client.KitsuClient object>)[source]

Return sequence which is parent of given shot.

gazu.scene.new_scene(project, sequence, name, client=<gazu.client.KitsuClient object>)[source]

Create a scene for given sequence.

gazu.scene.new_scene_asset_instance(scene, asset, description='', client=<gazu.client.KitsuClient object>)[source]

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

gazu.scene.remove_shot_from_scene(scene, shot, client=<gazu.client.KitsuClient object>)[source]

Remove link between a shot and a scene.

gazu.scene.update_asset_instance_data(asset_instance, data, client=<gazu.client.KitsuClient object>)[source]

Update the extra data of given asset instance.

gazu.scene.update_asset_instance_name(asset_instance, name, client=<gazu.client.KitsuClient object>)[source]

Update the name of given asset instance.

gazu.scene.update_scene(scene, client=<gazu.client.KitsuClient object>)[source]

Save given scene data into the API.

gazu.shot

gazu.shot.add_asset_instance_to_shot(shot, asset_instance, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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_episode(episode, client=<gazu.client.KitsuClient object>)[source]
Parameters:

episode (str / dict) – The episode dict or the episode ID.

Returns:

Shots which are children of given episode.

Return type:

list

gazu.shot.all_shots_for_project(project, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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.export_shots_with_csv(project, csv_file_path, episode=None, assigned_to=None, client=<gazu.client.KitsuClient object>)[source]

Export shots in a csv file.

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

  • csv_file_path (str) – The csv file path.

  • episode (str / dict) – The episode dict or the episode ID (optional).

  • assigned_to (str / dict) – The user dict or the user ID (optional).

gazu.shot.get_asset_instances_for_shot(shot, client=<gazu.client.KitsuClient object>)[source]

Return the list of asset instances linked to given shot.

gazu.shot.get_episode(episode_id, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[source]
Parameters:

sequence (dict) – The sequence dict.

Returns:

Episode which is parent of given sequence.

Return type:

dict

gazu.shot.get_episode_url(episode, client=<gazu.client.KitsuClient object>)[source]
Parameters:

episode (str / dict) – The episode dict or the episode ID.

Returns:

Web url associated to the given episode

Return type:

url (str)

gazu.shot.get_sequence(sequence_id, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[source]
Parameters:

shot_id (str) – ID of claimed shot.

Returns:

Shot corresponding to given shot ID.

Return type:

dict

gazu.shot.get_shot_by_name(sequence, shot_name, client=<gazu.client.KitsuClient object>)[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.get_shot_url(shot, client=<gazu.client.KitsuClient object>)[source]
Parameters:

shot (str / dict) – The shot dict or the shot ID.

Returns:

Web url associated to the given shot

Return type:

url (str)

gazu.shot.import_otio(project, otio_file_path, episode=None, naming_convention=None, match_case=True, client=<gazu.client.KitsuClient object>)[source]

Import shots from an OpenTimelineIO file (works also for every OTIO adapters).

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

  • otio_file_path (str) – The OTIO file path.

  • episode (str / dict) – The episode dict or the episode ID.

gazu.shot.import_shots_with_csv(project, csv_file_path, client=<gazu.client.KitsuClient object>)[source]

Import shots from a csv file.

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

  • csv_file_path (str) – The csv file path.

gazu.shot.new_episode(project, name, client=<gazu.client.KitsuClient object>)[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, name, episode=None, client=<gazu.client.KitsuClient object>)[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, nb_frames=None, frame_in=None, frame_out=None, description=None, data={}, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, force=False, client=<gazu.client.KitsuClient object>)[source]

Remove given episode and related from database.

Parameters:

episode (dict / str) – Episode to remove.

gazu.shot.remove_sequence(sequence, force=False, client=<gazu.client.KitsuClient object>)[source]

Remove given sequence and related from database.

Parameters:

sequence (dict / str) – Sequence to remove.

gazu.shot.remove_shot(shot, force=False, client=<gazu.client.KitsuClient object>)[source]

Remove given shot from database.

Parameters:

shot (dict / str) – Shot to remove.

gazu.shot.restore_shot(shot, client=<gazu.client.KitsuClient object>)[source]

Restore given shot into database (uncancel it).

Parameters:

shot (dict / str) – Shot to restore.

gazu.shot.update_episode(episode, client=<gazu.client.KitsuClient object>)[source]

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

Parameters:

episode (dict) – The episode dict to update.

Returns:

Updated episode.

Return type:

dict

gazu.shot.update_episode_data(episode, data={}, client=<gazu.client.KitsuClient object>)[source]

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

Parameters:
  • episode (dict / ID) – The episode dict or ID to save in database.

  • data (dict) – Free field to set metadata of any kind.

Returns:

Updated episode.

Return type:

dict

gazu.shot.update_sequence(sequence, client=<gazu.client.KitsuClient object>)[source]

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

Parameters:

sequence (dict) – The sequence dict to update.

Returns:

Updated sequence.

Return type:

dict

gazu.shot.update_sequence_data(sequence, data={}, client=<gazu.client.KitsuClient object>)[source]

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

Parameters:
  • sequence (dict / ID) – The sequence dicto or ID to save in database.

  • data (dict) – Free field to set metadata of any kind.

Returns:

Updated sequence.

Return type:

dict

gazu.shot.update_shot(shot, client=<gazu.client.KitsuClient object>)[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={}, client=<gazu.client.KitsuClient object>)[source]

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

Parameters:
  • shot (dict / ID) – The shot dict or ID to save in database.

  • data (dict) – Free field to set metadata of any kind.

Returns:

Updated shot.

Return type:

dict

gazu.sync

gazu.sync.convert_id_list(ids, model_map)[source]
Parameters:
  • ids (list) – Ids to convert.

  • model_map (dict) – Map matching ids to another value.c

Returns:

Ids converted through given model map.

Return type:

list

gazu.sync.get_id_map_by_id(source_list, target_list, field='name')[source]
Parameters:
  • source_list (list) – List of links to compare.

  • target_list (list) – List of links for which we want a diff.

Returns:

A dict where keys are the source model names and the values are the IDs of the target models with same name. It’s useful to match a model from the source list to its relative in the target list based on its name.

Return type:

dict

gazu.sync.get_id_map_by_name(source_list, target_list)[source]
Parameters:
  • source_list (list) – List of links to compare.

  • target_list (list) – List of links for which we want a diff.

Returns:

A dict where keys are the source model names and the values are the IDs of the target models with same name. It’s useful to match a model from the source list to its relative in the target list based on its name.

Return type:

dict

gazu.sync.get_last_events(page_size=20000, project=None, after=None, before=None, only_files=False, name=None, client=<gazu.client.KitsuClient object>)[source]

Get last events that occured on the machine.

Parameters:
  • page_size (int) – Number of events to retrieve.

  • project (dict/id) – Get only events related to this project.

  • after (dict/id) – Get only events occuring after given date.

  • before (dict/id) – Get only events occuring before given date.

  • only_files (bool) – Get only events related to files.

Returns:

Last events matching criterions.

Return type:

dict

Parameters:
  • source_list (list) – List of links to compare.

  • target_list (list) – List of links for which we want a diff.

Returns:

Two lists, one containing the missing links in the target list and one containing the links that should not be in the target list. Links are identified by their in ID and their out ID.

Return type:

tuple

gazu.sync.get_model_list_diff(source_list, target_list, id_field='id')[source]
Parameters:
  • source_list (list) – List of models to compare.

  • target_list (list) – List of models for which we want a diff.

Returns:

Two lists, one containing the missing models in the target list and one containing the models that should not be in the target list.

Return type:

tuple

gazu.sync.get_sync_asset_type_id_map(source_client, target_client)[source]
Parameters:
  • source_client (KitsuClient) – client to get data from source API

  • target_client (KitsuClient) – client to push data to target API

Returns:

A dict matching source asset type ids with target asset type ids

Return type:

dict

gazu.sync.get_sync_department_id_map(source_client, target_client)[source]
Parameters:
  • source_client (KitsuClient) – client to get data from source API

  • target_client (KitsuClient) – client to push data to target API

Returns:

A dict matching source departments ids with target department ids

Return type:

dict

gazu.sync.get_sync_person_id_map(source_client, target_client)[source]
Parameters:
  • source_client (KitsuClient) – client to get data from source API

  • target_client (KitsuClient) – client to push data to target API

Returns:

A dict matching source person ids with target person ids

Return type:

dict

gazu.sync.get_sync_project_id_map(source_client, target_client)[source]
Parameters:
  • source_client (KitsuClient) – client to get data from source API

  • target_client (KitsuClient) – client to push data to target API

Returns:

A dict matching source project ids with target project ids

Return type:

dict

gazu.sync.get_sync_task_status_id_map(source_client, target_client)[source]
Parameters:
  • source_client (KitsuClient) – client to get data from source API

  • target_client (KitsuClient) – client to push data to target API

Returns:

A dict matching source task status ids with target task status

ids

Return type:

dict

gazu.sync.get_sync_task_type_id_map(source_client, target_client)[source]
Parameters:
  • source_client (KitsuClient) – client to get data from source API

  • target_client (KitsuClient) – client to push data to target API

Returns:

A dict matching source task type ids with target task type ids

Return type:

dict

gazu.sync.import_entities(entities, client=<gazu.client.KitsuClient object>)[source]

Import entities from another instance to target instance (keep id and audit dates).

Parameters:

entities (list) – Entities to import.

Returns:

Entities created.

Return type:

dict

Import enitity links from another instance to target instance (keep id and audit dates).

Parameters:

links (list) – Entity links to import.

Returns:

Entity links created.

Return type:

dict

gazu.sync.import_tasks(tasks, client=<gazu.client.KitsuClient object>)[source]

Import tasks from another instance to target instance (keep id and audit dates).

Parameters:

tasks (list) – Tasks to import.

Returns:

Tasks created.

Return type:

dict

gazu.sync.is_changed(source_model, target_model)[source]
Parameters:
  • source_model (dict) – Model from the source API.

  • target_model (dict) – Matching model from the target API.

Returns:

True if the source model is older than the target model (based on updated_at field)

Return type:

bool

gazu.sync.push_assets(project_source, project_target, client_source, client_target)[source]

Copy assets from source to target and preserve audit fields (id, created_at, and updated_at).

Parameters:
  • project_source (dict) – The project to get assets from

  • project_target (dict) – The project to push assets to

  • source_client (KitsuClient) – client to get data from source API

  • target_client (KitsuClient) – client to push data to target API

Returns:

Pushed assets

Return type:

list

Copy entity links (breakdown, concepts) from source to target and preserve audit fields (id, created_at, and updated_at).

Parameters:
  • project_source (dict) – The project to get assets from

  • project_target (dict) – The project to push assets to

  • source_client (KitsuClient) – client to get data from source API

  • target_client (KitsuClient) – client to push data to target API

Returns:

Pushed entity links

Return type:

list

gazu.sync.push_episodes(project_source, project_target, client_source, client_target)[source]

Copy episodes from source to target and preserve audit fields (id, created_at, and updated_at)

Parameters:
  • project_source (dict) – The project to get episodes from

  • project_target (dict) – The project to push episodes to

  • source_client (KitsuClient) – client to get data from source API

  • target_client (KitsuClient) – client to push data to target API

Returns:

Pushed episodes

Return type:

list

gazu.sync.push_project_entities(project_source, project_target, client_source, client_target)[source]

Copy assets, episodes, sequences, shots and entity links from source to target and preserve audit fields (id, created_at, and updated_at).

Parameters:
  • project_source (dict) – The project to get assets from

  • project_target (dict) – The project to push assets to

  • source_client (KitsuClient) – client to get data from source API

  • target_client (KitsuClient) – client to push data to target API

Returns:

Pushed data

Return type:

dict

gazu.sync.push_sequences(project_source, project_target, client_source, client_target)[source]

Copy sequences from source to target and preserve audit fields (id, created_at, and updated_at)

Parameters:
  • project_source (dict) – The project to get sequences from

  • project_target (dict) – The project to push sequences to

  • source_client (KitsuClient) – client to get data from source API

  • target_client (KitsuClient) – client to push data to target API

Returns:

Pushed sequences

Return type:

list

gazu.sync.push_shots(project_source, project_target, client_source, client_target)[source]

Copy shots from source to target and preserve audit fields (id, created_at, and updated_at).

Parameters:
  • project_source (dict) – The project to get shots from

  • project_target (dict) – The project to push shots to

  • source_client (KitsuClient) – client to get data from source API

  • target_client (KitsuClient) – client to push data to target API

Returns:

Pushed shots

Return type:

list

gazu.sync.push_task_comment(task_status_map, person_map, task, comment, client_source, client_target, author_id=None, tmp_path='/tmp/zou/sync/')[source]

Create a new comment into target api for each comment in source task but preserve only created_at field. Attachments and previews are created too.

Parameters:
  • project_source (dict) – The project to get assets from

  • project_target (dict) – The project to push assets to

  • source_client (KitsuClient) – client to get data from source API

  • target_client (KitsuClient) – client to push data to target API

Returns:

Created comments

Return type:

list

gazu.sync.push_task_comments(task_status_map, person_map, task, client_source, client_target)[source]

Create a new comment into target api for each comment in source task but preserve only created_at field. Attachments and previews are created too.

Parameters:
  • project_source (dict) – The project to get assets from

  • project_target (dict) – The project to push assets to

  • source_client (KitsuClient) – client to get data from source API

  • target_client (KitsuClient) – client to push data to target API

Returns:

Created comments

Return type:

list

gazu.sync.push_tasks(project_source, project_target, default_status, client_source, client_target)[source]

Copy tasks from source to target and preserve audit fields (id, created_at, and updated_at) Attachments and previews are created too.

Parameters:
  • project_source (dict) – The project to get assets from

  • project_target (dict) – The project to push assets to

  • source_client (KitsuClient) – client to get data from source API

  • target_client (KitsuClient) – client to push data to target API

Returns:

Pushed entity links

Return type:

list

gazu.sync.push_tasks_comments(project_source, client_source, client_target)[source]

Create a new comment into target api for each comment in source project but preserve only created_at field. Attachments and previews are created too.

Parameters:
  • project_source (dict) – The project to get assets from

  • project_target (dict) – The project to push assets to

  • source_client (KitsuClient) – client to get data from source API

  • target_client (KitsuClient) – client to push data to target API

Returns:

Created comments

Return type:

list

gazu.task

gazu.task.add_attachment_files_to_comment(task, comment, attachments=[], client=<gazu.client.KitsuClient object>)[source]

Add attachments files to a given comment.

Parameters:
  • task (dict / ID) – The task dict or the task ID.

  • comment (dict / ID) – The comment dict or the comment ID.

  • attachments (list / str) – A list of path for attachments or directly the path.

Returns:

Added attachment files.

Return type:

dict

gazu.task.add_comment(task, task_status, comment='', person=None, checklist=[], attachments=[], created_at=None, links=[], client=<gazu.client.KitsuClient object>)[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

  • person (str / dict) – Comment author

  • checklist (list) – Comment checklist

  • attachments (list[file_path]) – Attachments file paths

  • created_at (str) – Comment date

  • links (list) – List of links to add to the comment

Returns:

Created comment.

Return type:

dict

gazu.task.add_preview(task, comment, preview_file_path=None, preview_file_url=None, normalize_movie=True, revision=None, client=<gazu.client.KitsuClient object>)[source]

Add a preview to given comment.

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.

  • preview_file_url (str) – Url to download the preview file if no path is

  • given.

  • normalize_movie (bool) – Normalize the movie or not.

  • revision (int) – Revision number.

Returns:

Created preview file model.

Return type:

dict

gazu.task.add_time_spent(task, person, date, duration, client=<gazu.client.KitsuClient object>)[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_assets_tasks_for_episode(episode, relations=False, client=<gazu.client.KitsuClient object>)[source]

Retrieve all tasks directly linked to all assets of given episode.

gazu.task.all_comments_for_task(task, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[source]
Returns:

Tasks that are done for given person (only for open projects).

Return type:

list

gazu.task.all_shot_tasks_for_episode(episode, relations=False, client=<gazu.client.KitsuClient object>)[source]

Retrieve all tasks directly linked to all shots of given episode.

gazu.task.all_shot_tasks_for_sequence(sequence, relations=False, client=<gazu.client.KitsuClient object>)[source]

Retrieve all tasks directly linked to all shots of given sequence.

gazu.task.all_task_statuses(client=<gazu.client.KitsuClient object>)[source]
Returns:

Task statuses stored in database.

Return type:

list

gazu.task.all_task_statuses_for_project(project, client=<gazu.client.KitsuClient object>)[source]
Returns:

Task status stored in database.

Return type:

list

gazu.task.all_task_types(client=<gazu.client.KitsuClient object>)[source]
Returns:

Task types stored in database.

Return type:

list

gazu.task.all_task_types_for_asset(asset, client=<gazu.client.KitsuClient object>)[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_concept(concept, client=<gazu.client.KitsuClient object>)[source]
Parameters:

concept (str / dict) – The concept dict or the concept ID.

Returns

list: Task types of task linked to given concept.

gazu.task.all_task_types_for_episode(episode, client=<gazu.client.KitsuClient object>)[source]
Returns:

Task types of tasks linked directly to given episode.

Return type:

list

gazu.task.all_task_types_for_project(project, client=<gazu.client.KitsuClient object>)[source]
Returns:

Task types stored in database.

Return type:

list

gazu.task.all_task_types_for_scene(scene, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, relations=False, client=<gazu.client.KitsuClient object>)[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_concept(concept, relations=False, client=<gazu.client.KitsuClient object>)[source]
Parameters:

concept (str / dict) – The concept dict or the concept ID.

Returns:

Tasks linked to given concept.

Return type:

list

gazu.task.all_tasks_for_edit(edit, relations=False, client=<gazu.client.KitsuClient object>)[source]
Parameters:

edit (str / dict) – The edit dict or the edit ID.

Returns:

Tasks linked to given edit.

Return type:

list

gazu.task.all_tasks_for_entity_and_task_type(entity, task_type, client=<gazu.client.KitsuClient object>)[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, relations=False, client=<gazu.client.KitsuClient object>)[source]

Retrieve all tasks directly linked to given episode.

gazu.task.all_tasks_for_person(person, client=<gazu.client.KitsuClient object>)[source]
Returns:

Tasks that are not done for given person (only for open projects).

Return type:

list

gazu.task.all_tasks_for_project(project, task_type=None, episode=None, client=<gazu.client.KitsuClient object>)[source]
Parameters:
  • project (str / dict) – The project (or its ID) to get tasks from.

  • task_type (str / dict) – The task type (or its ID) to filter tasks.

  • episode (str / dict) – The episode (or its ID) to filter tasks.

Returns:

Tasks related to given project.

Return type:

dict

gazu.task.all_tasks_for_scene(scene, relations=False, client=<gazu.client.KitsuClient object>)[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, relations=False, client=<gazu.client.KitsuClient object>)[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, relations=False, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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.all_tasks_for_task_type(project, task_type, episode=None, client=<gazu.client.KitsuClient object>)[source]
Parameters:
  • project (str / dict) – The project dict or the project ID.

  • task_type (str / dict) – The task type dict or ID.

  • episode_id (str / dict) – The episode dict or ID.

Returns:

Tasks for given project and task type.

Return type:

list

gazu.task.assign_task(task, person, client=<gazu.client.KitsuClient object>)[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.clear_assignations(tasks, person=None, client=<gazu.client.KitsuClient object>)[source]

Clear assignations for a single or multiple tasks. If no person is given, all assignations are cleared. :param tasks: Task dict or the task ID, single or list. :type tasks: list / str / dict :param person: The person dict or the person ID. :type person: str / dict

Returns:

(dict) List of affected Task IDs

gazu.task.create_preview(task, comment, revision=None, client=<gazu.client.KitsuClient object>)[source]

Create a preview into given comment.

Parameters:
  • task (str / dict) – The task dict or the task ID.

  • comment (str / dict) – The comment or the comment ID.

  • revision (int) – Revision number.

Returns:

Created preview file model.

Return type:

dict

gazu.task.get_comment(comment_id, client=<gazu.client.KitsuClient object>)[source]

Get comment instance

Parameters:

comment_id (ID) – The comment ID.

Returns:

Given comment instance.

Return type:

dict

gazu.task.get_default_task_status(client=<gazu.client.KitsuClient object>)[source]
Parameters:

name (str / dict) – The name of claimed task status.

Returns:

Task status matching given name.

Return type:

dict

gazu.task.get_last_comment_for_task(task, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[source]
Parameters:

task_id (str) – ID of claimed task.

Returns:

Task matching given ID.

Return type:

dict

gazu.task.get_task_by_entity(entity, task_type, name='main', client=<gazu.client.KitsuClient object>)[source]
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 entity, task type and name.

gazu.task.get_task_by_path(project, file_path, entity_type='shot', client=<gazu.client.KitsuClient object>)[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_status_id, client=<gazu.client.KitsuClient object>)[source]
Parameters:

task_status_id (str) – ID of claimed task status.

Returns:

Task status matching given ID.

Return type:

dict

gazu.task.get_task_status_by_name(name, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, for_entity=None, department=None, client=<gazu.client.KitsuClient object>)[source]
Parameters:
  • task_type_name (str) – Name of claimed task type.

  • for_entity (str) – The entity type for which the task type is created.

  • department (str) – The department for which the task type is created.

Returns:

Task type object for given name.

Return type:

dict

gazu.task.get_task_url(task, client=<gazu.client.KitsuClient object>)[source]
Parameters:

task (dict) – The task dict.

Returns:

Web url associated to the given task

Return type:

url (str)

gazu.task.get_time_spent(task, date=None, client=<gazu.client.KitsuClient object>)[source]

Get the time spent by CG artists on a task at a given date if given. 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=[], client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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 as an hexadecimal string

  • ex (with # as first character.) – #00FF00

Returns:

The created task status

Return type:

dict

gazu.task.new_task_type(name, color='#000000', for_entity='Asset', client=<gazu.client.KitsuClient object>)[source]

Create a new task type with the given name.

Parameters:
  • name (str) – The name of the task type

  • color (str) – The color of the task type as an hexadecimal string

  • ex (with # as first character.) – #00FF00

  • for_entity (str) – The entity type for which the task type is created.

Returns:

The created task type

Return type:

dict

gazu.task.publish_preview(task, task_status, comment='', person=None, checklist=[], attachments=[], created_at=None, preview_file_path=None, preview_file_url=None, normalize_movie=True, revision=None, set_thumbnail=False, client=<gazu.client.KitsuClient object>)[source]

Publish a comment and include given preview for given task and set given task status.

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

  • person (str / dict) – Comment author

  • checklist (list) – Comment checklist

  • attachments (list[file_path]) – Attachments file paths

  • created_at (str) – Comment date

  • preview_file_path (str) – Path of the file to upload as preview.

  • preview_file_url (str) – Url to download the preview file if no path is

  • given.

  • normalize_movie (bool) – Set to false to not do operations on it on the

  • side. (server) –

  • revision (int) – Revision number.

  • set_thumbnail (bool) – Set the preview as thumbnail of the entity.

Returns:

Created comment model and created preview file model.

Return type:

tuple(dict, dict)

gazu.task.remove_comment(comment, client=<gazu.client.KitsuClient object>)[source]

Remove given comment and related (previews, news, notifications) from database.

Parameters:

comment (str / dict) – The comment dict or the comment ID.

gazu.task.remove_task(task, client=<gazu.client.KitsuClient object>)[source]

Remove given task from database.

Parameters:

task (str / dict) – The task dict or the task ID.

gazu.task.remove_task_status(task_status, client=<gazu.client.KitsuClient object>)[source]

Remove given task status from database.

Parameters:

task_status (str / dict) – The task status dict or ID.

gazu.task.remove_task_type(task_type, client=<gazu.client.KitsuClient object>)[source]

Remove given task type from database.

Parameters:

task_type (str / dict) – The task type dict or ID.

gazu.task.set_main_preview(preview_file, frame_number=None, client=<gazu.client.KitsuClient object>)[source]

Set given preview as thumbnail of given entity.

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

  • frame_number (int) – Frame of preview video to set as main preview

Returns:

Created preview file model.

Return type:

dict

gazu.task.set_time_spent(task, person, date, duration, client=<gazu.client.KitsuClient object>)[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, started_task_status=None, client=<gazu.client.KitsuClient object>)[source]

Create a comment to change task status to started_task_status (by default WIP) and set its real start date to now.

Parameters:

task (str / dict) – The task dict or the task ID.

Returns:

Created comment.

Return type:

dict

gazu.task.task_to_review(task, person, comment, revision=1, change_status=True, client=<gazu.client.KitsuClient object>)[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.task.update_comment(comment, client=<gazu.client.KitsuClient object>)[source]

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

Parameters:

comment (dict) – The comment dict to update.

Returns:

Updated comment.

Return type:

dict

gazu.task.update_task(task, client=<gazu.client.KitsuClient object>)[source]

Update given task into the API. Metadata are fully replaced by the ones set on given task.

Parameters:

task (dict) – The task dict to update.

Returns:

Updated task.

Return type:

dict

gazu.task.update_task_data(task, data={}, client=<gazu.client.KitsuClient object>)[source]

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

Parameters:
  • task (dict / ID) – The task dict or ID to save in database.

  • data (dict) – Free field to set metadata of any kind.

Returns:

Updated task.

Return type:

dict

gazu.task.update_task_status(task_status, client=<gazu.client.KitsuClient object>)[source]

Update given task status into the API.

Parameters:

task_status (dict) – The task status dict to update.

Returns:

Updated task status.

Return type:

dict

gazu.task.update_task_type(task_type, client=<gazu.client.KitsuClient object>)[source]

Update given task type into the API.

Parameters:

task_type (dict) – The task type dict to update.

Returns:

Updated task type.

Return type:

dict

gazu.task.upload_preview_file(preview_file, file_path, normalize_movie=True, client=<gazu.client.KitsuClient object>)[source]

Create a preview into given comment.

Parameters:
  • preview_file (str / dict) – The preview_file dict or the preview_file ID.

  • file_path (str) – Path of the file to upload as preview.

gazu.user

gazu.user.all_asset_types_for_project(project, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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_done_tasks(client=<gazu.client.KitsuClient object>)[source]
Returns:

Tasks assigned to current user which are done.

Return type:

list

gazu.user.all_episodes_for_project(project, client=<gazu.client.KitsuClient object>)[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_filters(client=<gazu.client.KitsuClient object>)[source]
Returns:

all filters for current user.

Return type:

list

gazu.user.all_open_projects(client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[source]
Returns:

Task types for given asset and current user.

Return type:

list

gazu.user.all_task_types_for_shot(shot, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[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, client=<gazu.client.KitsuClient object>)[source]

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

gazu.user.all_tasks_for_shot(shot, client=<gazu.client.KitsuClient object>)[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(client=<gazu.client.KitsuClient object>)[source]
Returns:

Tasks assigned to current user which are not complete.

Return type:

list

gazu.user.get_timespents_range(start_date, end_date, client=<gazu.client.KitsuClient object>)[source]

Gets the timespents of the current user for the given date range.

Parameters:
  • start_date (str) – The first day of the date range as a date string with the following format: YYYY-MM-DD

  • end_date (str) – The last day of the date range as a date string with the following format: YYYY-MM-DD

Returns:

All of the person’s time spents

Return type:

list

gazu.user.is_authenticated(client=<gazu.client.KitsuClient object>)[source]
Returns:

Current user authenticated or not

Return type:

bool

gazu.user.log_desktop_session_log_in(client=<gazu.client.KitsuClient object>)[source]

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

Returns:

Desktop session log entry.

Return type:

dict

gazu.user.new_filter(name, query, list_type, project=None, entity_type=None, client=<gazu.client.KitsuClient object>)[source]

Create a new filter for current user.

Parameters:
  • name (str) – The filter name.

  • query (str) – The query for the filter.

  • list_type (str) – “asset”, “shot” or “edit”.

  • project (str / dict) – The project dict or the project ID.

  • entity_type (str) – “Asset”, “Shot” or “Edit”.

Returns:

Created filter.

Return type:

dict

gazu.user.remove_filter(filter, client=<gazu.client.KitsuClient object>)[source]

Remove given filter from database.

Parameters:

filter (str / dict) – The filter dict or the filter ID.

gazu.user.update_filter(filter, client=<gazu.client.KitsuClient object>)[source]

Save given filter data into the API.

Parameters:

filter (dict) – Filter to save.