gazu 1.0.3__py2.py3-none-any.whl → 1.1.1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gazu/__version__.py +1 -1
- gazu/asset.py +157 -51
- gazu/cache.py +25 -17
- gazu/casting.py +178 -25
- gazu/client.py +124 -71
- gazu/concept.py +35 -17
- gazu/context.py +41 -15
- gazu/edit.py +36 -17
- gazu/encoder.py +3 -1
- gazu/entity.py +47 -18
- gazu/events.py +22 -13
- gazu/files.py +616 -220
- gazu/helpers.py +13 -5
- gazu/person.py +194 -86
- gazu/playlist.py +107 -53
- gazu/project.py +198 -90
- gazu/py.typed +0 -0
- gazu/scene.py +57 -17
- gazu/search.py +10 -3
- gazu/shot.py +195 -76
- gazu/sorting.py +4 -1
- gazu/sync.py +167 -97
- gazu/task.py +544 -186
- gazu/user.py +127 -63
- {gazu-1.0.3.dist-info → gazu-1.1.1.dist-info}/METADATA +6 -4
- gazu-1.1.1.dist-info/RECORD +31 -0
- gazu-1.0.3.dist-info/RECORD +0 -30
- {gazu-1.0.3.dist-info → gazu-1.1.1.dist-info}/WHEEL +0 -0
- {gazu-1.0.3.dist-info → gazu-1.1.1.dist-info}/licenses/LICENSE +0 -0
- {gazu-1.0.3.dist-info → gazu-1.1.1.dist-info}/top_level.txt +0 -0
gazu/scene.py
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
1
3
|
from . import client as raw
|
|
2
4
|
|
|
3
5
|
from .sorting import sort_by_name
|
|
4
6
|
from .cache import cache
|
|
7
|
+
from .client import KitsuClient
|
|
5
8
|
from .helpers import normalize_model_parameter
|
|
6
9
|
from .shot import get_sequence
|
|
7
10
|
|
|
8
11
|
default = raw.default_client
|
|
9
12
|
|
|
10
13
|
|
|
11
|
-
def new_scene(
|
|
14
|
+
def new_scene(
|
|
15
|
+
project: str | dict,
|
|
16
|
+
sequence: str | dict,
|
|
17
|
+
name: str,
|
|
18
|
+
client: KitsuClient = default,
|
|
19
|
+
) -> dict:
|
|
12
20
|
"""
|
|
13
21
|
Create a scene for given sequence.
|
|
14
22
|
"""
|
|
@@ -21,7 +29,9 @@ def new_scene(project, sequence, name, client=default):
|
|
|
21
29
|
|
|
22
30
|
|
|
23
31
|
@cache
|
|
24
|
-
def all_scenes(
|
|
32
|
+
def all_scenes(
|
|
33
|
+
project: str | dict | None = None, client: KitsuClient = default
|
|
34
|
+
) -> list[dict]:
|
|
25
35
|
"""
|
|
26
36
|
Retrieve all scenes.
|
|
27
37
|
"""
|
|
@@ -36,7 +46,9 @@ def all_scenes(project=None, client=default):
|
|
|
36
46
|
|
|
37
47
|
|
|
38
48
|
@cache
|
|
39
|
-
def all_scenes_for_project(
|
|
49
|
+
def all_scenes_for_project(
|
|
50
|
+
project: str | dict, client: KitsuClient = default
|
|
51
|
+
) -> list[dict]:
|
|
40
52
|
"""
|
|
41
53
|
Retrieve all scenes for given project.
|
|
42
54
|
"""
|
|
@@ -46,7 +58,9 @@ def all_scenes_for_project(project, client=default):
|
|
|
46
58
|
|
|
47
59
|
|
|
48
60
|
@cache
|
|
49
|
-
def all_scenes_for_sequence(
|
|
61
|
+
def all_scenes_for_sequence(
|
|
62
|
+
sequence: str | dict, client: KitsuClient = default
|
|
63
|
+
) -> list[dict]:
|
|
50
64
|
"""
|
|
51
65
|
Retrieve all scenes which are children from given sequence.
|
|
52
66
|
"""
|
|
@@ -57,7 +71,7 @@ def all_scenes_for_sequence(sequence, client=default):
|
|
|
57
71
|
|
|
58
72
|
|
|
59
73
|
@cache
|
|
60
|
-
def get_scene(scene_id, client=default):
|
|
74
|
+
def get_scene(scene_id: str, client: KitsuClient = default) -> dict:
|
|
61
75
|
"""
|
|
62
76
|
Return scene corresponding to given scene ID.
|
|
63
77
|
"""
|
|
@@ -65,7 +79,9 @@ def get_scene(scene_id, client=default):
|
|
|
65
79
|
|
|
66
80
|
|
|
67
81
|
@cache
|
|
68
|
-
def get_scene_by_name(
|
|
82
|
+
def get_scene_by_name(
|
|
83
|
+
sequence: str | dict, scene_name: str, client: KitsuClient = default
|
|
84
|
+
) -> dict | None:
|
|
69
85
|
"""
|
|
70
86
|
Returns scene corresponding to given sequence and name.
|
|
71
87
|
"""
|
|
@@ -78,14 +94,19 @@ def get_scene_by_name(sequence, scene_name, client=default):
|
|
|
78
94
|
return next(iter(result or []), None)
|
|
79
95
|
|
|
80
96
|
|
|
81
|
-
def update_scene(scene, client=default):
|
|
97
|
+
def update_scene(scene: dict, client: KitsuClient = default) -> dict:
|
|
82
98
|
"""
|
|
83
99
|
Save given scene data into the API.
|
|
84
100
|
"""
|
|
85
101
|
return raw.put("data/entities/%s" % scene["id"], scene, client=client)
|
|
86
102
|
|
|
87
103
|
|
|
88
|
-
def new_scene_asset_instance(
|
|
104
|
+
def new_scene_asset_instance(
|
|
105
|
+
scene: str | dict,
|
|
106
|
+
asset: str | dict,
|
|
107
|
+
description: str | None = None,
|
|
108
|
+
client: KitsuClient = default,
|
|
109
|
+
) -> dict:
|
|
89
110
|
"""
|
|
90
111
|
Creates a new asset instance on given scene. The instance number is
|
|
91
112
|
automatically generated (increment highest number).
|
|
@@ -103,7 +124,9 @@ def new_scene_asset_instance(scene, asset, description=None, client=default):
|
|
|
103
124
|
|
|
104
125
|
|
|
105
126
|
@cache
|
|
106
|
-
def all_asset_instances_for_scene(
|
|
127
|
+
def all_asset_instances_for_scene(
|
|
128
|
+
scene: str | dict, client: KitsuClient = default
|
|
129
|
+
) -> list[dict]:
|
|
107
130
|
"""
|
|
108
131
|
Return the list of asset instances listed in a scene.
|
|
109
132
|
"""
|
|
@@ -114,10 +137,13 @@ def all_asset_instances_for_scene(scene, client=default):
|
|
|
114
137
|
|
|
115
138
|
|
|
116
139
|
@cache
|
|
117
|
-
def get_asset_instance_by_name(
|
|
140
|
+
def get_asset_instance_by_name(
|
|
141
|
+
scene: str | dict, name: str, client: KitsuClient = default
|
|
142
|
+
) -> dict | None:
|
|
118
143
|
"""
|
|
119
144
|
Returns the asset instance of the scene that has the given name.
|
|
120
145
|
"""
|
|
146
|
+
scene = normalize_model_parameter(scene)
|
|
121
147
|
return raw.fetch_first(
|
|
122
148
|
"asset-instances",
|
|
123
149
|
{"name": name, "scene_id": scene["id"]},
|
|
@@ -126,7 +152,9 @@ def get_asset_instance_by_name(scene, name, client=default):
|
|
|
126
152
|
|
|
127
153
|
|
|
128
154
|
@cache
|
|
129
|
-
def all_camera_instances_for_scene(
|
|
155
|
+
def all_camera_instances_for_scene(
|
|
156
|
+
scene: str | dict, client: KitsuClient = default
|
|
157
|
+
) -> list[dict]:
|
|
130
158
|
"""
|
|
131
159
|
Return the list of camera instances listed in a scene.
|
|
132
160
|
"""
|
|
@@ -137,7 +165,9 @@ def all_camera_instances_for_scene(scene, client=default):
|
|
|
137
165
|
|
|
138
166
|
|
|
139
167
|
@cache
|
|
140
|
-
def all_shots_for_scene(
|
|
168
|
+
def all_shots_for_scene(
|
|
169
|
+
scene: str | dict, client: KitsuClient = default
|
|
170
|
+
) -> list[dict]:
|
|
141
171
|
"""
|
|
142
172
|
Return the list of shots issued from given scene.
|
|
143
173
|
"""
|
|
@@ -145,7 +175,9 @@ def all_shots_for_scene(scene, client=default):
|
|
|
145
175
|
return raw.get("data/scenes/%s/shots" % scene["id"], client=client)
|
|
146
176
|
|
|
147
177
|
|
|
148
|
-
def add_shot_to_scene(
|
|
178
|
+
def add_shot_to_scene(
|
|
179
|
+
scene: str | dict, shot: str | dict, client: KitsuClient = default
|
|
180
|
+
) -> dict:
|
|
149
181
|
"""
|
|
150
182
|
Link a shot to a scene to mark the fact it was generated out from that
|
|
151
183
|
scene.
|
|
@@ -156,7 +188,9 @@ def add_shot_to_scene(scene, shot, client=default):
|
|
|
156
188
|
return raw.post("data/scenes/%s/shots" % scene["id"], data, client=client)
|
|
157
189
|
|
|
158
190
|
|
|
159
|
-
def remove_shot_from_scene(
|
|
191
|
+
def remove_shot_from_scene(
|
|
192
|
+
scene: str | dict, shot: str | dict, client: KitsuClient = default
|
|
193
|
+
) -> str:
|
|
160
194
|
"""
|
|
161
195
|
Remove link between a shot and a scene.
|
|
162
196
|
"""
|
|
@@ -167,7 +201,9 @@ def remove_shot_from_scene(scene, shot, client=default):
|
|
|
167
201
|
)
|
|
168
202
|
|
|
169
203
|
|
|
170
|
-
def update_asset_instance_name(
|
|
204
|
+
def update_asset_instance_name(
|
|
205
|
+
asset_instance: dict, name: str, client: KitsuClient = default
|
|
206
|
+
) -> dict:
|
|
171
207
|
"""
|
|
172
208
|
Update the name of given asset instance.
|
|
173
209
|
"""
|
|
@@ -175,7 +211,9 @@ def update_asset_instance_name(asset_instance, name, client=default):
|
|
|
175
211
|
return raw.put(path, {"name": name}, client=client)
|
|
176
212
|
|
|
177
213
|
|
|
178
|
-
def update_asset_instance_data(
|
|
214
|
+
def update_asset_instance_data(
|
|
215
|
+
asset_instance: str | dict, data: dict, client: KitsuClient = default
|
|
216
|
+
) -> dict:
|
|
179
217
|
"""
|
|
180
218
|
Update the extra data of given asset instance.
|
|
181
219
|
"""
|
|
@@ -185,7 +223,9 @@ def update_asset_instance_data(asset_instance, data, client=default):
|
|
|
185
223
|
|
|
186
224
|
|
|
187
225
|
@cache
|
|
188
|
-
def get_sequence_from_scene(
|
|
226
|
+
def get_sequence_from_scene(
|
|
227
|
+
scene: str | dict, client: KitsuClient = default
|
|
228
|
+
) -> dict:
|
|
189
229
|
"""
|
|
190
230
|
Return sequence which is parent of given shot.
|
|
191
231
|
"""
|
gazu/search.py
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
1
3
|
from . import client as raw
|
|
2
4
|
|
|
5
|
+
from .client import KitsuClient
|
|
3
6
|
from .helpers import normalize_model_parameter
|
|
4
7
|
|
|
5
8
|
default = raw.default_client
|
|
6
9
|
|
|
7
10
|
|
|
8
|
-
def search_entities(
|
|
11
|
+
def search_entities(
|
|
12
|
+
query: str,
|
|
13
|
+
project: str | dict | None = None,
|
|
14
|
+
entity_types: list[str | dict] | None = None,
|
|
15
|
+
client: KitsuClient = default,
|
|
16
|
+
) -> dict[str, list]:
|
|
9
17
|
"""
|
|
10
18
|
Search for entities matching the given query.
|
|
11
19
|
|
|
12
20
|
Args:
|
|
13
21
|
query (str): Search query string.
|
|
14
|
-
project (
|
|
22
|
+
project (str / dict): Optional project to limit search to.
|
|
15
23
|
entity_types (list): Optional list of entity type dicts or IDs to filter by.
|
|
16
24
|
|
|
17
25
|
Returns:
|
|
@@ -32,4 +40,3 @@ def search_entities(query, project=None, entity_types=None, client=default):
|
|
|
32
40
|
data["entity_types"] = entity_type_ids
|
|
33
41
|
|
|
34
42
|
return raw.post("data/search", data, client=client)
|
|
35
|
-
|