Appearance
SDK Reference
gazu
gazu.log_in(email, password, totp=None, email_otp=None, fido_authentication_response=None, recovery_code=None)
| Name | Type | Description |
|---|---|---|
email | - | |
password | - | |
totp | - | |
email_otp | - | |
fido_authentication_response | - | |
recovery_code | - |
gazu.get_host()
gazu.set_host(url)
| Name | Type | Description |
|---|---|---|
url | - |
gazu.send_email_otp(email)
| Name | Type | Description |
|---|---|---|
email | - |
gazu.log_out()
gazu.get_event_host()
gazu.set_event_host(url)
| Name | Type | Description |
|---|---|---|
url | - |
asset
gazu.asset.all_asset_instances_for_asset(asset)
| Name | Type | Description |
|---|---|---|
asset | str / dict | The asset dict or the asset ID. |
Returns: (list[str]) Asset instances existing for a given asset.
gazu.asset.all_asset_instances_for_shot(shot)
| Name | Type | Description |
|---|---|---|
shot | str / dict | The shot dict or the shot ID. |
Returns: (list[str]) Asset instances existing for a given shot.
gazu.asset.all_asset_types()
Returns: (list[dict]) Asset types stored in the database.
gazu.asset.all_asset_types_for_project(project)
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
Returns: (list[dict]) Asset types from assets listed in given project.
gazu.asset.all_asset_types_for_shot(shot)
| Name | Type | Description |
|---|---|---|
shot | str / dict | The shot dict or the shot ID. |
Returns: (list[dict]) Asset types from assets casted in given shot.
gazu.asset.all_assets_for_episode(episode)
| Name | Type | Description |
|---|---|---|
episode | str / dict | The episode dict or the episode ID. |
Returns: (list[dict]) Assets stored in the database for given episode.
gazu.asset.all_assets_for_open_projects()
Returns: (list[dict]) Assets stored in the database for open projects.
gazu.asset.all_assets_for_project(project)
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
Returns: (list[dict]) Assets stored in the database for given project.
gazu.asset.all_assets_for_project_and_type(project, asset_type)
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
asset_type | str / dict | The asset type dict or the asset type ID. |
Returns: (list[dict]) Assets stored in the database for given project and asset type.
gazu.asset.all_assets_for_shot(shot)
| Name | Type | Description |
|---|---|---|
shot | str / dict | The shot dict or the shot ID. |
Returns: (list[dict]) Assets stored in the database for given shot.
gazu.asset.all_scene_asset_instances_for_asset(asset)
| Name | Type | Description |
|---|---|---|
asset | str / dict | The asset dict or the asset ID. |
Returns: (list[str]) Scene asset instances existing for a given asset.
gazu.asset.all_shot_asset_instances_for_asset(asset)
| Name | Type | Description |
|---|---|---|
asset | str / dict | The asset dict or the asset ID. |
Returns: (list[dict]) Asset instances existing for a given asset.
gazu.asset.disable_asset_instance(asset_instance)
Set active flag of given asset instance to False.
| Name | Type | Description |
|---|---|---|
asset_instance | str / dict | The asset instance dict or ID. |
gazu.asset.enable_asset_instance(asset_instance)
Set active flag of given asset instance to True.
| Name | Type | Description |
|---|---|---|
asset_instance | str / dict | The asset instance dict or ID. |
gazu.asset.export_assets_with_csv(project, csv_file_path, episode = None, assigned_to = None, progress_callback=None)
Export the Assets data for a project to a CSV file on disk.
| Name | Type | Description |
|---|---|---|
project | str | dict | The ID or dict for the project to export. |
csv_file_path | str | The path on disk to write the file to. If the path already exists it will be overwritten. |
episode | str | dict | None | Only export Assets that are linked to the given Episode, which can be provided as an ID string or model dict. If None, all assets will be exported. |
assigned_to | str | dict | None | Only export Assets that have one or more Tasks assigned to the given Person, specified as an ID string or model dict. If None, no filtering is put in place. |
progress_callback | - |
Returns: (requests.Response) the response from the API server.
gazu.asset.get_asset(asset_id)
| Name | Type | Description |
|---|---|---|
asset_id | str | ID of claimed asset. |
Returns: (dict) Asset matching given ID.
gazu.asset.get_asset_by_name(project, name, asset_type = None)
| Name | Type | Description |
|---|---|---|
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: (dict | None) Asset matching given name for given project and asset type.
gazu.asset.get_asset_instance(asset_instance_id)
| Name | Type | Description |
|---|---|---|
asset_instance_id | str | ID of claimed asset instance. |
Returns: (dict) Asset Instance matching given ID.
gazu.asset.get_asset_type(asset_type_id)
| Name | Type | Description |
|---|---|---|
asset_type_id | str | ID of claimed asset type. |
Returns: (dict) Asset Type matching given ID.
gazu.asset.get_asset_type_by_name(name)
| Name | Type | Description |
|---|---|---|
name | str | name of asset type. |
Returns: (dict | None) Asset Type matching given name, or None if no asset type exists with that name.
gazu.asset.get_asset_type_from_asset(asset)
| Name | Type | Description |
|---|---|---|
asset | dict | The asset dict. |
Returns: (dict) Asset type which is the type of given asset.
gazu.asset.get_asset_url(asset)
| Name | Type | Description |
|---|---|---|
asset | str / dict | The asset dict or the asset ID. |
Returns: (str) Web url associated to the given asset
gazu.asset.get_episode_from_asset(asset)
Return the Episode that the given Asset is linked to. If the Asset isn't linked to a particular Episode (i.e it's part of the "Main Pack"), None will be returned.
| Name | Type | Description |
|---|---|---|
asset | dict | The asset dict. |
Returns: (dict | None) Episode which is parent of given asset, or None if not part of an episode.
gazu.asset.import_assets_with_csv(project, csv_file_path, progress_callback=None)
Import the Assets from a previously exported CSV file into the given project.
| Name | Type | Description |
|---|---|---|
project | str | dict | The project to import the Assets into, as an ID string or model dict. |
csv_file_path | str | The path on disk to the CSV file. |
progress_callback | - |
Returns: (list[dict]) the Asset dicts created by the import.
gazu.asset.new_asset(project, asset_type, name, description = None, extra_data = None, episode = None, is_shared = False)
Create a new asset in the database for given project and asset type.
| Name | Type | Description |
|---|---|---|
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. |
is_shared | bool | True if asset is shared between multiple projects. |
Returns: (dict) Created asset.
gazu.asset.new_asset_asset_instance(asset, asset_to_instantiate, description = None)
Creates a new asset instance for given asset. The instance number is automatically generated (increment highest number).
| Name | Type | Description |
|---|---|---|
asset | str / dict | The asset dict or the shot ID. |
asset_to_instantiate | str / dict | The asset instance dict or ID. |
description | str | Additional information (optional) |
Returns: (dict) Created asset instance.
gazu.asset.new_asset_type(name)
Create a new asset type in the database, or return the existing asset type if one already exists with that name.
| Name | Type | Description |
|---|---|---|
name | str | The name of asset type to create. |
Returns: (dict) The created (or already existing) asset type.
gazu.asset.remove_asset(asset, force = False)
Remove given asset from database. If the Asset has tasks linked to it, this will by default mark the Asset as canceled. Deletion can be forced regardless of task links with the `force` parameter.
| Name | Type | Description |
|---|---|---|
asset | str / dict | Asset to remove. |
force | bool | Whether to force deletion of the asset regardless of whether it has links to tasks. |
gazu.asset.remove_asset_type(asset_type)
Remove given asset type from database.
| Name | Type | Description |
|---|---|---|
asset_type | str / dict | Asset type to remove. |
gazu.asset.update_asset(asset)
Save given asset data into the API. It assumes that the asset already exists.
| Name | Type | Description |
|---|---|---|
asset | dict | Asset to save. |
gazu.asset.update_asset_data(asset, data = None)
Update the metadata for the provided asset. Keys that are not provided are not changed.
| Name | Type | Description |
|---|---|---|
asset | str / dict | The asset dict or ID to save in database. |
data | dict | Free field to set metadata of any kind. |
Returns: (dict) Updated asset.
gazu.asset.update_asset_type(asset_type)
Save given asset type data into the API. It assumes that the asset type already exists.
| Name | Type | Description |
|---|---|---|
asset_type | dict | Asset Type to save. |
cache
gazu.cache.cache(function, maxsize = 300, expire = 120)
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.
| Name | Type | Description |
|---|---|---|
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) |
maxsize | - | |
expire | - |
gazu.cache.clear_all()
Clear all cached functions.
gazu.cache.disable()
Disable caching on all decorated functions.
gazu.cache.enable()
Enable caching on all decorated functions.
gazu.cache.get_cache_key(*args, **kwargs)
Serialize arguments to get a cache key. It will be used to store function results.
| Name | Type | Description |
|---|
Returns: (str) generated key
gazu.cache.get_value(cache_store, key)
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.
| Name | Type | Description |
|---|---|---|
cache_store | - | |
key | - |
gazu.cache.insert_value(function, cache_store, *args, **kwargs)
Serialize function call arguments and store function result in given cache store.
| Name | Type | Description |
|---|---|---|
function | func | The function to cache value for. |
cache_store | dict | The cache which will contain the value to cache. args, kwargs: The arguments for which a cache must be set. |
gazu.cache.is_cache_enabled(state)
| Name | Type | Description |
|---|---|---|
state | - |
gazu.cache.is_cache_expired(memo, state, key)
Check if cache is expired (outdated) for given wrapper state and cache key.
| Name | Type | Description |
|---|---|---|
memo | dict | The function cache |
state | dict | The parameters of the cache (enabled, expire, maxsize) key: The key to check |
key | - |
gazu.cache.remove_oldest_entry(memo, maxsize)
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.
| Name | Type | Description |
|---|---|---|
memo | - | |
maxsize | - |
casting
gazu.casting.all_entity_links_for_project(project, page = None, limit = None)
| Name | Type | Description |
|---|---|---|
project | dict | str | The project dict or ID. |
page | - | |
limit | - |
Returns: (dict) A dictionary containing entity links for the project. If pagination is used, contains "data" (list of entity link dicts) and pagination metadata. Otherwise, returns a list of entity link dictionaries directly. Each entity link dict contains "entity_in_id", "entity_out_id", and other link-related fields.
gazu.casting.delete_entity_link(entity_link)
Delete an entity link.
| Name | Type | Description |
|---|---|---|
entity_link | str / dict | The entity link dict or the entity link ID. |
Returns: (dict) The deleted entity link.
gazu.casting.get_asset_cast_in(asset)
Return entity list where given asset is casted.
| Name | Type | Description |
|---|---|---|
asset | dict | The asset dict or ID. |
Returns: (dict) A list of entity dictionaries (shots, scenes, etc.) where the given asset is cast. Each entity dict contains standard entity fields like "id", "name", "project_id", etc.
gazu.casting.get_asset_casting(asset)
Return casting for given asset. `[{"asset_id": "asset-1", "nb_occurences": 3}]}`
| Name | Type | Description |
|---|---|---|
asset | dict | The asset dict |
Returns: (dict) A list of casting dictionaries, each containing "asset_id" and "nb_occurences" keys representing which assets are cast in the given asset and how many times they appear.
gazu.casting.get_asset_type_casting(project, asset_type)
Return casting for given asset_type.
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
asset_type | str / dict | The asset_type dict or the asset_type ID. |
Returns: (dict) A dictionary mapping asset IDs to their casting lists. Each casting list contains dictionaries with "asset_id" and "nb_occurences" keys representing which assets are cast in each asset of this type.
gazu.casting.get_episode_casting(episode)
Return casting for given episode. `[{"episode_id": "episode-1", "nb_occurences": 3}]}`
| Name | Type | Description |
|---|---|---|
episode | dict | The episode dict |
Returns: (dict) A list of casting dictionaries, each containing "asset_id" and "nb_occurences" keys representing which assets are cast in the episode and how many times they appear.
gazu.casting.get_episode_shots_casting(project, episode)
Return casting for all shots in given episode.
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
episode | str / dict | The episode dict or the episode ID. |
Returns: (dict) A dictionary mapping shot IDs to their casting lists. Each casting list contains dictionaries with "asset_id" and "nb_occurences" keys representing which assets are cast in each shot of the episode.
gazu.casting.get_episodes_casting(project)
Return casting for all episodes in given project.
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
Returns: (dict) A dictionary mapping episode IDs to their casting lists. Each casting list contains dictionaries with "asset_id" and "nb_occurences" keys representing which assets are cast in each episode.
gazu.casting.get_project_shots_casting(project)
Return casting for all shots in given project.
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
Returns: (dict) A dictionary mapping shot IDs to their casting lists. Each casting list contains dictionaries with "asset_id" and "nb_occurences" keys representing which assets are cast in each shot of the project.
gazu.casting.get_sequence_casting(sequence)
Return casting for given sequence.
| Name | Type | Description |
|---|---|---|
sequence | dict | The sequence dict |
Returns: (dict) A dictionary mapping shot IDs to their casting lists. Each casting list contains dictionaries with "asset_id" and "nb_occurences" keys representing which assets are cast in each shot of the sequence.
gazu.casting.get_sequence_shots_casting(project, sequence)
Return casting for all shots in given sequence.
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
sequence | str / dict | The sequence dict or the sequence ID. |
Returns: (dict) A dictionary mapping shot IDs to their casting lists. Each casting list contains dictionaries with "asset_id" and "nb_occurences" keys representing which assets are cast in each shot of the sequence.
gazu.casting.get_shot_casting(shot)
Return casting for given shot.
| Name | Type | Description |
|---|---|---|
shot | dict | The shot dict |
Returns: (dict) A list of casting dictionaries, each containing "asset_id" and "nb_occurences" keys representing which assets are cast in the shot and how many times they appear.
gazu.casting.update_asset_casting(project, asset, casting)
Change casting of given asset with given casting (list of asset ids displayed into the asset).
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or asset ID. |
asset | str / dict | The asset dict or the asset ID. |
casting | dict | The casting description. |
Returns: (dict) The updated asset dictionary with the new casting information applied.
gazu.casting.update_episode_casting(project, episode, casting)
Change casting of given episode with given casting (list of asset ids displayed into the episode).
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or ID. |
episode | str / dict | The episode dict or the episode ID. |
casting | dict | The casting description. e.g: `casting = [{"asset_id": "asset-1", "nb_occurences": 3}]` |
Returns: (dict) The updated episode dictionary with the new casting information applied.
gazu.casting.update_shot_casting(project, shot, casting)
Change casting of given shot with given casting (list of asset ids displayed into the shot).
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dictionary or ID. |
shot | str / dict | The shot dict or the shot ID. |
casting | dict | The casting description. Ex: `casting = [{"asset_id": "asset-1", "nb_occurences": 3}]` |
Returns: (dict) The updated shot dictionary with the new casting information applied.
client
gazu.client.build_path_with_params(path, params)
Add params to a path using urllib encoding.
| Name | Type | Description |
|---|---|---|
path | str | The url base path |
params | dict | The parameters to add as a dict |
Returns: (str) the built path
gazu.client.check_status(request, path, client = None)
Raise an exception related to status code, if the status code does not match a success code. Print error message when it's relevant.
| Name | Type | Description |
|---|---|---|
request | requests.Response | The request to validate. |
path | str | The path of the request. |
Returns: (tuple[int, bool]) when 500 response occurs
gazu.client.create(model_name, data)
Create an entry for given model and data.
| Name | Type | Description |
|---|---|---|
model_name | str | The model type involved. |
data | dict | The data to use for creation. |
Returns: (dict) Created entry
gazu.client.create_client(host, ssl_verify = True, cert = None, use_refresh_token = False, callback_not_authenticated = None, **kwargs)
Create a client with given parameters.
| Name | Type | Description |
|---|---|---|
host | str | The host to use for requests. |
ssl_verify | bool | Whether to verify SSL certificates. |
cert | str | Path to a client certificate. |
use_refresh_token | bool | Whether to automatically refresh tokens. |
callback_not_authenticated | function | Function to call when not authenticated. |
Returns: (KitsuClient) The created client.
gazu.client.delete(path, params = None)
Run a delete request toward given path for configured host.
| Name | Type | Description |
|---|---|---|
path | str | The path to query. |
params | dict | The parameters to pass to the request. |
gazu.client.download(path, file_path, params = None, progress_callback = None)
Download file located at *file_path* to given url *path*.
| Name | Type | Description |
|---|---|---|
path | str | The url path to download file from. |
file_path | str | The location to store the file on the hard drive. |
params | dict | The parameters to pass to the request. |
progress_callback | Callable | Callback ``(bytes_read, total)`` invoked during download. *total* is 0 when unknown. |
Returns: (requests.Response) Request response object.
gazu.client.fetch_all(path, params = None, paginated = False, limit = None)
| Name | Type | Description |
|---|---|---|
path | str | The path for which we want to retrieve all entries. |
params | dict | The parameters to pass to the request. |
paginated | bool | Will query entries page by page. |
limit | int | Limit the number of entries per page. |
Returns: (list[dict]) "tasks?project_id=project-id"
gazu.client.fetch_first(path, params = None)
| Name | Type | Description |
|---|---|---|
path | str | The path for which we want to retrieve the first entry. |
params | dict | The parameters to pass to the request. |
Returns: (dict | None) The first entry for which a model is required.
gazu.client.fetch_one(model_name, id, params = None)
Function dedicated at targeting routes that returns a single model instance.
| Name | Type | Description |
|---|---|---|
model_name | str | Model type name. |
id | str | Model instance ID. |
params | dict | The parameters to pass to the request. |
Returns: (dict) The model instance matching id and model name.
gazu.client.get(path, json_response = True, params = None)
Run a get request toward given path for configured host.
| Name | Type | Description |
|---|---|---|
path | str | The path to query. |
json_response | bool | Whether to return a json response. |
params | dict | The parameters to pass to the request. |
gazu.client.get_api_url_from_host()
Get the base URL to the Kitsu instance the client is connected to, without the `/api` suffix, e.g This can be used to build URL paths to particular records in the Kitsu web interface.
Returns: (str) The base Kitsu URL the client is connected to.
gazu.client.get_api_version()
Get the current version of the API.
Returns: (str) Current version of the API.
gazu.client.get_current_user()
Get the current user.
Returns: (dict) User database information for user linked to auth tokens.
gazu.client.get_event_host()
Get the host on which listening for events.
Returns: (str) The event host.
gazu.client.get_file_data_from_url(url, full = False)
Return data found at given url.
| Name | Type | Description |
|---|---|---|
url | str | The url to fetch data from. |
full | bool | Whether to use full url. |
Returns: (bytes) The data found at the given url.
gazu.client.get_full_url(path)
Join host url with given path.
| Name | Type | Description |
|---|---|---|
path | str | The path to integrate to host url. |
gazu.client.get_host()
Get the API URL for the Kitsu host the given client is connected to, e.g "http://kitsu.instance.com/api"
Returns: (str) The host of the client.
gazu.client.get_message_from_response(response, default_message = 'No additional information')
A utility function that handles Zou's inconsistent message keys. For a given request, checks if any error messages or regular messages were given and returns their value. If no messages are found, returns a default message.
| Name | Type | Description |
|---|---|---|
response | - | |
default_message | - |
Returns: (str) The message to display to the user.
gazu.client.host_is_up()
Check if the host is up.
Returns: (bool) True if the host is up.
gazu.client.host_is_valid()
Check if the host is valid by simulating a fake login.
Returns: (bool) True if the host is valid.
gazu.client.import_data(model_name, data)
Import data for given model.
| Name | Type | Description |
|---|---|---|
model_name | str | The data model to import. |
data | dict | The data to import. |
Returns: (dict) The imported data.
gazu.client.make_auth_header()
Make headers required to authenticate.
Returns: (dict[str, str]) Headers required to authenticate.
gazu.client.post(path, data)
Run a post request toward given path for configured host.
| Name | Type | Description |
|---|---|---|
path | str | The path to query. |
data | Any | The data to post. |
gazu.client.put(path, data)
Run a put request toward given path for configured host.
| Name | Type | Description |
|---|---|---|
path | str | The path to query. |
data | dict | The data to put. |
gazu.client.set_event_host(new_host)
Set the host on which listening for events.
| Name | Type | Description |
|---|---|---|
new_host | str | The new host to set. |
Returns: (str) The new event host.
gazu.client.set_host(new_host)
Set the host for the client.
| Name | Type | Description |
|---|---|---|
new_host | str | The new host to set. |
Returns: (str) The new host.
gazu.client.set_tokens(new_tokens)
Store authentication token to reuse them for all requests.
| Name | Type | Description |
|---|---|---|
new_tokens | dict | Tokens to use for authentication. |
Returns: (dict[str, str]) The stored tokens.
gazu.client.update(model_name, model_id, data)
Update an entry for given model, id and data.
| Name | Type | Description |
|---|---|---|
model_name | str | The model type involved. |
model_id | str | The target model id. |
data | dict | The data to update. |
Returns: (dict) Updated entry
gazu.client.upload(path, file_path = None, data = None, extra_files = None, files = None, progress_callback = None)
Upload file located at *file_path* to given url *path*.
| Name | Type | Description |
|---|---|---|
path | str | The url path to upload file. |
file_path | str | The file location on the hard drive. |
data | dict | The data to send with the file. |
extra_files | list | List of extra files to upload. |
files | dict | The dictionary of files to upload. |
progress_callback | Callable | Callback ``(bytes_read, total)`` invoked during upload. *total* is the sum of all file sizes. |
Returns: (Any) Response from the API.
gazu.client.url_path_join(*items)
Make it easier to build url path by joining every arguments with a '/' character.
| Name | Type | Description |
|---|---|---|
items | list | Path elements |
Returns: (str) The joined path.
concept
gazu.concept.all_concepts()
Returns: (list[dict]) All concepts from database.
gazu.concept.all_concepts_for_project(project)
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
Returns: (list[dict]) Concepts from database for the given project.
gazu.concept.all_previews_for_concept(concept)
| Name | Type | Description |
|---|---|---|
concept | str / dict | The concept dict or the concept ID. |
Returns: (list[dict]) Previews from database for given concept.
gazu.concept.get_concept(concept_id)
| Name | Type | Description |
|---|---|---|
concept_id | str | ID of claimed concept. |
Returns: (dict) Concept corresponding to given concept ID.
gazu.concept.get_concept_by_name(project, concept_name)
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
concept_name | str | Name of claimed concept. |
Returns: (dict | None) Concept corresponding to given name and project.
gazu.concept.new_concept(project, name, description = None, data = None, entity_concept_links = None)
Create a concept for given project. Allow to set metadata too.
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
name | str | The name of the concept to create. |
description | - | |
data | dict | Free field to set metadata of any kind. |
entity_concept_links | list | List of entities to tag, as either ID strings or model dicts. |
gazu.concept.remove_concept(concept, force = False)
Remove the given Concept from the database. If the Concept has tasks linked to it, this will by default mark the Concept as canceled. Deletion can be forced regardless of task links with the `force` parameter.
| Name | Type | Description |
|---|---|---|
concept | dict / str | Concept to remove. |
force | bool | Whether to force the deletion of the concept. |
gazu.concept.update_concept(concept)
Save given concept data into the API. Metadata are fully replaced by the ones set on given concept.
| Name | Type | Description |
|---|---|---|
concept | dict | The concept dict to update. |
Returns: (dict) Updated concept.
context
gazu.context.all_asset_types_for_project(project, user_context = False)
Return the list of asset types for which the user has a task.
| Name | Type | Description |
|---|---|---|
project | - | |
user_context | - |
gazu.context.all_assets_for_asset_type_and_project(project, asset_type, user_context = False)
Return the list of assets for given project and asset_type and for which the user has a task.
| Name | Type | Description |
|---|---|---|
project | - | |
asset_type | - | |
user_context | - |
gazu.context.all_assets_for_project(project, user_context = False)
Return the list of assets for which the user has a task.
| Name | Type | Description |
|---|---|---|
project | - | |
user_context | - |
gazu.context.all_episodes_for_project(project, user_context = False)
Return the list of episodes for given project and current user.
| Name | Type | Description |
|---|---|---|
project | - | |
user_context | - |
gazu.context.all_open_projects(user_context = False)
Return the list of projects for which the user has a task.
| Name | Type | Description |
|---|---|---|
user_context | - |
gazu.context.all_scenes_for_project(project, user_context = False)
Return the list of scenes for given project and current user.
| Name | Type | Description |
|---|---|---|
project | - | |
user_context | - |
gazu.context.all_scenes_for_sequence(sequence, user_context = False)
Return the list of scenes for given sequence and current user.
| Name | Type | Description |
|---|---|---|
sequence | - | |
user_context | - |
gazu.context.all_sequences_for_episode(episode, user_context = False)
Return the list of sequences for given episode and current user.
| Name | Type | Description |
|---|---|---|
episode | - | |
user_context | - |
gazu.context.all_sequences_for_project(project, user_context = False)
Return the list of sequences for given project and current user.
| Name | Type | Description |
|---|---|---|
project | - | |
user_context | - |
gazu.context.all_shots_for_sequence(sequence, user_context = False)
Return the list of shots for given sequence and current user.
| Name | Type | Description |
|---|---|---|
sequence | - | |
user_context | - |
gazu.context.all_task_types_for_asset(asset, user_context = False)
Return the list of tasks for given asset and current user.
| Name | Type | Description |
|---|---|---|
asset | - | |
user_context | - |
gazu.context.all_task_types_for_scene(scene, user_context = False)
Return the list of tasks for given scene and current user.
| Name | Type | Description |
|---|---|---|
scene | - | |
user_context | - |
gazu.context.all_task_types_for_sequence(sequence, user_context = False)
Return the list of tasks for given sequence and current user.
| Name | Type | Description |
|---|---|---|
sequence | - | |
user_context | - |
gazu.context.all_task_types_for_shot(shot, user_context = False)
Return the list of tasks for given shot and current user.
| Name | Type | Description |
|---|---|---|
shot | - | |
user_context | - |
edit
gazu.edit.all_edits_for_project(project)
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
Returns: (list[dict]) Edits from database or for given project.
gazu.edit.all_previews_for_edit(edit)
| Name | Type | Description |
|---|---|---|
edit | str / dict | The edit dict or the edit ID. |
Returns: (list[dict]) Previews from database for given edit.
gazu.edit.get_edit(edit_id)
| Name | Type | Description |
|---|---|---|
edit_id | str | ID of claimed edit. |
Returns: (dict) Edit corresponding to given edit ID.
gazu.edit.get_edit_by_name(project, edit_name)
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
edit_name | str | Name of claimed edit. |
Returns: (dict | None) Edit corresponding to given name and sequence.
gazu.edit.get_edit_url(edit)
| Name | Type | Description |
|---|---|---|
edit | str / dict | The edit dict or the edit ID. |
Returns: (str) Web url associated to the given edit
gazu.edit.new_edit(project, name, description = None, data = None, episode = None)
Create an edit for given project (and episode if given). Allow to set metadata too.
| Name | Type | Description |
|---|---|---|
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. |
gazu.edit.remove_edit(edit, force = False)
Remove given edit from database. If the Edit has tasks linked to it, this will by default mark the Edit as canceled. Deletion can be forced regardless of task links with the `force` parameter.
| Name | Type | Description |
|---|---|---|
edit | str / dict | Edit to remove. |
force | bool | Whether to force deletion of the edit regardless of whether it has links to tasks. |
gazu.edit.update_edit(edit)
Save given edit data into the API. Metadata are fully replaced by the ones set on given edit.
| Name | Type | Description |
|---|---|---|
edit | dict | The edit dict to update. |
Returns: (dict) Updated edit.
gazu.edit.update_edit_data(edit, data = None)
Update the metadata for the provided edit. Keys that are not provided are not changed.
| Name | Type | Description |
|---|---|---|
edit | str / dict | The edit dict or ID to save in database. |
data | dict | Free field to set metadata of any kind. |
Returns: (dict) Updated edit.
entity
gazu.entity.all_entities()
Returns: (list[dict]) Retrieve all entities
gazu.entity.all_entities_with_tasks_linked_to_entity(entity)
| Name | Type | Description |
|---|---|---|
entity | str / dict | Entity to get linked entities. |
Returns: (list[dict]) Retrieve all entities linked to given entity.
gazu.entity.all_entity_types()
Returns: (list[dict]) Entity types listed in database.
gazu.entity.get_entity(entity_id)
| Name | Type | Description |
|---|---|---|
entity_id | str | ID of claimed entity. |
Returns: (dict) asset, shot, sequence, episode, etc).
gazu.entity.get_entity_by_name(entity_name, project = None)
| Name | Type | Description |
|---|---|---|
entity_name | str | The name of the claimed entity. |
project | str / dict | Project ID or dict. |
gazu.entity.get_entity_type(entity_type_id)
| Name | Type | Description |
|---|---|---|
entity_type_id | str | ID of claimed entity type. |
gazu.entity.get_entity_type_by_name(entity_type_name)
| Name | Type | Description |
|---|---|---|
entity_type_name | str | The name of the claimed entity type |
gazu.entity.guess_from_path(project_id, path, sep = '/')
Get list of possible project file tree templates matching a file path and data ids corresponding to template tokens.
| Name | Type | Description |
|---|---|---|
project_id | str | Project id of given file |
path | str | Path to a file |
sep | str | File path separator, defaults to "/" |
Returns: (list[dict]) dictionaries with the corresponding entities and template name.
gazu.entity.new_entity_type(name)
Creates an entity type with the given name.
| Name | Type | Description |
|---|---|---|
name | str | The name of the entity type |
Returns: (dict) If an entity type with that name already exists.
gazu.entity.remove_entity(entity, force = False)
Remove given entity from database. If the Entity has tasks linked to it, this will by default mark the Entity as canceled. Deletion can be forced regardless of task links with the `force` parameter.
| Name | Type | Description |
|---|---|---|
entity | dict | Entity to remove. |
force | bool | Whether to force deletion of the entity regardless of whether it has links to tasks. |
gazu.entity.remove_entity_type(entity_type)
Remove given entity type from database.
| Name | Type | Description |
|---|---|---|
entity_type | str / dict | Entity type to remove. |
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)
| Name | Type | Description |
|---|---|---|
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: (list[dict]) Output files for a given asset instance, temporal entity, output type, task_type, name and representation
gazu.files.all_output_files_for_entity(entity, output_type = None, task_type = None, name = None, representation = None, file_status = None)
| Name | Type | Description |
|---|---|---|
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: (list[dict]) Output files for a given entity (asset or shot), output type, task_type, name and representation
gazu.files.all_output_files_for_project(project, output_type = None, task_type = None, name = None, representation = None, file_status = None)
| Name | Type | Description |
|---|---|---|
project | str / dict | The project 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: (list[dict]) Output files for a given project (asset or shot), output type, task_type, name and representation
gazu.files.all_output_types()
Returns: (list[dict]) Output types listed in database.
gazu.files.all_output_types_for_asset_instance(asset_instance, temporal_entity)
| Name | Type | Description |
|---|---|---|
asset_instance | - | |
temporal_entity | - |
Returns: (list[dict]) Output types for given asset instance and entity (shot or scene).
gazu.files.all_output_types_for_entity(entity)
| Name | Type | Description |
|---|---|---|
entity | str / dict | The entity dict or the entity ID. |
Returns: (list[dict]) All output types linked to output files for given entity.
gazu.files.all_softwares()
Returns: (list[dict]) Software versions listed in database.
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 = '/')
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.
| Name | Type | Description |
|---|---|---|
asset_instance | - | |
temporal_entity | - | |
output_type | str / dict | Output type of the generated file. |
task_type | str / dict | Task type related to output file. |
name | str | Additional suffix for the working file name. |
representation | str | Allow to select a template inside the template. |
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. |
sep | str | OS separator. |
gazu.files.build_entity_output_file_path(entity, output_type, task_type, name = 'main', mode = 'output', representation = '', revision = 0, nb_elements = 1, sep = '/')
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.
| Name | Type | Description |
|---|---|---|
entity | str / dict | Entity for which an output file is needed. |
output_type | str / dict | Output type of the generated file. |
task_type | str / dict | 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 | int | To represent an image sequence, the amount of file is needed. |
sep | str | OS separator. |
gazu.files.build_working_file_path(task, name = 'main', mode = 'working', software = None, revision = 1, sep = '/')
From the file path template configured at the project level and arguments, it builds a file path location where to store related DCC file.
| Name | Type | Description |
|---|---|---|
task | str / dict | 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 / dict | Software at the origin of the file. |
revision | int | File revision. |
sep | str | OS separator. |
gazu.files.download_attachment_file(attachment_file, file_path, progress_callback=None)
Download given attachment file and save it at given location.
| Name | Type | Description |
|---|---|---|
attachment_file | str / dict | The attachment file dict or ID. |
file_path | str | Location on hard drive where to save the file. |
progress_callback | - |
gazu.files.download_attachment_thumbnail(attachment_file, file_path, progress_callback=None)
Download the attachment file thumbnail.
| Name | Type | Description |
|---|---|---|
attachment_file | str / dict | The attachment file dict or ID. |
file_path | str | Location on hard drive where to save the file. |
progress_callback | - |
Returns: (requests.Response) Response object from the download request.
gazu.files.download_organisation_avatar(organisation, file_path, progress_callback=None)
Download given organisation's avatar and save it at given location.
| Name | Type | Description |
|---|---|---|
organisation | str / dict | The organisation dict or ID. |
file_path | str | Location on hard drive where to save the file. |
progress_callback | - |
gazu.files.download_person_avatar(person, file_path, progress_callback=None)
Download given person's avatar and save it at given location.
| Name | Type | Description |
|---|---|---|
person | str / dict | The person dict or ID. |
file_path | str | Location on hard drive where to save the file. |
progress_callback | - |
gazu.files.download_preview_file(preview_file, file_path, progress_callback=None)
Download given preview file and save it at given location.
| Name | Type | Description |
|---|---|---|
preview_file | str / dict | The preview file dict or ID. |
file_path | str | Location on hard drive where to save the file. |
progress_callback | - |
gazu.files.download_preview_file_cover(preview_file, file_path, progress_callback=None)
Download given preview file cover and save it at given location.
| Name | Type | Description |
|---|---|---|
preview_file | str / dict | The preview file dict or ID. |
file_path | str | Location on hard drive where to save the file. |
progress_callback | - |
gazu.files.download_preview_file_thumbnail(preview_file, file_path, progress_callback=None)
Download given preview file thumbnail and save it at given location.
| Name | Type | Description |
|---|---|---|
preview_file | str / dict | The preview file dict or ID. |
file_path | str | Location on hard drive where to save the file. |
progress_callback | - |
gazu.files.download_preview_lowdef_movie(preview_file, file_path, progress_callback=None)
Download the low-definition preview movie file.
| Name | Type | Description |
|---|---|---|
preview_file | str / dict | The preview file dict or ID. |
file_path | str | Location on hard drive where to save the file. |
progress_callback | - |
Returns: (requests.Response) Response object from the download request.
gazu.files.download_preview_movie(preview_file, file_path, progress_callback=None)
Download the preview movie file.
| Name | Type | Description |
|---|---|---|
preview_file | str / dict | The preview file dict or ID. |
file_path | str | Location on hard drive where to save the file. |
progress_callback | - |
Returns: (requests.Response) Response object from the download request.
gazu.files.download_project_avatar(project, file_path, progress_callback=None)
Download given project's avatar and save it at given location.
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or ID. |
file_path | str | Location on hard drive where to save the file. |
progress_callback | - |
gazu.files.download_working_file(working_file, file_path = None, progress_callback=None)
Download given working file and save it at given location.
| Name | Type | Description |
|---|---|---|
working_file | str / dict | The working file dict or ID. |
file_path | str | Location on hard drive where to save the file. |
progress_callback | - |
gazu.files.extract_frame_from_preview(preview_file, frame_number, file_path = None, progress_callback=None)
Extract a specific frame from a preview file.
| Name | Type | Description |
|---|---|---|
preview_file | str / dict | The preview file dict or ID. |
frame_number | int | The frame number to extract. |
file_path | str | Optional location on hard drive where to save the frame. If not provided, returns the response without saving. |
progress_callback | - |
Returns: (requests.Response) Response object containing the extracted frame.
gazu.files.extract_tile_from_preview(preview_file, file_path = None, progress_callback=None)
Extract a tile from a preview file.
| Name | Type | Description |
|---|---|---|
preview_file | str / dict | The preview file dict or ID. |
file_path | str | Optional location on hard drive where to save the tile. If not provided, returns the response without saving. |
progress_callback | - |
Returns: (requests.Response) Response object containing the extracted tile.
gazu.files.get_all_attachment_files_for_project(project)
Retrieves all the attachment files for a given project.
| Name | Type | Description |
|---|---|---|
project | str / dict | Target project, as ID string or model dict. |
Returns: (list[dict]) Attachment files for the project.
gazu.files.get_all_attachment_files_for_task(task)
Retrieves all the attachment files for a given task.
| Name | Type | Description |
|---|---|---|
task | str / dict | Target task, as ID string or model dict. |
gazu.files.get_all_preview_files_for_task(task)
Retrieves all the preview files for a given task.
| Name | Type | Description |
|---|---|---|
task | str / dict | Target task, as ID string or model dict. |
gazu.files.get_all_working_files_for_entity(entity, task = None, name = None)
Retrieves all the working files of a given entity and specied parameters
| Name | Type | Description |
|---|---|---|
entity | - | |
task | - | |
name | - |
gazu.files.get_attachment_file(attachment_file_id)
Return attachment file object corresponding to given ID.
| Name | Type | Description |
|---|---|---|
attachment_file_id | str | The attachment file ID. |
gazu.files.get_attachment_thumbnail_url(attachment_file)
Get the URL for the attachment file thumbnail.
| Name | Type | Description |
|---|---|---|
attachment_file | str / dict | The attachment file dict or ID. |
Returns: (str) URL to the attachment thumbnail.
gazu.files.get_file_status(status_id)
Return file status object corresponding to given ID.
| Name | Type | Description |
|---|---|---|
status_id | str | The files status ID. |
gazu.files.get_file_status_by_name(name)
Return file status object corresponding to given name
| Name | Type | Description |
|---|---|---|
name | str | The files status name. |
gazu.files.get_last_asset_instance_output_revision(asset_instance, temporal_entity, output_type, task_type, name = 'master')
Generate last output revision for given asset instance.
| Name | Type | Description |
|---|---|---|
asset_instance | - | |
temporal_entity | - | |
output_type | - | |
task_type | - | |
name | - |
gazu.files.get_last_entity_output_revision(entity, output_type, task_type, name = 'master')
| Name | Type | Description |
|---|---|---|
entity | str / dict | The entity dict or ID. |
output_type | str / dict | The entity dict or ID. |
task_type | str / dict | The entity dict or ID. |
name | str | The output name |
Returns: (int) Last revision of ouput files for given entity, output type and task type.
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)
| Name | Type | Description |
|---|---|---|
asset_instance | str / dict | The asset instance dict or ID. |
temporal_entity | str / dict | The temporal entity dict or ID. |
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: (list[dict]) last output files for given asset instance and temporal entity where it appears.
gazu.files.get_last_output_files_for_entity(entity, output_type = None, task_type = None, name = None, representation = None, file_status = None)
| Name | Type | Description |
|---|---|---|
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: (list[dict]) Last output files for a given entity (asset or shot), output type, task_type, name and representation
gazu.files.get_last_working_file_revision(task, name = 'main')
| Name | Type | Description |
|---|---|---|
task | str / dict | The task dict or the task ID. |
name | str | File name suffix (optional) |
Returns: (dict) Last revisions stored in the API for given task and given file name suffix.
gazu.files.get_last_working_files(task)
| Name | Type | Description |
|---|---|---|
task | str / dict | The task dict or the task ID. |
Returns: (dict) Keys are working file names and values are last working file availbable for given name.
gazu.files.get_next_asset_instance_output_revision(asset_instance, temporal_entity, output_type, task_type, name = 'master')
| Name | Type | Description |
|---|---|---|
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. |
name | - |
Returns: (int) Next revision of ouput files available for given asset insance temporal entity, output type and task type.
gazu.files.get_next_entity_output_revision(entity, output_type, task_type, name = 'main')
| Name | Type | Description |
|---|---|---|
entity | str / dict | The entity dict or ID. |
output_type | str / dict | The entity dict or ID. |
task_type | str / dict | The entity dict or ID. |
name | str | Get version for output file with the given name. |
Returns: (int) Next revision of output files available for given entity, output type and task type.
gazu.files.get_output_file(output_file_id)
| Name | Type | Description |
|---|---|---|
output_file_id | str | ID of claimed output file. |
Returns: (dict) Output file matching given ID.
gazu.files.get_output_file_by_path(path)
| Name | Type | Description |
|---|---|---|
path | str | Path of claimed output file. |
Returns: (dict | None) Output file matching given path, or None if there are no matches.
gazu.files.get_output_type(output_type_id)
| Name | Type | Description |
|---|---|---|
output_type_id | str | ID of claimed output type. |
Returns: (dict) Output type matching given ID.
gazu.files.get_output_type_by_name(output_type_name)
| Name | Type | Description |
|---|---|---|
output_type_name | str | name of claimed output type. |
Returns: (dict | None) Output type matching given name.
gazu.files.get_preview_file(preview_file_id)
| Name | Type | Description |
|---|---|---|
preview_file_id | str | ID of claimed preview file. |
Returns: (dict) Preview file corresponding to given ID.
gazu.files.get_preview_file_url(preview_file)
Return given preview file URL
| Name | Type | Description |
|---|---|---|
preview_file | str / dict | The preview file dict or ID. |
gazu.files.get_preview_lowdef_movie_url(preview_file)
Get the URL for the low-definition preview movie file.
| Name | Type | Description |
|---|---|---|
preview_file | str / dict | The preview file dict or ID. |
Returns: (str) URL to the low-definition preview movie file.
gazu.files.get_preview_movie_url(preview_file, lowdef = False)
Get the URL for the preview movie file.
| Name | Type | Description |
|---|---|---|
preview_file | str / dict | The preview file dict or ID. |
lowdef | bool | If True, returns the low-definition version URL. If False, returns the original/high-definition version URL. |
Returns: (str) URL to the preview movie file.
gazu.files.get_running_preview_files()
Get all preview files currently being processed.
Returns: (list[dict]) Preview files that are currently running/processing.
gazu.files.get_software(software_id)
| Name | Type | Description |
|---|---|---|
software_id | str | ID of claimed output type. |
Returns: (dict) Software object corresponding to given ID.
gazu.files.get_software_by_name(software_name)
| Name | Type | Description |
|---|---|---|
software_name | str | Name of claimed output type. |
Returns: (dict | None) Software object corresponding to given name.
gazu.files.get_working_file(working_file_id)
| Name | Type | Description |
|---|---|---|
working_file_id | str | ID of claimed working file. |
Returns: (dict) Working file corresponding to given ID.
gazu.files.get_working_files_for_task(task)
| Name | Type | Description |
|---|---|---|
task | str / dict | The task dict or the task ID. |
Returns: (list[dict]) Working files related to given task.
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)
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).
| Name | Type | Description |
|---|---|---|
asset_instance | str / dict | Asset instance for which an output file is needed. |
temporal_entity | str / dict | Temporal entity for which an output file is needed. |
output_type | str / dict | Output type of the generated file. |
task_type | str / dict | Task type related to output file. |
comment | str | Comment related to created revision. |
name | str | Additional suffix for the working file name. |
mode | str | Allow to select a template inside the template. |
working_file | str / dict | Working file which is the source of the generated file. |
person | str / dict | Author of the file. |
revision | int | File revision. |
nb_elements | int | To represent an image sequence, the amount of file needed. |
representation | str | Differentiate 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 |
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)
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).
| Name | Type | Description |
|---|---|---|
entity | str / dict | Entity for which an output file is needed. |
output_type | str / dict | Output type of the generated file. |
task_type | str / dict | Task type related to output file. |
comment | str | Comment related to created revision. |
working_file | str / dict | Working file which is the source of the generated file. |
person | str / dict | 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 | int | To represent an image sequence, the amount of file is needed. |
representation | str | Differientate file extensions. It can be useful to build folders based on extensions like abc, jpg, etc. |
sep | str | OS separator. |
file_status_id | id | The id of the file status to set at creation |
Returns: (dict) Created output file.
gazu.files.new_file_status(name, color)
Create a new file status if not existing yet. If the file status already exists, the existing record will be returned.
| Name | Type | Description |
|---|---|---|
name | str | the name of the status to create. |
color | str | The color for the status as a Hex string, e.g "#00FF00". |
gazu.files.new_output_type(name, short_name)
Create a new output type in database.
| Name | Type | Description |
|---|---|---|
name | str | Name of created output type. |
short_name | str | Name shorten to represente the type in UIs. |
Returns: (dict) Created output type.
gazu.files.new_software(name, short_name, file_extension, secondary_extensions = None)
Create a new software in datatabase.
| Name | Type | Description |
|---|---|---|
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. |
secondary_extensions | list[str] | None | Optional list of secondary file extensions (e.g. ["ma", "mb"] for Maya). |
Returns: (dict) Created software.
gazu.files.new_working_file(task, name = 'main', mode = 'working', software = None, comment = '', person = None, revision = 0, sep = '/')
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).
| Name | Type | Description |
|---|---|---|
task | str / dict | 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 / dict | Software at the origin of the file. |
comment | str | Comment related to created revision. |
person | str / dict | Author of the file. |
revision | int | File revision. |
sep | str | OS separator. |
gazu.files.remove_preview_file(preview_file, force = False)
Remove given preview file from database. Depending on the configuration of the Kitsu server, the stored files linked to the preview file may or may not be removed on deletion of a preview file. The `force=True` parameter can be used to force deletion of the files regardless of server config.
| Name | Type | Description |
|---|---|---|
preview_file | str / dict | The preview_file dict or ID. |
force | bool | Whether to force deletion of the files linked to the preview file in storage. |
gazu.files.set_project_file_tree(project, file_tree_name)
(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.
| Name | Type | Description |
|---|---|---|
project | str / dict | The project file dict or ID. |
file_tree_name | - |
Returns: (dict) Modified project.
gazu.files.update_comment(working_file, comment)
Update the file comment in database for given working file.
| Name | Type | Description |
|---|---|---|
working_file | str / dict | The working file dict or ID. |
comment | - |
Returns: (dict) Modified working file
gazu.files.update_modification_date(working_file)
Update modification date of given working file with current time (now).
| Name | Type | Description |
|---|---|---|
working_file | str / dict | The working file dict or ID. |
Returns: (dict) Modified working file
gazu.files.update_output_file(output_file, data)
Update the data of given output file.
| Name | Type | Description |
|---|---|---|
output_file | str / dict | The output file dict or ID. |
data | dict | Data to update on the output file. |
Returns: (dict) Modified output file
gazu.files.update_preview(preview_file, data)
Update the data of given preview file.
| Name | Type | Description |
|---|---|---|
preview_file | str / dict | The preview file dict or ID. |
data | dict | Data to update on the prevew file. |
Returns: (dict) Modified preview file
gazu.files.update_preview_annotations(preview_file, additions = None, updates = None, deletions = None)
Update annotations on a preview file. Allow to modify the annotations stored at the preview level. Modifications are applied via three fields: additions to give all the annotations that need to be added, updates that list annotations that need to be modified, and deletions to list the IDs of annotations that need to be removed.
| Name | Type | Description |
|---|---|---|
preview_file | str / dict | The preview file dict or ID. |
additions | list[dict] | Annotations to add. Each annotation should be a dict with properties like 'x', 'y', 'type', etc. Example: [{"x": 100, "y": 200, "type": "drawing"}] |
updates | list[dict] | Annotations to update. Each annotation should include an 'id' field along with the fields to update. Example: [{"id": "uuid", "x": 150, "y": 250}] |
deletions | list[str] | Annotation IDs to remove. Example: ["a24a6ea4-ce75-4665-a070-57453082c25"] |
Returns: (dict) Updated preview file with the updated annotations array.
gazu.files.update_preview_position(preview_file, position)
Update the position of a preview file (the displayed order for a single revision).
| Name | Type | Description |
|---|---|---|
preview_file | str / dict | The preview file dict or ID. |
position | float | The new position value. |
Returns: (dict) Updated preview file.
gazu.files.update_project_file_tree(project, file_tree)
Set given dict as file tree template on given project. This template will be used to generate file paths.
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or ID. |
file_tree | dict | The file tree template to set on project. |
Returns: (dict) Modified project.
gazu.files.update_software(software)
Save given software data into the API. Use this to set or change secondary_extensions and other fields.
| Name | Type | Description |
|---|---|---|
software | dict | The software dict to update (must include "id"). |
Returns: (dict) Updated software.
gazu.files.upload_organisation_avatar(organisation, file_path, progress_callback=None)
Upload given file as organisation avatar.
| Name | Type | Description |
|---|---|---|
organisation | str / dict | The organisation dict or ID. |
file_path | str | Path of the file to upload as avatar. |
progress_callback | - |
Returns: (dict[Literal['thumbnail_path'], str]) Dictionary with a key of 'thumbnail_path' and a value of the path to the static image file, relative to the host url.
gazu.files.upload_person_avatar(person, file_path, progress_callback=None)
Upload given file as person avatar.
| Name | Type | Description |
|---|---|---|
person | str / dict | The person dict or the person ID. |
file_path | str | Path of the file to upload as avatar. |
progress_callback | - |
Returns: (dict[Literal['thumbnail_path'], str]) Dictionary with a key of 'thumbnail_path' and a value of the path to the static image file, relative to the host url.
gazu.files.upload_project_avatar(project, file_path, progress_callback=None)
Upload given file as project avatar.
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or ID. |
file_path | str | Path of the file to upload as avatar. |
progress_callback | - |
Returns: (dict[Literal['thumbnail_path'], str]) Dictionary with a key of 'thumbnail_path' and a value of the path to the static image file, relative to the host url.
gazu.files.upload_working_file(working_file, file_path, progress_callback=None)
Save given file in working file storage.
| Name | Type | Description |
|---|---|---|
working_file | str / dict | The working file dict or ID. |
file_path | str | Location on hard drive where to save the file. |
progress_callback | - |
Returns: (dict) the working file model dictionary.
person
gazu.person.add_person_to_department(person, department)
Add a person to a department.
| Name | Type | Description |
|---|---|---|
person | str / dict | The person dict or id. |
department | str / dict | The department dict or id. |
Returns: (dict) Response information.
gazu.person.all_departments()
Returns: (list[dict]) Departments listed in database.
gazu.person.all_organisations()
Returns: (list[dict]) Organisations listed in database.
gazu.person.all_persons()
Returns: (list[dict]) Persons listed in database.
gazu.person.change_password_for_person(person, password)
Change the password for given person.
| Name | Type | Description |
|---|---|---|
person | str / dict | The person dict or the person ID. |
password | str | The new password. |
Returns: (dict[Literal['success'], bool]) success or not.
gazu.person.clear_person_avatar(person)
Clear avatar for a person.
| Name | Type | Description |
|---|---|---|
person | str / dict | The person dict or id. |
Returns: (str) Request response object.
gazu.person.disable_two_factor_authentication(person)
Disable two factor authentication for a person.
| Name | Type | Description |
|---|---|---|
person | str / dict | The person dict or id. |
Returns: (str) Request response object.
gazu.person.get_all_month_time_spents(id, date)
| Name | Type | Description |
|---|---|---|
id | str | An uuid identifying a person. |
date | datetime.date | The date of the month to query. |
Returns: (list) All of the person's time spents for the given month.
gazu.person.get_day_offs(person)
Get day offs for a person.
| Name | Type | Description |
|---|---|---|
person | str / dict | The person dict or id. |
Returns: (list[dict]) Day offs for the person.
gazu.person.get_department(department_id)
| Name | Type | Description |
|---|---|---|
department_id | str | An uuid identifying a department. |
Returns: (dict) Department corresponding to given department_id.
gazu.person.get_department_by_name(name)
| Name | Type | Description |
|---|---|---|
name | str | Department name. |
Returns: (dict | None) Department corresponding to given name.
gazu.person.get_month_day_offs(person, year, month)
Get day offs for a person for a specific month.
| Name | Type | Description |
|---|---|---|
person | str / dict | The person dict or id. |
year | int | Year. |
month | int | Month number. |
Returns: (list[dict]) Day offs for the month.
gazu.person.get_organisation()
Returns: (dict) Database information for organisation linked to auth tokens.
gazu.person.get_person(id, relations = False)
| Name | Type | Description |
|---|---|---|
id | str | An uuid identifying a person. |
relations | bool | Whether to get the relations for the given person. |
Returns: (dict | None) Person corresponding to given id, or None if no Person exists with that ID.
gazu.person.get_person_by_desktop_login(desktop_login)
| Name | Type | Description |
|---|---|---|
desktop_login | str | Login used to sign in on the desktop computer. |
Returns: (dict | None) Person corresponding to given desktop computer login.
gazu.person.get_person_by_email(email)
| Name | Type | Description |
|---|---|---|
email | str | User's email. |
Returns: (dict | None) Person corresponding to given email.
gazu.person.get_person_by_full_name(full_name, first_name = None, last_name = None)
| Name | Type | Description |
|---|---|---|
full_name | str | User's full name |
first_name | str | User's first name |
last_name | str | User's last name |
Returns: (dict | None) Person corresponding to given name, or None if not found.
gazu.person.get_person_url(person)
| Name | Type | Description |
|---|---|---|
person | str / dict | The person dict or the person ID. |
Returns: (str) Web url associated to the given person
gazu.person.get_presence_log(year, month)
| Name | Type | Description |
|---|---|---|
year | int | The number of the year to fetch logs during. |
month | int | The index of the month to get presence logs for. Indexed from 1, e.g 1 = January, 2 = February, ... |
Returns: (str) The presence log table (in CSV) for given month and year.
gazu.person.get_time_spents_by_date(person, date)
Get time spents for a person on a specific date.
| Name | Type | Description |
|---|---|---|
person | str / dict | The person dict or id. |
date | str | Date in YYYY-MM-DD format. |
Returns: (list[dict]) Time spents for the date.
gazu.person.get_time_spents_range(person_id, start_date, end_date)
Gets the time spents of the current user for the given date range.
| Name | Type | Description |
|---|---|---|
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: (list) All of the person's time spents
gazu.person.get_week_day_offs(person, year, week)
Get day offs for a person for a specific week.
| Name | Type | Description |
|---|---|---|
person | str / dict | The person dict or id. |
year | int | Year. |
week | int | Week number. |
Returns: (list[dict]) Day offs for the week.
gazu.person.get_week_time_spents(person, year, week)
Get time spents for a person for a specific week.
| Name | Type | Description |
|---|---|---|
person | str / dict | The person dict or id. |
year | int | Year. |
week | int | Week number. |
Returns: (list[dict]) Time spents for the week.
gazu.person.get_year_day_offs(person, year)
Get day offs for a person for a specific year.
| Name | Type | Description |
|---|---|---|
person | str / dict | The person dict or id. |
year | int | Year. |
Returns: (list[dict]) Day offs for the year.
gazu.person.get_year_time_spents(person, year)
Get time spents for a person for a specific year.
| Name | Type | Description |
|---|---|---|
person | str / dict | The person dict or id. |
year | int | Year. |
Returns: (list[dict]) Time spents for the year.
gazu.person.invite_person(person)
Sends an email to given person to invite him/her to connect to Kitsu.
| Name | Type | Description |
|---|---|---|
person | str / dict | The person to invite. |
Returns: (dict[str, str]) Response dict with 'success' and 'message' keys.
gazu.person.new_bot(name, email, role = 'user', departments = None, active = True, expiration_date = None)
Create a new bot based on given parameters. His access token will be in the return dict.
| Name | Type | Description |
|---|---|---|
name | str | the name of the bot. |
email | str | the email of the bot. |
role | str | user, manager, admin (which 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: (dict) Created bot.
gazu.person.new_department(name, color = '', archived = False)
Create a new department based on given parameters.
| Name | Type | Description |
|---|---|---|
name | str | the name of the department. |
color | str | the color of the department as a Hex string, e.g "#00FF00". |
archived | bool | Whether the department is archived or not. |
Returns: (dict) Created department.
gazu.person.new_person(first_name, last_name, email, phone = '', role = 'user', desktop_login = '', departments = None, password = None, active = True, contract_type = 'open-ended')
Create a new person based on given parameters. His/her password will is set automatically to default.
| Name | Type | Description |
|---|---|---|
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 (which 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. |
contract_type | - |
Returns: (dict) Created person.
gazu.person.remove_bot(bot, force = False)
Remove given bot from database.
| Name | Type | Description |
|---|---|---|
bot | dict | Bot to remove. |
force | - |
gazu.person.remove_department(department, force=False)
Remove given department from database.
| Name | Type | Description |
|---|---|---|
department | dict / ID | Department to remove. |
force | bool | Whether to force deletion of the department. |
gazu.person.remove_person(person, force = False)
Remove given person from database.
| Name | Type | Description |
|---|---|---|
person | str / dict | Person to remove. |
force | - |
gazu.person.remove_person_from_department(person, department)
Remove a person from a department.
| Name | Type | Description |
|---|---|---|
person | str / dict | The person dict or id. |
department | str / dict | The department dict or id. |
Returns: (str) Request response object.
gazu.person.set_avatar(person, file_path, progress_callback=None)
Upload picture and set it as avatar for given person.
| Name | Type | Description |
|---|---|---|
person | str / dict | The person dict or the person ID. |
file_path | str | Path where the avatar file is located on the hard drive. |
progress_callback | - |
Returns: (dict[Literal['thumbnail_path'], str]) Dictionary with a key of 'thumbnail_path' and a value of the path to the static image file, relative to the host url.
gazu.person.update_bot(bot)
Update a bot.
| Name | Type | Description |
|---|---|---|
bot | dict | The bot dict that needs to be upgraded. |
Returns: (dict) The updated bot.
gazu.person.update_department(department)
Update a department.
| Name | Type | Description |
|---|---|---|
department | dict | The department dict that needs to be updated. |
Returns: (Unknown) The updated department.
gazu.person.update_person(person)
Update a person.
| Name | Type | Description |
|---|---|---|
person | dict | The person dict that needs to be upgraded. |
Returns: (dict) The updated person.
playlist
gazu.playlist.add_entity_to_playlist(playlist, entity, preview_file = None, persist = True)
Add an entity to the playlist, use the last uploaded preview as revision to review.
| Name | Type | Description |
|---|---|---|
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: (dict) Updated playlist.
gazu.playlist.all_build_jobs_for_project(project)
Get all build jobs for a project.
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or id. |
Returns: (list[dict]) All build jobs for the project.
gazu.playlist.all_playlists()
Returns: (list[dict]) All playlists for all projects.
gazu.playlist.all_playlists_for_episode(episode)
| Name | Type | Description |
|---|---|---|
episode | str / dict | The episode dict or the episode ID. |
Returns: (list[dict]) All playlists for the given episode.
gazu.playlist.all_playlists_for_project(project, page = 1)
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
page | int | Page number for pagination |
Returns: (list[dict]) All playlists for the given project
gazu.playlist.all_shots_for_playlist(playlist)
| Name | Type | Description |
|---|---|---|
playlist | str / dict | The playlist dict or the playlist ID. |
Returns: (list[dict]) All shots linked to the given playlist
gazu.playlist.build_playlist_movie(playlist)
Build a movie for a playlist.
| Name | Type | Description |
|---|---|---|
playlist | str / dict | The playlist dict or id. |
Returns: (dict) Build job information.
gazu.playlist.delete_playlist(playlist)
Delete a playlist.
| Name | Type | Description |
|---|---|---|
playlist | str / dict | The playlist dict or id. |
Returns: (str) Request response object.
gazu.playlist.download_playlist_build(playlist, build_job, file_path, progress_callback=None)
Download a playlist build.
| Name | Type | Description |
|---|---|---|
playlist | str / dict | The playlist dict or id. |
build_job | str / dict | The build job dict or id. |
file_path | str | The location to store the file on the hard drive. |
progress_callback | - |
Returns: (requests.Response) Request response object.
gazu.playlist.download_playlist_zip(playlist, file_path, progress_callback=None)
Download a playlist as a zip file.
| Name | Type | Description |
|---|---|---|
playlist | str / dict | The playlist dict or id. |
file_path | str | The location to store the file on the hard drive. |
progress_callback | - |
Returns: (requests.Response) Request response object.
gazu.playlist.generate_temp_playlist(project, data)
Generate a temporary playlist.
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or id. |
data | dict | Playlist generation data. |
Returns: (dict) Generated temporary playlist.
gazu.playlist.get_build_job(build_job)
Get a build job.
| Name | Type | Description |
|---|---|---|
build_job | str / dict | The build job dict or id. |
Returns: (dict) Build job information.
gazu.playlist.get_entity_preview_files(entity)
Get all preview files grouped by task type for a given entity.
| Name | Type | Description |
|---|---|---|
entity | str / dict | The entity to retrieve files from or its ID. |
Returns: (dict[str, list[dict]]) A dict where keys are task type IDs and value array of revisions.
gazu.playlist.get_entity_previews(playlist)
Get entity previews for a playlist.
| Name | Type | Description |
|---|---|---|
playlist | str / dict | The playlist dict or id. |
Returns: (list[dict]) Entity previews for the playlist.
gazu.playlist.get_playlist(playlist)
| Name | Type | Description |
|---|---|---|
playlist | str / dict | The playlist dict or the playlist ID. |
Returns: (dict) playlist object for given id.
gazu.playlist.get_playlist_by_name(project, name)
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
name | str | The playlist name |
Returns: (dict | None) Playlist matching given name for given project.
gazu.playlist.new_playlist(project, name, episode = None, for_entity: "Literal[('shot', 'asset', 'sequence')]" = 'shot', for_client = False, is_for_all = False)
Create a new playlist in the database for given project.
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
name | str | Playlist name. |
episode | str / dict / None | Optional episode dict or ID. If None, the playlist is project-level; set is_for_all=True to place it under "All Assets" in the web UI. |
for_entity | str | The type of entity to include in the playlist, can be one of "asset", "sequence" or "shot". |
for_client | bool | Whether the playlist should be shared with clients. |
is_for_all | bool | If True and episode is None, the playlist is created under "All Assets" instead of "Main Pack" in the web UI. |
Returns: (dict) Created playlist.
gazu.playlist.notify_clients_playlist_ready(playlist)
Notify clients that a playlist is ready.
| Name | Type | Description |
|---|---|---|
playlist | str / dict | The playlist dict or id. |
Returns: (dict) Notification response.
gazu.playlist.remove_build_job(build_job)
Delete a build job.
| Name | Type | Description |
|---|---|---|
build_job | str / dict | The build job dict or id. |
gazu.playlist.remove_entity_from_playlist(playlist, entity, persist = True)
Remove all occurences of a given entity from a playlist.
| Name | Type | Description |
|---|---|---|
playlist | dict | Playlist object to modify |
entity | str / dict | the entity to remove or its ID |
persist | bool | Set it to True to save the result to the API. |
Returns: (dict) Updated playlist.
gazu.playlist.update_entity_preview(playlist, entity, preview_file, persist = True)
Update the preview file linked to a given entity in a playlist.
| Name | Type | Description |
|---|---|---|
playlist | dict | Playlist object to modify. |
entity | str / dict | The entity to update the preview file for. |
preview_file | str / dict | The new preview file to set for the entity. |
persist | bool | Set it to True to save the result to the API. |
Returns: (dict) Updated playlist.
gazu.playlist.update_playlist(playlist)
Save given playlist data into the API. Metadata are fully replaced by the ones set on given playlist.
| Name | Type | Description |
|---|---|---|
playlist | dict | The playlist dict to update. |
Returns: (dict) Updated playlist.
project
gazu.project.add_metadata_descriptor(project, name, entity_type, data_type = 'string', choices = None, for_client = False, departments = None)
Create a new metadata descriptor for a project.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
name | str | The name of the metadata descriptor |
entity_type | str | asset, shot or scene. |
data_type | - | |
choices | list | A list of possible values, empty list for free values. for_client (bool) : Wheter it should be displayed in Kitsu or not. |
for_client | - | |
departments | list | A list of departments dict or id. |
Returns: (dict) Created metadata descriptor.
gazu.project.add_person_to_team(project, person)
Add a person to the team project.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
person | dict / ID | The person dict or id. |
Returns: (dict) The project dictionary.
gazu.project.add_preview_background_file(project, background_file: "dict[Literal['preview_background_file_id'], str]")
Add a preview background file to a project. The background_file payload must be a dict in the form: {"preview_background_file_id": <background file id>}
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
background_file | dict | A dict with a key of "preview_background_file_id" and value of the ID of the preview background to add. |
Returns: (dict) The project dictionary.
gazu.project.add_status_automation(project, automation: "dict[Literal['status_automation_id'], str]")
Add a status automation to the project.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
automation | dict | A dictionary with a key of "status_automation_id" and value of the automation ID. |
Returns: (dict) The project dictionary.
gazu.project.all_metadata_descriptors(project)
Get all the metadata descriptors.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
Returns: (list[dict]) The metadata descriptors.
gazu.project.all_open_projects()
gazu.project.all_project_status()
Returns: (list[dict]) Project status listed in database.
gazu.project.all_projects()
Returns: (list[dict]) Projects stored in the database.
gazu.project.all_status_automations(project)
Get status automations configured for a project.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
Returns: (list[dict]) The status automations.
gazu.project.close_project(project)
Closes the provided project.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id to save in database. |
Returns: (dict) Updated project.
gazu.project.create_budget(project, name, description = None, currency = None, start_date = None, end_date = None, amount = None)
Create a budget for a project.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
name | str | Budget name. Required. |
description | str, optional | Human description. |
currency | str, optional | Currency code (e.g. "USD", "EUR"). |
start_date | str, optional | Start date ISO format (YYYY-MM-DD). |
end_date | str, optional | End date ISO format (YYYY-MM-DD). |
amount | number, optional | Overall budget amount. |
gazu.project.create_budget_entry(project, budget, name, date = None, amount = None, quantity = None, unit_price = None, description = None, category = None)
Create a budget entry for a specific budget.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
budget | dict / ID | The budget dict or id. |
name | str | Entry name. Required. |
date | str, optional | Entry date in ISO format (YYYY-MM-DD). |
amount | number, optional | Total amount for the entry. |
quantity | number, optional | Quantity used to compute amount. |
unit_price | number, optional | Unit price used with quantity. |
description | str, optional | Human description for the entry. |
category | str, optional | Category label for the entry. |
gazu.project.get_budget(project, budget)
Get a specific budget.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
budget | dict / ID | The budget dict or id. |
gazu.project.get_budget_entries(project, budget)
Get entries for a specific budget.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
budget | dict / ID | The budget dict or id. |
gazu.project.get_budget_entry(project, budget, entry)
Get a specific budget entry.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
budget | dict / ID | The budget dict or id. |
entry | dict / ID | The budget entry dict or id. |
gazu.project.get_budgets(project)
Get budgets for a project.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
gazu.project.get_metadata_descriptor(project, metadata_descriptor_id)
Retrieve a the metadata descriptor matching given ID.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
metadata_descriptor_id | dict / ID | The metadata descriptor dict or id. |
Returns: (dict) The metadata descriptor matching the ID.
gazu.project.get_metadata_descriptor_by_field_name(project, field_name)
Get a metadata descriptor matching the given project and name.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
field_name | str | The name of the metadata field. |
Returns: (dict | None) The metadata descriptor matchind the ID.
gazu.project.get_milestones(project)
Get production milestones for a project.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
gazu.project.get_preview_background_files(project)
Get preview background files configured for a project.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
gazu.project.get_project(project_id)
| Name | Type | Description |
|---|---|---|
project_id | str | ID of claimed project. |
Returns: (dict) Project corresponding to given id.
gazu.project.get_project_by_name(project_name)
| Name | Type | Description |
|---|---|---|
project_name | str | Name of claimed project. |
Returns: (dict | None) Project corresponding to given name.
gazu.project.get_project_person_quotas(project, person)
Get quotas for a person within a project.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
person | dict / ID | The person dict or id. |
gazu.project.get_project_quotas(project)
Get quotas for a project.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
gazu.project.get_project_status_by_name(project_status_name)
| Name | Type | Description |
|---|---|---|
project_status_name | str | Name of claimed project status. |
Returns: (dict | None) Project status corresponding to given name.
gazu.project.get_project_task_statuses(project)
Get task statuses configured for a project.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
Returns: (list[dict]) The task statuses.
gazu.project.get_project_task_types(project)
Get task types configured for a project.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
Returns: (list[dict]) The task types.
gazu.project.get_project_url(project, section = 'assets')
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
section | str | The section we want to open in the browser. |
Returns: (str) Web url associated to the given project
gazu.project.get_team(project)
Get team for project.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
Returns: (list[dict]) The list of user dicts that are part of the project team.
gazu.project.new_project(name, production_type = 'short', team = None, asset_types = None, task_statuses = None, task_types = None, production_style = '2d3d')
Creates a new project.
| Name | Type | Description |
|---|---|---|
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: (dict) Created project.
gazu.project.remove_budget(project, budget)
Delete a specific budget.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
budget | dict / ID | The budget dict or id. |
gazu.project.remove_budget_entry(project, budget, entry)
Delete a specific budget entry.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
budget | dict / ID | The budget dict or id. |
entry | dict / ID | The budget entry dict or id. |
gazu.project.remove_metadata_descriptor(project, metadata_descriptor_id, force = False)
Remove a metadata descriptor.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
metadata_descriptor_id | dict / ID | The metadata descriptor dict or id. |
force | - |
gazu.project.remove_person_from_team(project, person)
Remove a person from the team project.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
person | dict / ID | The person dict or id. |
gazu.project.remove_preview_background_file(project, background_file)
Remove a preview background file from a project.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
background_file | dict / ID | The background file dict or id. |
gazu.project.remove_project(project, force = False)
Remove given project from database. (Prior to do that, make sure, there is no asset or shot left).
| Name | Type | Description |
|---|---|---|
project | dict / str | Project to remove. |
force | - |
gazu.project.remove_status_automation(project, automation)
Remove a status automation from the project.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
automation | dict / ID | The automation dict or id. |
gazu.project.remove_task_status(project, task_status)
Remove a task status from the project.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
task_status | dict / ID | The task status dict or id. |
Returns: (str) Response from the API.
gazu.project.remove_task_type(project, task_type)
Remove a task type from the project.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
task_type | dict / ID | The task type dict or id. |
Returns: (str) Response from the API.
gazu.project.update_budget(project, budget, data)
Update a specific budget.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
budget | dict / ID | The budget dict or id. |
data | dict | The updated budget payload. |
gazu.project.update_budget_entry(project, budget, entry, data)
Update a specific budget entry.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
budget | dict / ID | The budget dict or id. |
entry | dict / ID | The budget entry dict or id. |
data | dict | The updated budget entry payload. |
gazu.project.update_metadata_descriptor(project, metadata_descriptor)
Update a metadata descriptor.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id. |
metadata_descriptor | dict | The metadata descriptor that needs to be updated. |
Returns: (dict) The updated metadata descriptor.
gazu.project.update_project(project)
Save given project data into the API. Metadata are fully replaced by the ones set on given project.
| Name | Type | Description |
|---|---|---|
project | dict | The project to update. |
Returns: (dict) Updated project.
gazu.project.update_project_data(project, data = None)
Update the metadata for the provided project. Keys that are not provided are not changed.
| Name | Type | Description |
|---|---|---|
project | dict / ID | The project dict or id to save in database. |
data | dict | Free field to set metadata of any kind. |
Returns: (dict) Updated project.
search
gazu.search.search_entities(query, project = None, entity_types = None)
Search for entities matching the given query.
| Name | Type | Description |
|---|---|---|
query | str | Search query string. |
project | str / dict | Optional project to limit search to. |
entity_types | list | Optional list of entity type dicts or IDs to filter by. |
Returns: (dict[str, list]) Dictionary with entity type keys ("persons", "assets", "shots") containing lists of matching entities for each type.
scene
gazu.scene.add_shot_to_scene(scene, shot)
Link a shot to a scene to mark the fact it was generated out from that scene.
| Name | Type | Description |
|---|---|---|
scene | - | |
shot | - |
gazu.scene.all_asset_instances_for_scene(scene)
Return the list of asset instances listed in a scene.
| Name | Type | Description |
|---|---|---|
scene | - |
gazu.scene.all_camera_instances_for_scene(scene)
Return the list of camera instances listed in a scene.
| Name | Type | Description |
|---|---|---|
scene | - |
gazu.scene.all_scenes(project = None)
Retrieve all scenes.
| Name | Type | Description |
|---|---|---|
project | - |
gazu.scene.all_scenes_for_project(project)
Retrieve all scenes for given project.
| Name | Type | Description |
|---|---|---|
project | - |
gazu.scene.all_scenes_for_sequence(sequence)
Retrieve all scenes which are children from given sequence.
| Name | Type | Description |
|---|---|---|
sequence | - |
gazu.scene.all_shots_for_scene(scene)
Return the list of shots issued from given scene.
| Name | Type | Description |
|---|---|---|
scene | - |
gazu.scene.get_asset_instance_by_name(scene, name)
Returns the asset instance of the scene that has the given name.
| Name | Type | Description |
|---|---|---|
scene | - | |
name | - |
gazu.scene.get_scene(scene_id)
Return scene corresponding to given scene ID.
| Name | Type | Description |
|---|---|---|
scene_id | - |
gazu.scene.get_scene_by_name(sequence, scene_name)
Returns scene corresponding to given sequence and name.
| Name | Type | Description |
|---|---|---|
sequence | - | |
scene_name | - |
gazu.scene.get_sequence_from_scene(scene)
Return sequence which is parent of given scene.
| Name | Type | Description |
|---|---|---|
scene | - |
gazu.scene.new_scene(project, sequence, name)
Create a scene for given sequence.
| Name | Type | Description |
|---|---|---|
project | - | |
sequence | - | |
name | - |
gazu.scene.new_scene_asset_instance(scene, asset, description = None)
Creates a new asset instance on given scene. The instance number is automatically generated (increment highest number).
| Name | Type | Description |
|---|---|---|
scene | - | |
asset | - | |
description | - |
gazu.scene.remove_shot_from_scene(scene, shot)
Remove link between a shot and a scene.
| Name | Type | Description |
|---|---|---|
scene | - | |
shot | - |
gazu.scene.update_asset_instance_data(asset_instance, data)
Update the extra data of given asset instance.
| Name | Type | Description |
|---|---|---|
asset_instance | - | |
data | - |
gazu.scene.update_asset_instance_name(asset_instance, name)
Update the name of given asset instance.
| Name | Type | Description |
|---|---|---|
asset_instance | - | |
name | - |
gazu.scene.update_scene(scene)
Save given scene data into the API.
| Name | Type | Description |
|---|---|---|
scene | - |
shot
gazu.shot.add_asset_instance_to_shot(shot, asset_instance)
Link a new asset instance to given shot.
| Name | Type | Description |
|---|---|---|
shot | str / dict | The shot dict or the shot ID. |
asset_instance | str / dict | The asset instance dict or ID. |
Returns: (dict) Related shot.
gazu.shot.all_asset_instances_for_shot(shot)
| Name | Type | Description |
|---|---|---|
shot | str / dict | The shot dict or the shot ID. |
Returns: (list[dict]) Asset instances linked to given shot.
gazu.shot.all_episodes_for_project(project)
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
Returns: (list[dict]) Episodes from database for given project.
gazu.shot.all_previews_for_shot(shot)
| Name | Type | Description |
|---|---|---|
shot | str / dict | The shot dict or the shot ID. |
Returns: (list[dict]) Previews from database for given shot.
gazu.shot.all_sequences_for_episode(episode)
| Name | Type | Description |
|---|---|---|
episode | str / dict | The episode dict or the episode ID. |
Returns: (list[dict]) Sequences which are children of given episode.
gazu.shot.all_sequences_for_project(project)
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
Returns: (list[dict]) Sequences from database for given project.
gazu.shot.all_shots_for_episode(episode)
| Name | Type | Description |
|---|---|---|
episode | str / dict | The episode dict or the episode ID. |
Returns: (list[dict]) Shots which are children of given episode.
gazu.shot.all_shots_for_project(project)
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
Returns: (list[dict]) Shots from database or for given project.
gazu.shot.all_shots_for_sequence(sequence)
| Name | Type | Description |
|---|---|---|
sequence | str / dict | The sequence dict or the sequence ID. |
Returns: (list[dict]) Shots which are children of given sequence.
gazu.shot.export_shots_with_csv(project, csv_file_path, episode = None, assigned_to = None, progress_callback=None)
Export the Shots data for a project to a CSV file on disk.
| Name | Type | Description |
|---|---|---|
project | str / dict | The ID or dict for the project to export. |
csv_file_path | str | The path on disk to write the CSV file to. If the path already exists it will be overwritten. |
episode | str | dict | None | Only export Shots that are linked to the given Episode, which can be provided as an ID string or model dict. If None, all assets will be exported. |
assigned_to | str | dict | None | Only export Shots that have one or more Tasks assigned to the given Person, specified as an ID string or model dict. If None, no filtering is put in place. |
progress_callback | - |
Returns: (requests.Response) the response from the API server.
gazu.shot.get_asset_instances_for_shot(shot)
Return the list of asset instances linked to given shot.
| Name | Type | Description |
|---|---|---|
shot | - |
gazu.shot.get_episode(episode_id)
| Name | Type | Description |
|---|---|---|
episode_id | str | ID of claimed episode. |
Returns: (dict) Episode corresponding to given episode ID.
gazu.shot.get_episode_by_name(project, episode_name)
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
episode_name | str | Name of claimed episode. |
Returns: (dict | None) Episode corresponding to given name and project.
gazu.shot.get_episode_from_sequence(sequence)
| Name | Type | Description |
|---|---|---|
sequence | dict | The sequence dict. |
Returns: (dict | None) Episode which is parent of given sequence.
gazu.shot.get_episode_url(episode)
| Name | Type | Description |
|---|---|---|
episode | str / dict | The episode dict or the episode ID. |
Returns: (str) Web url associated to the given episode
gazu.shot.get_sequence(sequence_id)
| Name | Type | Description |
|---|---|---|
sequence_id | str | ID of claimed sequence. |
Returns: (dict) Sequence corresponding to given sequence ID.
gazu.shot.get_sequence_by_name(project, sequence_name, episode = None)
| Name | Type | Description |
|---|---|---|
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: (dict | None) Seqence corresponding to given name and project (and episode in case of TV Show).
gazu.shot.get_sequence_from_shot(shot)
| Name | Type | Description |
|---|---|---|
shot | dict | The shot dict. |
Returns: (dict) Sequence which is parent of given shot.
gazu.shot.get_shot(shot_id)
| Name | Type | Description |
|---|---|---|
shot_id | str | ID of claimed shot. |
Returns: (dict) Shot corresponding to given shot ID.
gazu.shot.get_shot_by_name(sequence, shot_name)
| Name | Type | Description |
|---|---|---|
sequence | str / dict | The sequence dict or the sequence ID. |
shot_name | str | Name of claimed shot. |
Returns: (dict | None) Shot corresponding to given name and sequence.
gazu.shot.get_shot_url(shot)
| Name | Type | Description |
|---|---|---|
shot | str / dict | The shot dict or the shot ID. |
Returns: (str) Web url associated to the given shot
gazu.shot.import_otio(project, otio_file_path, episode = None, naming_convention = None, match_case = True, progress_callback=None)
Import shots from an OpenTimelineIO file (works also for every OTIO adapters).
| Name | Type | Description |
|---|---|---|
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. |
naming_convention | str | Template for matching shot names from the file. |
match_case | bool | Whether to match shot names case-sensitively. |
progress_callback | - |
Returns: (dict[Literal[('created_shots', 'updated_shots')], list[dict]]) A dictionary with keys "created_shots" and "updated_shots", each mapping to a list of altered entity records from the import.
gazu.shot.import_shots_with_csv(project, csv_file_path, progress_callback=None)
Import the Shots from a previously exported CSV file into the given project.
| Name | Type | Description |
|---|---|---|
project | str / dict | The project to import the Shots into, as an ID string or model dict. |
csv_file_path | str | The path on disk to the CSV file. |
progress_callback | - |
Returns: (list[dict]) the Shot dicts created by the import.
gazu.shot.new_episode(project, name)
Create an episode for given project.
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
name | str | The name of the episode to create. |
Returns: (dict) Created episode.
gazu.shot.new_sequence(project, name, episode = None)
Create a sequence for given project and episode.
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
name | str | The name of the sequence to create. |
episode | str / dict | The episode dict or the episode ID. |
Returns: (dict) Created sequence.
gazu.shot.new_shot(project, sequence, name, nb_frames = None, frame_in = None, frame_out = None, description = None, data = None)
Create a shot for given sequence and project. Add frame in and frame out parameters to shot extra data. Allow to set metadata too.
| Name | Type | Description |
|---|---|---|
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. |
nb_frames | - | |
frame_in | int | Frame in value for the shot. |
frame_out | int | Frame out value for the shot. |
description | - | |
data | dict | Free field to set metadata of any kind. |
Returns: (dict) Created shot.
gazu.shot.remove_asset_instance_from_shot(shot, asset_instance)
Remove link between an asset instance and given shot.
| Name | Type | Description |
|---|---|---|
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)
Remove given episode and related from database. If the `force` paramter is True, all records linked to the Episode will also be deleted - including all linked Sequences, Shots, Assets, Playlists and Tasks. Otherwise, it will attempt to only delete the Episode entity. If the Episode has any linked records the operation will fail.
| Name | Type | Description |
|---|---|---|
episode | str / dict | Episode to remove. |
force | bool | Whether to delete all data linked to the Episode as well. Raises: ParameterException: If the Episode has linked entities and the force=True parameter has not been provided. |
gazu.shot.remove_sequence(sequence, force = False)
Remove given sequence and related from database. If the `force` paramter is True, all records linked to the Sequence will also be deleted - including all linked Shots and Tasks. Otherwise, it will attempt to only delete the Sequence entity. If the Sequence has any linked records the operation will fail.
| Name | Type | Description |
|---|---|---|
sequence | str / dict | Sequence to remove. |
force | bool | Whether to delete all data linked to the Sequence as well. Raises: ParameterException: If the Sequence has linked entities and the force=True parameter has not been provided. |
gazu.shot.remove_shot(shot, force = False)
Remove given shot from database. If the Shot has tasks linked to it, this will by default mark the Shot as canceled. Deletion can be forced regardless of task links with the `force` parameter.
| Name | Type | Description |
|---|---|---|
shot | str / dict | Shot to remove. |
force | bool | Whether to force deletion of the asset regardless of whether it has links to tasks. |
gazu.shot.restore_shot(shot)
Restore given shot into database (uncancel it).
| Name | Type | Description |
|---|---|---|
shot | str / dict | Shot to restore. |
gazu.shot.update_episode(episode)
Save given episode data into the API. Metadata are fully replaced by the ones set on given episode.
| Name | Type | Description |
|---|---|---|
episode | dict | The episode dict to update. |
Returns: (dict) Updated episode.
gazu.shot.update_episode_data(episode, data = None)
Update the metadata for the provided episode. Keys that are not provided are not changed.
| Name | Type | Description |
|---|---|---|
episode | str / dict | The episode dict or ID to save in database. |
data | dict | Free field to set metadata of any kind. |
Returns: (dict) Updated episode.
gazu.shot.update_sequence(sequence)
Save given sequence data into the API. Metadata are fully replaced by the ones set on given sequence.
| Name | Type | Description |
|---|---|---|
sequence | dict | The sequence dict to update. |
Returns: (dict) Updated sequence.
gazu.shot.update_sequence_data(sequence, data = None)
Update the metadata for the provided sequence. Keys that are not provided are not changed.
| Name | Type | Description |
|---|---|---|
sequence | str / dict | The sequence dict or ID to save in database. |
data | dict | Free field to set metadata of any kind. |
Returns: (dict) Updated sequence.
gazu.shot.update_shot(shot)
Save given shot data into the API. Metadata are fully replaced by the ones set on given shot.
| Name | Type | Description |
|---|---|---|
shot | dict | The shot dict to update. |
Returns: (dict) Updated shot.
gazu.shot.update_shot_data(shot, data = None)
Update the metadata for the provided shot. Keys that are not provided are not changed.
| Name | Type | Description |
|---|---|---|
shot | str / dict | The shot dict or ID to save in database. |
data | dict | Free field to set metadata of any kind. |
Returns: (dict) Updated shot.
sync
gazu.sync.convert_id_list(ids, model_map)
| Name | Type | Description |
|---|---|---|
ids | list | Ids to convert. |
model_map | dict | Map matching ids to another value. |
Returns: (list) Ids converted through given model map.
gazu.sync.get_id_map_by_id(source_list, target_list, field = 'name')
| Name | Type | Description |
|---|---|---|
source_list | list | List of links to compare. |
target_list | list | List of links for which we want a diff. |
field | - |
Returns: (dict) 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.
gazu.sync.get_id_map_by_name(source_list, target_list)
| Name | Type | Description |
|---|---|---|
source_list | list | List of links to compare. |
target_list | list | List of links for which we want a diff. |
Returns: (dict) 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.
gazu.sync.get_last_events(limit = 20000, project = None, after = None, before = None, only_files = False, name = None)
Get last events that occured on the machine.
| Name | Type | Description |
|---|---|---|
limit | int | Number of events to retrieve. |
project | str / dict | Get only events related to this project. |
after | str | Get only events occuring after given date. |
before | str | Get only events occuring before given date. |
only_files | bool | Get only events related to files. |
name | - |
Returns: (list[dict]) Last events matching criterions.
gazu.sync.get_link_list_diff(source_list, target_list)
| Name | Type | Description |
|---|---|---|
source_list | list | List of links to compare. |
target_list | list | List of links for which we want a diff. |
Returns: (tuple[list[dict], list[dict]]) 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.
gazu.sync.get_model_list_diff(source_list, target_list, id_field = 'id')
| Name | Type | Description |
|---|---|---|
source_list | list | List of models to compare. |
target_list | list | List of models for which we want a diff. |
id_field | str | the model field to use as an ID for comparison. |
Returns: (tuple[list[dict], list[dict]]) Two lists, one containing the missing models in the target list and one containing the models that should not be in the target list.
gazu.sync.get_sync_asset_type_id_map(source_client, target_client)
| Name | Type | Description |
|---|---|---|
source_client | KitsuClient | client to get data from source API |
target_client | KitsuClient | client to push data to target API |
Returns: (dict) A dict matching source asset type ids with target asset type ids
gazu.sync.get_sync_department_id_map(source_client, target_client)
| Name | Type | Description |
|---|---|---|
source_client | KitsuClient | client to get data from source API |
target_client | KitsuClient | client to push data to target API |
Returns: (dict) A dict matching source departments ids with target department ids
gazu.sync.get_sync_person_id_map(source_client, target_client)
| Name | Type | Description |
|---|---|---|
source_client | KitsuClient | client to get data from source API |
target_client | KitsuClient | client to push data to target API |
Returns: (dict) A dict matching source person ids with target person ids
gazu.sync.get_sync_project_id_map(source_client, target_client)
| Name | Type | Description |
|---|---|---|
source_client | KitsuClient | client to get data from source API |
target_client | KitsuClient | client to push data to target API |
Returns: (dict) A dict matching source project ids with target project ids
gazu.sync.get_sync_task_status_id_map(source_client, target_client)
| Name | Type | Description |
|---|---|---|
source_client | KitsuClient | client to get data from source API |
target_client | KitsuClient | client to push data to target API |
Returns: (dict) A dict matching source task status ids with target task status ids
gazu.sync.get_sync_task_type_id_map(source_client, target_client)
| Name | Type | Description |
|---|---|---|
source_client | KitsuClient | client to get data from source API |
target_client | KitsuClient | client to push data to target API |
Returns: (dict) A dict matching source task type ids with target task type ids
gazu.sync.import_entities(entities)
Import entities from another instance to target instance (keep id and audit dates).
| Name | Type | Description |
|---|---|---|
entities | list | Entities to import. |
Returns: (list[dict]) Entities created.
gazu.sync.import_entity_links(links)
Import enitity links from another instance to target instance (keep id and audit dates).
| Name | Type | Description |
|---|---|---|
links | list | Entity links to import. |
Returns: (list[dict]) Entity links created.
gazu.sync.import_tasks(tasks)
Import tasks from another instance to target instance (keep id and audit dates).
| Name | Type | Description |
|---|---|---|
tasks | list | Tasks to import. |
Returns: (list[dict]) Tasks created.
gazu.sync.is_changed(source_model, target_model)
| Name | Type | Description |
|---|---|---|
source_model | dict | Model from the source API. |
target_model | dict | Matching model from the target API. |
Returns: (bool) True if the source model is older than the target model (based on `updated_at` field)
gazu.sync.push_assets(project_source, project_target, client_source, client_target)
Copy assets from source to target and preserve audit fields (`id`, `created_at`, and `updated_at`).
| Name | Type | Description |
|---|---|---|
project_source | dict | The project to get assets from |
project_target | dict | The project to push assets to |
client_source | KitsuClient | client to get data from source API |
client_target | KitsuClient | client to push data to target API |
Returns: (list[dict]) Pushed assets
gazu.sync.push_entity_links(project_source, project_target, client_source, client_target)
Copy entity links (breakdown, concepts) from source to target and preserve audit fields (`id`, `created_at`, and `updated_at`).
| Name | Type | Description |
|---|---|---|
project_source | dict | The project to get assets from |
project_target | dict | The project to push assets to |
client_source | KitsuClient | client to get data from source API |
client_target | KitsuClient | client to push data to target API |
Returns: (list[dict]) Pushed entity links
gazu.sync.push_episodes(project_source, project_target, client_source, client_target)
Copy episodes from source to target and preserve audit fields (`id`, `created_at`, and `updated_at`)
| Name | Type | Description |
|---|---|---|
project_source | dict | The project to get episodes from |
project_target | dict | The project to push episodes to |
client_source | KitsuClient | client to get data from source API |
client_target | KitsuClient | client to push data to target API |
Returns: (list[dict]) Pushed episodes
gazu.sync.push_project_entities(project_source, project_target, client_source, client_target)
Copy assets, episodes, sequences, shots and entity links from source to target and preserve audit fields (`id`, `created_at`, and `updated_at`).
| Name | Type | Description |
|---|---|---|
project_source | dict | The project to get assets from |
project_target | dict | The project to push assets to |
client_source | KitsuClient | client to get data from source API |
client_target | KitsuClient | client to push data to target API |
Returns: (dict) Pushed data
gazu.sync.push_sequences(project_source, project_target, client_source, client_target)
Copy sequences from source to target and preserve audit fields (`id`, `created_at`, and `updated_at`)
| Name | Type | Description |
|---|---|---|
project_source | dict | The project to get sequences from |
project_target | dict | The project to push sequences to |
client_source | KitsuClient | client to get data from source API |
client_target | KitsuClient | client to push data to target API |
Returns: (list[dict]) Pushed sequences
gazu.sync.push_shots(project_source, project_target, client_source, client_target)
Copy shots from source to target and preserve audit fields (`id`, `created_at`, and `updated_at`).
| Name | Type | Description |
|---|---|---|
project_source | dict | The project to get shots from |
project_target | dict | The project to push shots to |
client_source | KitsuClient | client to get data from source API |
client_target | KitsuClient | client to push data to target API |
Returns: (list[dict]) Pushed shots
gazu.sync.push_task_comment(task_status_map, person_map, task, comment, client_source, client_target, author_id = None, tmp_path = None)
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.
| Name | Type | Description |
|---|---|---|
task_status_map | dict | A mapping of source TaskStatus IDs to target IDs. |
person_map | dict | A mapping of source Person IDs to target IDs. |
task | str / dict | The task to push the comment for. |
comment | dict | The comment to push. |
client_source | KitsuClient | client to get data from source API |
client_target | KitsuClient | client to push data to target API |
author_id | str | The ID of the Person to set as the comment author. |
tmp_path | str | The local path on disk to download the attachment files for syncing. |
Returns: (dict) The source comment.
gazu.sync.push_task_comments(task_status_map, person_map, task, client_source, client_target)
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.
| Name | Type | Description |
|---|---|---|
task_status_map | dict | A mapping of source TaskStatus IDs to target IDs. |
person_map | dict | A mapping of source Person IDs to target IDs. |
task | str / dict | The task to push comments for |
client_source | KitsuClient | client to get data from source API |
client_target | KitsuClient | client to push data to target API |
Returns: (list[dict]) Created comments
gazu.sync.push_tasks(project_source, project_target, default_status, client_source, client_target)
Copy tasks from source to target and preserve audit fields (`id`, `created_at`, and `updated_at`) Attachments and previews are created too.
| Name | Type | Description |
|---|---|---|
project_source | dict | The project to get assets from |
project_target | dict | The project to push assets to |
default_status | str / dict | The default status for the pushed tasks |
client_source | KitsuClient | client to get data from source API |
client_target | KitsuClient | client to push data to target API |
Returns: (list[dict]) Pushed entity links
gazu.sync.push_tasks_comments(project_source, client_source, client_target)
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.
| Name | Type | Description |
|---|---|---|
project_source | dict | The project to get assets from |
client_source | KitsuClient | client to get data from source API |
client_target | KitsuClient | client to push data to target API |
Returns: (list[dict]) Created comments
studio
gazu.studio.all_studios()
Returns: (list[dict]) Studios stored in the database.
gazu.studio.get_studio(studio_id)
| Name | Type | Description |
|---|---|---|
studio_id | str | ID of claimed studio. |
Returns: (dict) Studio corresponding to given id.
gazu.studio.get_studio_by_name(studio_name)
| Name | Type | Description |
|---|---|---|
studio_name | str | Name of claimed studio. |
Returns: (dict | None) Studio corresponding to given name.
gazu.studio.remove_studio(studio, force = False)
Remove given studio from database.
| Name | Type | Description |
|---|---|---|
studio | dict / str | Studio to remove. |
force | bool | Whether to force deletion of the studio. |
gazu.studio.update_studio(studio)
Save given studio data into the API. Metadata are fully replaced by the ones set on given studio.
| Name | Type | Description |
|---|---|---|
studio | dict | The studio to update. |
Returns: (dict) Updated studio.
task
gazu.task.acknowledge_comment(task, comment)
Acknowledge a comment or remove the acknowledgment if it's already acknowledged.
| Name | Type | Description |
|---|---|---|
task | str / dict | The task dict or id. |
comment | str / dict | The comment dict or id. |
Returns: (dict) Updated comment.
gazu.task.add_attachment_files_to_comment(task, comment, attachments = None, progress_callback=None)
Add attachments files to a given comment.
| Name | Type | Description |
|---|---|---|
task | str / dict | The task dict or the task ID. |
comment | str / dict | The comment dict or the comment ID. attachments (list / str) : A list of path for attachments or directly the path. |
attachments | - | |
progress_callback | - |
Returns: (dict) Added attachment files.
gazu.task.add_comment(task, task_status, comment = '', person = None, checklist = None, attachments = None, created_at = None, links = None, progress_callback=None)
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.
| Name | Type | Description |
|---|---|---|
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, e.g [{"text": "Item 1", "checked": false}] |
attachments | list[file_path] | Attachments file paths |
created_at | str | Comment date |
links | list | List of URL links to add to the comment |
progress_callback | - |
Returns: (dict) Created comment.
gazu.task.add_preview(task, comment, preview_file_path = None, preview_file_url = None, normalize_movie = True, revision = None)
Add a preview to given comment.
| Name | Type | Description |
|---|---|---|
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: (dict) Created preview file model.
gazu.task.add_preview_to_comment(comment, preview_file)
Add a preview to a comment.
| Name | Type | Description |
|---|---|---|
comment | str / dict | The comment dict or id. |
preview_file | str / dict | The preview file dict or id. |
Returns: (dict) Updated comment.
gazu.task.add_tasks_batch_comments(tasks, comments_data)
Add comments to multiple tasks in a batch operation.
| Name | Type | Description |
|---|---|---|
tasks | list | List of task dicts or IDs. |
comments_data | dict | Comment data to apply to all tasks. Should contain task_status_id, comment text, and optionally person_id, checklist, attachments, etc. |
Returns: (list[dict]) List of created comments.
gazu.task.add_time_spent(task, person, date, duration)
Add given duration to the already logged duration for given task and person at a given date.
| Name | Type | Description |
|---|---|---|
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 ("YYYY-MM-DD") for which time spent must be set. |
duration | int | The duration (in minutes) of the time spent on given task. |
Returns: (dict) Updated time spent entry.
gazu.task.all_assets_tasks_for_episode(episode, relations = False)
Retrieve all tasks directly linked to all assets of given episode.
| Name | Type | Description |
|---|---|---|
episode | - | |
relations | - |
gazu.task.all_comments_for_project(project)
Get all comments for a project.
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or id. |
Returns: (list[dict]) Comments for the project.
gazu.task.all_comments_for_task(task)
| Name | Type | Description |
|---|---|---|
task | str / dict | The task dict or the task ID. |
gazu.task.all_done_tasks_for_person(person)
| Name | Type | Description |
|---|---|---|
person | - |
Returns: (list[dict]) Tasks that are done for given person (only for open projects).
gazu.task.all_notifications_for_project(project)
Get all notifications for a project.
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or id. |
Returns: (list[dict]) Notifications for the project.
gazu.task.all_open_tasks()
Get all open tasks.
Returns: (list[dict]) Open tasks.
gazu.task.all_open_tasks_for_person(person)
Get all open tasks for a person.
| Name | Type | Description |
|---|---|---|
person | str / dict | The person dict or id. |
Returns: (list[dict]) Open tasks for the person.
gazu.task.all_preview_files_for_project(project)
Get all preview files for a project.
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or id. |
Returns: (list[dict]) Preview files for the project.
gazu.task.all_previews_for_task(task)
Get all previews for a task.
| Name | Type | Description |
|---|---|---|
task | str / dict | The task dict or id. |
Returns: (list[dict]) Previews for the task.
gazu.task.all_shot_tasks_for_episode(episode, relations = False)
Retrieve all tasks directly linked to all shots of given episode.
| Name | Type | Description |
|---|---|---|
episode | - | |
relations | - |
gazu.task.all_shot_tasks_for_sequence(sequence, relations = False)
Retrieve all tasks directly linked to all shots of given sequence.
| Name | Type | Description |
|---|---|---|
sequence | - | |
relations | - |
gazu.task.all_subscriptions_for_project(project)
Get all subscriptions for a project.
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or id. |
Returns: (list[dict]) Subscriptions for the project.
gazu.task.all_task_statuses()
Returns: (list[dict]) Task statuses stored in database.
gazu.task.all_task_statuses_for_project(project)
| Name | Type | Description |
|---|---|---|
project | - |
Returns: (list[dict]) Task status stored in database.
gazu.task.all_task_types()
Returns: (list[dict]) Task types stored in database.
gazu.task.all_task_types_for_asset(asset)
| Name | Type | Description |
|---|---|---|
asset | str / dict | The asset dict or the asset ID. |
Returns: (list[dict]) Task types of tasks related to given asset.
gazu.task.all_task_types_for_concept(concept)
| Name | Type | Description |
|---|---|---|
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)
| Name | Type | Description |
|---|---|---|
episode | - |
Returns: (list[dict]) Task types of tasks linked directly to given episode.
gazu.task.all_task_types_for_project(project)
| Name | Type | Description |
|---|---|---|
project | - |
Returns: (list[dict]) Task types stored in database.
gazu.task.all_task_types_for_scene(scene)
| Name | Type | Description |
|---|---|---|
scene | str / dict | The scene dict or the scene ID. |
Returns: (list[dict]) Task types of tasks linked to given scene.
gazu.task.all_task_types_for_sequence(sequence)
| Name | Type | Description |
|---|---|---|
sequence | str / dict | The sequence dict or the sequence ID. |
Returns: (list[dict]) Task types of tasks linked directly to given sequence.
gazu.task.all_task_types_for_shot(shot)
| Name | Type | Description |
|---|---|---|
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)
| Name | Type | Description |
|---|---|---|
asset | str / dict | The asset dict or the asset ID. |
relations | - |
Returns: (list[dict]) Tasks directly linked to given asset.
gazu.task.all_tasks_for_concept(concept, relations = False)
| Name | Type | Description |
|---|---|---|
concept | str / dict | The concept dict or the concept ID. |
relations | - |
Returns: (list[dict]) Tasks linked to given concept.
gazu.task.all_tasks_for_edit(edit, relations = False)
| Name | Type | Description |
|---|---|---|
edit | str / dict | The edit dict or the edit ID. |
relations | - |
Returns: (list[dict]) Tasks linked to given edit.
gazu.task.all_tasks_for_entity_and_task_type(entity, task_type)
| Name | Type | Description |
|---|---|---|
entity | str / dict | The entity dict or the entity ID. |
task_type | str / dict | The task type dict or ID. |
Returns: (list[dict]) Tasks for given entity or task type.
gazu.task.all_tasks_for_episode(episode, relations = False)
Retrieve all tasks directly linked to given episode.
| Name | Type | Description |
|---|---|---|
episode | - | |
relations | - |
gazu.task.all_tasks_for_person(person)
| Name | Type | Description |
|---|---|---|
person | - |
Returns: (list[dict]) Tasks that are not done for given person (only for open projects).
gazu.task.all_tasks_for_person_and_type(person, task_type)
Get all tasks for a person and task type.
| Name | Type | Description |
|---|---|---|
person | str / dict | The person dict or id. |
task_type | str / dict | The task type dict or id. |
Returns: (list[dict]) Tasks for the person and task type.
gazu.task.all_tasks_for_project(project, task_type = None, episode = None)
| Name | Type | Description |
|---|---|---|
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: (list[dict]) Tasks related to given project.
gazu.task.all_tasks_for_scene(scene, relations = False)
| Name | Type | Description |
|---|---|---|
scene | str / dict | The scene dict or the scene ID. |
relations | - |
Returns: (list[dict]) Tasks linked to given scene.
gazu.task.all_tasks_for_sequence(sequence, relations = False)
| Name | Type | Description |
|---|---|---|
sequence | str / dict | The sequence dict or the sequence ID. Returns list: Tasks linked to given sequence. |
relations | - |
gazu.task.all_tasks_for_shot(shot, relations = False)
| Name | Type | Description |
|---|---|---|
shot | str / dict | The shot dict or the shot ID. |
relations | - |
Returns: (list[dict]) Tasks linked to given shot.
gazu.task.all_tasks_for_task_status(project, task_type, task_status)
| Name | Type | Description |
|---|---|---|
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: (list[dict]) Tasks set at given status for given project and task type.
gazu.task.all_tasks_for_task_type(project, task_type, episode = None)
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
task_type | str / dict | The task type dict or ID. |
episode | - |
Returns: (list[dict]) Tasks for given project and task type.
gazu.task.assign_task(task, person)
Assign one Person to a Task.
| Name | Type | Description |
|---|---|---|
task | str / dict | The task dict or the task ID. |
person | str / dict | The person dict or the person ID. |
gazu.task.assign_tasks_to_person(tasks, person)
Assign multiple tasks to a person.
| Name | Type | Description |
|---|---|---|
tasks | list | List of task dicts or IDs. |
person | str / dict | The person dict or id. |
Returns: (dict) Response information.
gazu.task.batch_comments(comments = None, task = None, progress_callback=None)
Publish a list of comments (with attachments and previews) for given task. Each dict comments may contain a list of attachment files path and preview files path in the keys "attachment_files" and "preview_files". If no task is given each comments needs to have a task_id key.
| Name | Type | Description |
|---|---|---|
comments | list | List of comments to publish. |
task | str / dict | The task dict or the task ID. |
progress_callback | - |
Returns: (list[dict]) List of created comments.
gazu.task.clear_assignations(tasks, person = None)
Clear assignations for a single or multiple tasks. If no person is given, all assignations are cleared.
| Name | Type | Description |
|---|---|---|
tasks | list / str / dict | Task dict or the task ID, single or list. |
person | str / dict | The person dict or the person ID. |
gazu.task.create_asset_tasks(asset, task_types)
Create tasks for an asset.
| Name | Type | Description |
|---|---|---|
asset | str / dict | The asset dict or id. |
task_types | list | List of task type dicts or IDs. |
Returns: (list[dict]) Created tasks.
gazu.task.create_concept_tasks(concept, task_types)
Create tasks for a concept.
| Name | Type | Description |
|---|---|---|
concept | str / dict | The concept dict or id. |
task_types | list | List of task type dicts or IDs. |
Returns: (list[dict]) Created tasks.
gazu.task.create_edit_tasks(edit, task_types)
Create tasks for an edit.
| Name | Type | Description |
|---|---|---|
edit | str / dict | The edit dict or id. |
task_types | list | List of task type dicts or IDs. |
Returns: (list[dict]) Created tasks.
gazu.task.create_entity_tasks(entity, task_types)
Create tasks for an entity.
| Name | Type | Description |
|---|---|---|
entity | str / dict | The entity dict or id. |
task_types | list | List of task type dicts or IDs. |
Returns: (list[dict]) Created tasks.
gazu.task.create_multiple_comments(project, comments = None, progress_callback=None)
Create multiple comments at once for a specific project. Each comment updates the respective task status. Each dict comments may contain a list of attachment files path and preview files path in the keys "attachment_files" and "preview_files".
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
comments | list | List of comments to publish. Each comment must have a task_id key. |
progress_callback | - |
Returns: (list[dict]) List of created comments.
gazu.task.create_preview(task, comment, revision = None)
Create a preview into given comment.
| Name | Type | Description |
|---|---|---|
task | str / dict | The task dict or the task ID. |
comment | str / dict | The comment or the comment ID. |
revision | int | Revision number. |
Returns: (dict) Created preview file model.
gazu.task.create_shot_tasks(shot, task_types)
Create tasks for a shot.
| Name | Type | Description |
|---|---|---|
shot | str / dict | The shot dict or id. |
task_types | list | List of task type dicts or IDs. |
Returns: (list[dict]) Created tasks.
gazu.task.delete_comment_attachment(comment, attachment_file)
Delete an attachment from a comment.
| Name | Type | Description |
|---|---|---|
comment | str / dict | The comment dict or id. |
attachment_file | str / dict | The attachment file dict or id. |
Returns: (str) Request response object.
gazu.task.delete_comment_reply(comment, reply)
Delete a reply to a comment.
| Name | Type | Description |
|---|---|---|
comment | str / dict | The comment dict or id. |
reply | str / dict | The reply comment dict or id. |
Returns: (str) Request response object.
gazu.task.get_comment(comment_id)
Get comment instance
| Name | Type | Description |
|---|---|---|
comment_id | ID | The comment ID. |
Returns: (dict) Given comment instance.
gazu.task.get_default_task_status()
Returns: (dict) The unique task status flagged with `is_default`.
gazu.task.get_last_comment_for_task(task)
| Name | Type | Description |
|---|---|---|
task | str / dict | The task dict or the task ID. |
gazu.task.get_open_tasks_stats()
Get statistics for open tasks.
Returns: (dict) Open tasks statistics.
gazu.task.get_persons_tasks_dates(project)
Get tasks dates for persons in a project.
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or id. |
Returns: (dict) Tasks dates for persons.
gazu.task.get_task(task_id)
| Name | Type | Description |
|---|---|---|
task_id | str | ID of claimed task. |
Returns: (dict) Task matching given ID.
gazu.task.get_task_by_entity(entity, task_type, name = 'main')
| Name | Type | Description |
|---|---|---|
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. |
gazu.task.get_task_by_path(project, file_path, entity_type = 'shot')
| Name | Type | Description |
|---|---|---|
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: (dict) A task from given file path. This function requires context: the project related to the given path and the related entity type.
gazu.task.get_task_status(task_status_id)
| Name | Type | Description |
|---|---|---|
task_status_id | str | ID of claimed task status. |
Returns: (dict) Task status matching given ID.
gazu.task.get_task_status_by_name(name)
| Name | Type | Description |
|---|---|---|
name | str / dict | The name of claimed task status. |
Returns: (dict | None) Task status matching given name.
gazu.task.get_task_status_by_short_name(task_status_short_name)
| Name | Type | Description |
|---|---|---|
task_status_short_name | - |
Returns: (dict | None) Task status matching given short name.
gazu.task.get_task_time_spent_for_date(task, date)
Get time spent for a task on a specific date.
| Name | Type | Description |
|---|---|---|
task | str / dict | The task dict or id. |
date | str | Date in YYYY-MM-DD format. |
Returns: (dict) Time spent information.
gazu.task.get_task_type(task_type_id)
| Name | Type | Description |
|---|---|---|
task_type_id | str | ID of claimed task type. |
Returns: (dict) Task type matching given ID.
gazu.task.get_task_type_by_name(task_type_name, for_entity = None, department = None)
| Name | Type | Description |
|---|---|---|
task_type_name | str | Name of claimed task type. |
for_entity | str | The entity type for which the task type is created. |
department | str / dict | The department for which the task type is created. |
Returns: (dict | None) Task type object for given name, or None if none found.
gazu.task.get_task_type_by_short_name(task_type_short_name, for_entity = None, department = None)
| Name | Type | Description |
|---|---|---|
task_type_short_name | str | Short name of claimed task type. |
for_entity | str | The entity type for which the task type is created. |
department | str /dict | The department for which the task type is created. |
Returns: (dict | None) Task type object for given name, or None if none found.
gazu.task.get_task_url(task)
| Name | Type | Description |
|---|---|---|
task | dict | The task dict. |
Returns: (str) Web url associated to the given task
gazu.task.get_time_spent(task, date = None)
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 minutes. Date format is YYYY-MM-DD.
| Name | Type | Description |
|---|---|---|
task | str / dict | The task dict or the task ID. |
date | str | The date for which time spent is required. |
Returns: (dict) A dict with person ID as key and time spent object as value.
gazu.task.new_task(entity, task_type, name = 'main', task_status = None, assigner = None, assignees = None)
Create a new task for given entity and task type.
| Name | Type | Description |
|---|---|---|
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. |
gazu.task.new_task_status(name, short_name, color)
Create a new task status with the given name, short name and color.
| Name | Type | Description |
|---|---|---|
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 with # as first character. ex : #00FF00 |
Returns: (dict) The created task status
gazu.task.new_task_type(name, color = '#000000', for_entity = 'Asset')
Create a new task type with the given name. If a Task Type with the given name already exists within Kitsu, it will be returned.
| Name | Type | Description |
|---|---|---|
name | str | The name of the task type |
color | str | The color of the task type as an hexadecimal string with # as first character. ex : #00FF00 |
for_entity | str | The entity type for which the task type is created. |
Returns: (dict) The created task type
gazu.task.publish_preview(task, task_status, comment = '', person = None, checklist = None, attachments = None, created_at = None, preview_file_path = None, preview_file_url = None, normalize_movie = True, revision = None, set_thumbnail = False, links = None)
Publish a comment and include given preview for given task and set given task status.
| Name | Type | Description |
|---|---|---|
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 server side. |
revision | int | Revision number. |
set_thumbnail | bool | Set the preview as thumbnail of the entity. |
links | list | List of links to add to the comment |
Returns: (tuple[dict, dict]) Created comment model and created preview file model.
gazu.task.remove_comment(comment)
Remove given comment and related (previews, news, notifications) from database.
| Name | Type | Description |
|---|---|---|
comment | str / dict | The comment dict or the comment ID. |
gazu.task.remove_preview_from_comment(comment, preview_file)
Remove a preview from a comment.
| Name | Type | Description |
|---|---|---|
comment | str / dict | The comment dict or id. |
preview_file | str / dict | The preview file dict or id. |
gazu.task.remove_task(task)
Remove given task from database.
| Name | Type | Description |
|---|---|---|
task | str / dict | The task dict or the task ID. |
gazu.task.remove_task_status(task_status)
Remove given task status from database.
| Name | Type | Description |
|---|---|---|
task_status | str / dict | The task status dict or ID. |
gazu.task.remove_task_type(task_type)
Remove given task type from database.
| Name | Type | Description |
|---|---|---|
task_type | str / dict | The task type dict or ID. |
gazu.task.remove_tasks_batch(tasks)
Delete multiple tasks in batch.
| Name | Type | Description |
|---|---|---|
tasks | list | List of task dicts or IDs to delete. |
Returns: (requests.Response) Request response object.
gazu.task.remove_tasks_for_type(project, task_type)
Delete all tasks for a task type in a project.
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or id. |
task_type | str / dict | The task type dict or id. |
gazu.task.remove_time_spent(time_spent)
Delete a time spent entry.
| Name | Type | Description |
|---|---|---|
time_spent | str / dict | The time spent dict or id. |
Returns: (str) Request response object.
gazu.task.reply_to_comment(comment, text, person = None)
Reply to an existing comment.
| Name | Type | Description |
|---|---|---|
comment | str / dict | The comment dict or id to reply to. |
text | str | The reply text. |
person | str / dict | The person dict or id making the reply. |
Returns: (dict) Created reply comment.
gazu.task.set_main_preview(preview_file, frame_number = None)
Set given preview as thumbnail of given entity.
| Name | Type | Description |
|---|---|---|
preview_file | str / dict | The preview file dict or ID. |
frame_number | int | Frame of preview video to set as main preview |
Returns: (dict) Created preview file model.
gazu.task.set_time_spent(task, person, date, duration)
Set the time spent by a CG artist on a given task at a given date.
| Name | Type | Description |
|---|---|---|
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 ("YYYY-MM-DD") for which time spent must be set. |
duration | int | The duration (in minutes) of the time spent on given task. |
Returns: (dict) Created time spent entry.
gazu.task.start_task(task, started_task_status = None, person = None)
Create a comment to change task status to started_task_status (by default WIP) and set its real start date to now.
| Name | Type | Description |
|---|---|---|
task | str / dict | The task dict or the task ID. |
started_task_status | str / dict | The task status dict or ID. |
person | str / dict | The person dict or the person ID. |
Returns: (dict) Created comment.
gazu.task.task_to_review(task, person, comment, revision = 1, change_status = True)
Deprecated. Mark given task as pending, waiting for approval. Author is given through the person argument.
| Name | Type | Description |
|---|---|---|
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: (dict) Modified task
gazu.task.update_comment(comment)
Save given comment data into the API. Metadata are fully replaced by the ones set on given comment.
| Name | Type | Description |
|---|---|---|
comment | dict | The comment dict to update. |
Returns: (dict) Updated comment.
gazu.task.update_task(task)
Update given task into the API. Metadata are fully replaced by the ones set on given task.
| Name | Type | Description |
|---|---|---|
task | dict | The task dict to update. |
Returns: (dict) Updated task.
gazu.task.update_task_data(task, data = None)
Update the metadata for the provided task. Keys that are not provided are not changed.
| Name | Type | Description |
|---|---|---|
task | str / dict | The task dict or ID to save in database. |
data | dict | Free field to set metadata of any kind. |
Returns: (dict) Updated task.
gazu.task.update_task_status(task_status)
Update given task status into the API.
| Name | Type | Description |
|---|---|---|
task_status | dict | The task status dict to update. |
Returns: (dict) Updated task status.
gazu.task.update_task_type(task_type)
Update given task type into the API.
| Name | Type | Description |
|---|---|---|
task_type | dict | The task type dict to update. |
Returns: (dict) Updated task type.
gazu.task.upload_preview_file(preview_file, file_path, normalize_movie = True, progress_callback=None)
Create a preview into given comment.
| Name | Type | Description |
|---|---|---|
preview_file | str / dict | The preview_file dict or the preview_file ID. |
file_path | str | Path of the file to upload as preview. |
normalize_movie | - | |
progress_callback | - |
user
gazu.user.all_asset_types_for_project(project)
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
Returns: (list[dict]) Asset types for which the user has a task assigned for given project.
gazu.user.all_assets_for_asset_type_and_project(project, asset_type)
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
asset_type | str / dict | The asset type dict or ID. |
Returns: (list[dict]) Assets for given project and asset type and for which the user has a task assigned.
gazu.user.all_chats()
Get all chats for current user.
Returns: (list[dict]) Chats.
gazu.user.all_desktop_login_logs()
Get desktop login logs for current user.
Returns: (list) Desktop login logs.
gazu.user.all_done_tasks()
Returns: (list[dict]) Tasks assigned to current user which are done.
gazu.user.all_episodes_for_project(project)
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
Returns: (list[dict]) Episodes for which user has tasks assigned for given project.
gazu.user.all_filter_groups()
Get all filter groups for current user.
Returns: (list[dict]) Filter groups.
gazu.user.all_filters()
Return: list: all filters for current user.
gazu.user.all_notifications()
Get all notifications for current user.
Returns: (list[dict]) Notifications.
gazu.user.all_open_projects()
Returns: (list[dict]) Projects for which the user is part of the team. Admins see all projects
gazu.user.all_project_assets(project)
Get assets for which user has tasks assigned for given project.
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or id. |
Returns: (list[dict]) Assets for the project.
gazu.user.all_scenes_for_sequence(sequence)
| Name | Type | Description |
|---|---|---|
sequence | str / dict | The sequence dict or the sequence ID. |
Returns: (list[dict]) Scenes for which user has tasks assigned for given sequence.
gazu.user.all_sequences_for_project(project)
| Name | Type | Description |
|---|---|---|
project | str / dict | The project dict or the project ID. |
Returns: (list[dict]) Sequences for which user has tasks assigned for given project.
gazu.user.all_shots_for_sequence(sequence)
| Name | Type | Description |
|---|---|---|
sequence | str / dict | The sequence dict or the sequence ID. |
Returns: (list[dict]) Shots for which user has tasks assigned for given sequence.
gazu.user.all_task_types_for_asset(asset)
| Name | Type | Description |
|---|---|---|
asset | str / dict | The asset dict or the asset ID. |
Returns: (list[dict]) Task Types of tasks assigned to current user for given asset.
gazu.user.all_task_types_for_scene(scene)
| Name | Type | Description |
|---|---|---|
scene | str / dict | The scene dict or the scene ID. |
Returns: (list[dict]) Task types of tasks assigned to current user for given scene.
gazu.user.all_task_types_for_sequence(sequence)
| Name | Type | Description |
|---|---|---|
sequence | - |
Returns: (list[dict]) Task types for given asset and current user.
gazu.user.all_task_types_for_shot(shot)
| Name | Type | Description |
|---|---|---|
shot | str / dict | The shot dict or the shot ID. |
Returns: (list[dict]) Task Types of tasks assigned to current user for given shot.
gazu.user.all_tasks_for_asset(asset)
| Name | Type | Description |
|---|---|---|
asset | str / dict | The asset dict or the asset ID. |
Returns: (list[dict]) Tasks for given asset and current user.
gazu.user.all_tasks_for_scene(scene)
| Name | Type | Description |
|---|---|---|
scene | str / dict | The scene dict or the scene ID. |
Returns: (list[dict]) Tasks assigned to current user for given scene.
gazu.user.all_tasks_for_sequence(sequence)
Return the list of tasks for given asset and current user.
| Name | Type | Description |
|---|---|---|
sequence | - |
gazu.user.all_tasks_for_shot(shot)
| Name | Type | Description |
|---|---|---|
shot | str / dict | The shot dict or the shot ID. |
Returns: (list[dict]) Tasks assigned to current user for given shot.
gazu.user.all_tasks_requiring_feedback()
Get tasks requiring feedback from the current user.
Returns: (list[dict]) Tasks requiring feedback.
gazu.user.all_tasks_to_do()
Returns: (list[dict]) Tasks assigned to current user which are not complete.
gazu.user.check_task_subscription(task)
Check if user is subscribed to a task.
| Name | Type | Description |
|---|---|---|
task | str / dict | The task dict or id. |
Returns: (dict) Subscription status.
gazu.user.clear_avatar()
Clear user avatar.
gazu.user.get_context()
Get user context.
Returns: (dict) User context information.
gazu.user.get_day_off()
Get day off information for current user.
Returns: (dict) Day off information.
gazu.user.get_filter_group(filter_group)
Get a filter group.
| Name | Type | Description |
|---|---|---|
filter_group | str / dict | The filter group dict or id. |
Returns: (dict) Filter group.
gazu.user.get_notification(notification)
Get a specific notification.
| Name | Type | Description |
|---|---|---|
notification | str / dict | The notification dict or id. |
Returns: (dict) Notification.
gazu.user.get_task_time_spent(task)
Get time spent for a specific task.
| Name | Type | Description |
|---|---|---|
task | str / dict | The task dict or id. |
Returns: (dict) Time spent information for the task.
gazu.user.get_time_spents_by_date(date)
Get time spents for a specific date.
| Name | Type | Description |
|---|---|---|
date | str | Date in YYYY-MM-DD format. |
Returns: (list) Time spents for the date.
gazu.user.get_timespents_range(start_date, end_date)
Gets the timespents of the current user for the given date range.
| Name | Type | Description |
|---|---|---|
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: (list[dict]) All of the person's time spents
gazu.user.is_authenticated()
Returns: (bool) Current user authenticated or not
gazu.user.join_chat(chat)
Join a chat.
| Name | Type | Description |
|---|---|---|
chat | str / dict | The chat dict or id. |
Returns: (dict) Chat information.
gazu.user.leave_chat(chat)
Leave a chat.
| Name | Type | Description |
|---|---|---|
chat | str / dict | The chat dict or id. |
gazu.user.log_desktop_session_log_in()
Add a log entry to mention that the user logged in his computer.
Returns: (dict) Desktop session log entry.
gazu.user.mark_all_notifications_as_read()
Mark all notifications as read for current user.
Returns: (dict[Literal['success'], bool]) Response information.
gazu.user.new_filter(name, query, list_type, project = None, entity_type = None)
Create a new filter for current user.
| Name | Type | Description |
|---|---|---|
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: (dict) Created filter.
gazu.user.new_filter_group(name, project = None)
Create a new filter group for current user.
| Name | Type | Description |
|---|---|---|
name | str | The filter group name. |
project | str / dict | The project dict or id. |
Returns: (dict) Created filter group.
gazu.user.remove_filter(filter)
Remove given filter from database.
| Name | Type | Description |
|---|---|---|
filter | str / dict | The filter dict or the filter ID. |
gazu.user.remove_filter_group(filter_group)
Remove given filter group from database.
| Name | Type | Description |
|---|---|---|
filter_group | str / dict | The filter group dict or id. |
gazu.user.subscribe_to_task(task)
Subscribe to a task.
| Name | Type | Description |
|---|---|---|
task | str / dict | The task dict or id. |
Returns: (dict) Subscription information.
gazu.user.unsubscribe_from_task(task)
Unsubscribe from a task.
| Name | Type | Description |
|---|---|---|
task | str / dict | The task dict or id. |
gazu.user.update_filter(filter)
Save given filter data into the API.
| Name | Type | Description |
|---|---|---|
filter | dict | Filter to save. |
gazu.user.update_filter_group(filter_group)
Update a filter group.
| Name | Type | Description |
|---|---|---|
filter_group | dict | Filter group to save. |
Returns: (dict) Updated filter group.
gazu.user.update_notification(notification)
Update a notification.
| Name | Type | Description |
|---|---|---|
notification | dict | Notification to save. |
Returns: (dict) Updated notification.
