Ayon-Python-Api 0.2.2__py3-none-any.whl → 0.3.1__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.
- ayon_api/__init__.py +2 -0
- ayon_api/_api.py +5 -0
- ayon_api/server_api.py +230 -83
- ayon_api/version.py +1 -1
- ayon_python_api-0.3.1.dist-info/METADATA +287 -0
- {ayon_python_api-0.2.2.dist-info → ayon_python_api-0.3.1.dist-info}/RECORD +9 -9
- ayon_python_api-0.2.2.dist-info/METADATA +0 -84
- {ayon_python_api-0.2.2.dist-info → ayon_python_api-0.3.1.dist-info}/LICENSE +0 -0
- {ayon_python_api-0.2.2.dist-info → ayon_python_api-0.3.1.dist-info}/WHEEL +0 -0
- {ayon_python_api-0.2.2.dist-info → ayon_python_api-0.3.1.dist-info}/top_level.txt +0 -0
ayon_api/__init__.py
CHANGED
|
@@ -101,6 +101,7 @@ from ._api import (
|
|
|
101
101
|
get_addon_studio_settings,
|
|
102
102
|
get_addon_project_settings,
|
|
103
103
|
get_addon_settings,
|
|
104
|
+
get_bundle_settings,
|
|
104
105
|
get_addons_studio_settings,
|
|
105
106
|
get_addons_project_settings,
|
|
106
107
|
get_addons_settings,
|
|
@@ -280,6 +281,7 @@ __all__ = (
|
|
|
280
281
|
"get_addon_studio_settings",
|
|
281
282
|
"get_addon_project_settings",
|
|
282
283
|
"get_addon_settings",
|
|
284
|
+
"get_bundle_settings",
|
|
283
285
|
"get_addons_studio_settings",
|
|
284
286
|
"get_addons_project_settings",
|
|
285
287
|
"get_addons_settings",
|
ayon_api/_api.py
CHANGED
|
@@ -688,6 +688,11 @@ def get_addon_site_settings(*args, **kwargs):
|
|
|
688
688
|
return con.get_addon_site_settings(*args, **kwargs)
|
|
689
689
|
|
|
690
690
|
|
|
691
|
+
def get_bundle_settings(*args, **kwargs):
|
|
692
|
+
con = get_server_api_connection()
|
|
693
|
+
return con.get_bundle_settings(*args, **kwargs)
|
|
694
|
+
|
|
695
|
+
|
|
691
696
|
def get_addons_studio_settings(*args, **kwargs):
|
|
692
697
|
con = get_server_api_connection()
|
|
693
698
|
return con.get_addons_studio_settings(*args, **kwargs)
|
ayon_api/server_api.py
CHANGED
|
@@ -310,9 +310,9 @@ class ServerAPI(object):
|
|
|
310
310
|
connection is created from the same machine under same user.
|
|
311
311
|
client_version (Optional[str]): Version of client application (used in
|
|
312
312
|
desktop client application).
|
|
313
|
-
default_settings_variant (Optional[
|
|
314
|
-
default if a method for settings won't
|
|
315
|
-
'production').
|
|
313
|
+
default_settings_variant (Optional[Literal["production", "staging"]]):
|
|
314
|
+
Settings variant used by default if a method for settings won't
|
|
315
|
+
get any (by default is 'production').
|
|
316
316
|
ssl_verify (Union[bool, str, None]): Verify SSL certificate
|
|
317
317
|
Looks for env variable value 'AYON_CA_FILE' by default. If not
|
|
318
318
|
available then 'True' is used.
|
|
@@ -341,7 +341,10 @@ class ServerAPI(object):
|
|
|
341
341
|
self._access_token = token
|
|
342
342
|
self._site_id = site_id
|
|
343
343
|
self._client_version = client_version
|
|
344
|
-
self._default_settings_variant =
|
|
344
|
+
self._default_settings_variant = (
|
|
345
|
+
default_settings_variant
|
|
346
|
+
or "production"
|
|
347
|
+
)
|
|
345
348
|
|
|
346
349
|
if ssl_verify is None:
|
|
347
350
|
# Custom AYON env variable for CA file or 'True'
|
|
@@ -527,9 +530,13 @@ class ServerAPI(object):
|
|
|
527
530
|
as default variant.
|
|
528
531
|
|
|
529
532
|
Args:
|
|
530
|
-
variant (
|
|
533
|
+
variant (Literal['production', 'staging']): Settings variant name.
|
|
531
534
|
"""
|
|
532
535
|
|
|
536
|
+
if variant not in ("production", "staging"):
|
|
537
|
+
raise ValueError((
|
|
538
|
+
"Invalid variant name {}. Expected 'production' or 'staging'"
|
|
539
|
+
).format(variant))
|
|
533
540
|
self._default_settings_variant = variant
|
|
534
541
|
|
|
535
542
|
default_settings_variant = property(
|
|
@@ -1957,6 +1964,24 @@ class ServerAPI(object):
|
|
|
1957
1964
|
result.raise_for_status()
|
|
1958
1965
|
return result.data
|
|
1959
1966
|
|
|
1967
|
+
def _get_dependency_package_route(
|
|
1968
|
+
self, filename=None, platform_name=None
|
|
1969
|
+
):
|
|
1970
|
+
major, minor, patch, _, _ = self.server_version_tuple
|
|
1971
|
+
if major == 0 and (minor > 2 or (minor == 2 and patch >= 1)):
|
|
1972
|
+
base = "desktop/dependency_packages"
|
|
1973
|
+
if not filename:
|
|
1974
|
+
return base
|
|
1975
|
+
return "{}/{}".format(base, filename)
|
|
1976
|
+
|
|
1977
|
+
# Backwards compatibility for AYON server 0.2.0 and lower
|
|
1978
|
+
if platform_name is None:
|
|
1979
|
+
platform_name = platform.system().lower()
|
|
1980
|
+
base = "dependencies"
|
|
1981
|
+
if not filename:
|
|
1982
|
+
return base
|
|
1983
|
+
return "{}/{}/{}".format(base, filename, platform_name)
|
|
1984
|
+
|
|
1960
1985
|
def create_dependency_package(
|
|
1961
1986
|
self,
|
|
1962
1987
|
filename,
|
|
@@ -2007,7 +2032,8 @@ class ServerAPI(object):
|
|
|
2007
2032
|
if sources:
|
|
2008
2033
|
post_body["sources"] = sources
|
|
2009
2034
|
|
|
2010
|
-
|
|
2035
|
+
route = self._get_dependency_package_route()
|
|
2036
|
+
response = self.post(route, **post_body)
|
|
2011
2037
|
response.raise_for_status()
|
|
2012
2038
|
|
|
2013
2039
|
def update_dependency_package(self, filename, sources):
|
|
@@ -2021,7 +2047,7 @@ class ServerAPI(object):
|
|
|
2021
2047
|
"""
|
|
2022
2048
|
|
|
2023
2049
|
response = self.patch(
|
|
2024
|
-
|
|
2050
|
+
self._get_dependency_package_route(filename),
|
|
2025
2051
|
sources=sources
|
|
2026
2052
|
)
|
|
2027
2053
|
response.raise_for_status()
|
|
@@ -2037,15 +2063,8 @@ class ServerAPI(object):
|
|
|
2037
2063
|
Deprecated since version 0.2.1
|
|
2038
2064
|
"""
|
|
2039
2065
|
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
if platform_name is None:
|
|
2043
|
-
platform_name = platform.system().lower()
|
|
2044
|
-
url = "dependencies/{}/{}".format(filename, platform_name)
|
|
2045
|
-
else:
|
|
2046
|
-
url = "desktop/dependency_packages/{}".format(filename)
|
|
2047
|
-
|
|
2048
|
-
response = self.delete(url)
|
|
2066
|
+
route = self._get_dependency_package_route(filename, platform_name)
|
|
2067
|
+
response = self.delete(route)
|
|
2049
2068
|
if response.status != 200:
|
|
2050
2069
|
raise ServerError("Failed to delete dependency file")
|
|
2051
2070
|
return response.data
|
|
@@ -2081,17 +2100,10 @@ class ServerAPI(object):
|
|
|
2081
2100
|
str: Filepath to downloaded file.
|
|
2082
2101
|
"""
|
|
2083
2102
|
|
|
2084
|
-
|
|
2085
|
-
if major == 0 and (minor < 2 or (minor == 2 and patch < 1)):
|
|
2086
|
-
if platform_name is None:
|
|
2087
|
-
platform_name = platform.system().lower()
|
|
2088
|
-
url = "dependencies/{}/{}".format(src_filename, platform_name)
|
|
2089
|
-
else:
|
|
2090
|
-
url = "desktop/dependency_packages/{}".format(src_filename)
|
|
2091
|
-
|
|
2103
|
+
route = self._get_dependency_package_route(src_filename, platform_name)
|
|
2092
2104
|
package_filepath = os.path.join(dst_directory, dst_filename)
|
|
2093
2105
|
self.download_file(
|
|
2094
|
-
|
|
2106
|
+
route,
|
|
2095
2107
|
package_filepath,
|
|
2096
2108
|
chunk_size=chunk_size,
|
|
2097
2109
|
progress=progress
|
|
@@ -2113,15 +2125,8 @@ class ServerAPI(object):
|
|
|
2113
2125
|
upload state.
|
|
2114
2126
|
"""
|
|
2115
2127
|
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
if platform_name is None:
|
|
2119
|
-
platform_name = platform.system().lower()
|
|
2120
|
-
url = "dependencies/{}/{}".format(dst_filename, platform_name)
|
|
2121
|
-
else:
|
|
2122
|
-
url = "desktop/dependency_packages/{}".format(dst_filename)
|
|
2123
|
-
|
|
2124
|
-
self.upload_file(url, src_filepath, progress=progress)
|
|
2128
|
+
route = self._get_dependency_package_route(dst_filename, platform_name)
|
|
2129
|
+
self.upload_file(route, src_filepath, progress=progress)
|
|
2125
2130
|
|
|
2126
2131
|
def create_dependency_package_basename(self, platform_name=None):
|
|
2127
2132
|
"""Create basename for dependency package file.
|
|
@@ -2141,6 +2146,14 @@ class ServerAPI(object):
|
|
|
2141
2146
|
time_stamp = now_date.strftime("%y%m%d%H%M")
|
|
2142
2147
|
return "ayon_{}_{}".format(time_stamp, platform_name)
|
|
2143
2148
|
|
|
2149
|
+
def _get_bundles_route(self):
|
|
2150
|
+
major, minor, patch, _, _ = self.server_version_tuple
|
|
2151
|
+
# Backwards compatibility for AYON server 0.3.0
|
|
2152
|
+
# - first version where bundles were available
|
|
2153
|
+
if major == 0 and minor == 3 and patch == 0:
|
|
2154
|
+
return "desktop/bundles"
|
|
2155
|
+
return "bundles"
|
|
2156
|
+
|
|
2144
2157
|
def get_bundles(self):
|
|
2145
2158
|
"""Server bundles with basic information.
|
|
2146
2159
|
|
|
@@ -2171,7 +2184,7 @@ class ServerAPI(object):
|
|
|
2171
2184
|
dict[str, Any]: Server bundles with basic information.
|
|
2172
2185
|
"""
|
|
2173
2186
|
|
|
2174
|
-
response = self.get(
|
|
2187
|
+
response = self.get(self._get_bundles_route())
|
|
2175
2188
|
response.raise_for_status()
|
|
2176
2189
|
return response.data
|
|
2177
2190
|
|
|
@@ -2214,7 +2227,7 @@ class ServerAPI(object):
|
|
|
2214
2227
|
if value is not None:
|
|
2215
2228
|
body[key] = value
|
|
2216
2229
|
|
|
2217
|
-
response = self.post(
|
|
2230
|
+
response = self.post(self._get_bundles_route(), **body)
|
|
2218
2231
|
response.raise_for_status()
|
|
2219
2232
|
|
|
2220
2233
|
def update_bundle(
|
|
@@ -2249,7 +2262,8 @@ class ServerAPI(object):
|
|
|
2249
2262
|
if value is not None
|
|
2250
2263
|
}
|
|
2251
2264
|
response = self.patch(
|
|
2252
|
-
"
|
|
2265
|
+
"{}/{}".format(self._get_bundles_route(), bundle_name),
|
|
2266
|
+
**body
|
|
2253
2267
|
)
|
|
2254
2268
|
response.raise_for_status()
|
|
2255
2269
|
|
|
@@ -2260,7 +2274,9 @@ class ServerAPI(object):
|
|
|
2260
2274
|
bundle_name (str): Name of bundle to delete.
|
|
2261
2275
|
"""
|
|
2262
2276
|
|
|
2263
|
-
response = self.delete(
|
|
2277
|
+
response = self.delete(
|
|
2278
|
+
"{}/{}".format(self._get_bundles_route(), bundle_name)
|
|
2279
|
+
)
|
|
2264
2280
|
response.raise_for_status()
|
|
2265
2281
|
|
|
2266
2282
|
# Anatomy presets
|
|
@@ -2404,17 +2420,17 @@ class ServerAPI(object):
|
|
|
2404
2420
|
):
|
|
2405
2421
|
"""Addon studio settings.
|
|
2406
2422
|
|
|
2407
|
-
|
|
2423
|
+
Receive studio settings for specific version of an addon.
|
|
2408
2424
|
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2425
|
+
Args:
|
|
2426
|
+
addon_name (str): Name of addon.
|
|
2427
|
+
addon_version (str): Version of addon.
|
|
2428
|
+
variant (Optional[Literal['production', 'staging']]): Name of
|
|
2429
|
+
settings variant. Used 'default_settings_variant' by default.
|
|
2414
2430
|
|
|
2415
|
-
|
|
2431
|
+
Returns:
|
|
2416
2432
|
dict[str, Any]: Addon settings.
|
|
2417
|
-
|
|
2433
|
+
"""
|
|
2418
2434
|
|
|
2419
2435
|
if variant is None:
|
|
2420
2436
|
variant = self.default_settings_variant
|
|
@@ -2452,8 +2468,8 @@ class ServerAPI(object):
|
|
|
2452
2468
|
addon_version (str): Version of addon.
|
|
2453
2469
|
project_name (str): Name of project for which the settings are
|
|
2454
2470
|
received.
|
|
2455
|
-
variant (Optional[
|
|
2456
|
-
|
|
2471
|
+
variant (Optional[Literal['production', 'staging']]): Name of
|
|
2472
|
+
settings variant. Used 'default_settings_variant' by default.
|
|
2457
2473
|
site_id (Optional[str]): Name of site which is used for site
|
|
2458
2474
|
overrides. Is filled with connection 'site_id' attribute
|
|
2459
2475
|
if not passed.
|
|
@@ -2509,8 +2525,8 @@ class ServerAPI(object):
|
|
|
2509
2525
|
project_name (Optional[str]): Name of project for which the
|
|
2510
2526
|
settings are received. A studio settings values are received
|
|
2511
2527
|
if is 'None'.
|
|
2512
|
-
variant (Optional[
|
|
2513
|
-
|
|
2528
|
+
variant (Optional[Literal['production', 'staging']]): Name of
|
|
2529
|
+
settings variant. Used 'default_settings_variant' by default.
|
|
2514
2530
|
site_id (Optional[str]): Name of site which is used for site
|
|
2515
2531
|
overrides. Is filled with connection 'site_id' attribute
|
|
2516
2532
|
if not passed.
|
|
@@ -2560,12 +2576,106 @@ class ServerAPI(object):
|
|
|
2560
2576
|
result.raise_for_status()
|
|
2561
2577
|
return result.data
|
|
2562
2578
|
|
|
2563
|
-
def
|
|
2579
|
+
def get_bundle_settings(
|
|
2580
|
+
self,
|
|
2581
|
+
bundle_name=None,
|
|
2582
|
+
project_name=None,
|
|
2583
|
+
variant=None,
|
|
2584
|
+
site_id=None,
|
|
2585
|
+
use_site=True
|
|
2586
|
+
):
|
|
2587
|
+
"""Get complete set of settings for given data.
|
|
2588
|
+
|
|
2589
|
+
If project is not passed then studio settings are returned. If variant
|
|
2590
|
+
is not passed 'default_settings_variant' is used. If bundle name is
|
|
2591
|
+
not passed then current production/staging bundle is used, based on
|
|
2592
|
+
variant value.
|
|
2593
|
+
|
|
2594
|
+
Output contains addon settings and site settings in single dictionary.
|
|
2595
|
+
|
|
2596
|
+
TODOs:
|
|
2597
|
+
- test how it behaves if there is not any bundle.
|
|
2598
|
+
- test how it behaves if there is not any production/staging
|
|
2599
|
+
bundle.
|
|
2600
|
+
|
|
2601
|
+
Warnings:
|
|
2602
|
+
For AYON server < 0.3.0 bundle name will be ignored.
|
|
2603
|
+
|
|
2604
|
+
Example output:
|
|
2605
|
+
{
|
|
2606
|
+
"addons": [
|
|
2607
|
+
{
|
|
2608
|
+
"name": "addon-name",
|
|
2609
|
+
"version": "addon-version",
|
|
2610
|
+
"settings": {...}
|
|
2611
|
+
"siteSettings": {...}
|
|
2612
|
+
}
|
|
2613
|
+
]
|
|
2614
|
+
}
|
|
2615
|
+
|
|
2616
|
+
Returns:
|
|
2617
|
+
dict[str, Any]: All settings for single bundle.
|
|
2618
|
+
"""
|
|
2619
|
+
|
|
2620
|
+
major, minor, _, _, _ = self.server_version_tuple
|
|
2621
|
+
query_values = {
|
|
2622
|
+
key: value
|
|
2623
|
+
for key, value in (
|
|
2624
|
+
("project_name", project_name),
|
|
2625
|
+
("variant", variant or self.default_settings_variant),
|
|
2626
|
+
("bundle_name", bundle_name),
|
|
2627
|
+
)
|
|
2628
|
+
if value
|
|
2629
|
+
}
|
|
2630
|
+
if use_site:
|
|
2631
|
+
if not site_id:
|
|
2632
|
+
site_id = self.site_id
|
|
2633
|
+
if site_id:
|
|
2634
|
+
query_values["site_id"] = site_id
|
|
2635
|
+
|
|
2636
|
+
if major == 0 and minor >= 3:
|
|
2637
|
+
url = "settings"
|
|
2638
|
+
else:
|
|
2639
|
+
# Backward compatibility for AYON server < 0.3.0
|
|
2640
|
+
url = "settings/addons"
|
|
2641
|
+
query_values.pop("bundle_name", None)
|
|
2642
|
+
for new_key, old_key in (
|
|
2643
|
+
("project_name", "project"),
|
|
2644
|
+
("site_id", "site"),
|
|
2645
|
+
):
|
|
2646
|
+
if new_key in query_values:
|
|
2647
|
+
query_values[old_key] = query_values.pop(new_key)
|
|
2648
|
+
|
|
2649
|
+
query = prepare_query_string(query_values)
|
|
2650
|
+
response = self.get("{}{}".format(url, query))
|
|
2651
|
+
response.raise_for_status()
|
|
2652
|
+
return response.data
|
|
2653
|
+
|
|
2654
|
+
def get_addons_studio_settings(
|
|
2655
|
+
self,
|
|
2656
|
+
bundle_name=None,
|
|
2657
|
+
variant=None,
|
|
2658
|
+
site_id=None,
|
|
2659
|
+
use_site=True,
|
|
2660
|
+
only_values=True
|
|
2661
|
+
):
|
|
2564
2662
|
"""All addons settings in one bulk.
|
|
2565
2663
|
|
|
2664
|
+
Warnings:
|
|
2665
|
+
Behavior of this function changed with AYON server version 0.3.0.
|
|
2666
|
+
Structure of output from server changed. If using
|
|
2667
|
+
'only_values=True' then output should be same as before.
|
|
2668
|
+
|
|
2566
2669
|
Args:
|
|
2567
|
-
|
|
2568
|
-
settings
|
|
2670
|
+
bundle_name (Optional[str]): Name of bundle for which should be
|
|
2671
|
+
settings received.
|
|
2672
|
+
variant (Optional[Literal['production', 'staging']]): Name of
|
|
2673
|
+
settings variant. Used 'default_settings_variant' by default.
|
|
2674
|
+
site_id (Optional[str]): Id of site for which want to receive
|
|
2675
|
+
site overrides.
|
|
2676
|
+
use_site (bool): To force disable option of using site overrides
|
|
2677
|
+
set to 'False'. In that case won't be applied any site
|
|
2678
|
+
overrides.
|
|
2569
2679
|
only_values (Optional[bool]): Output will contain only settings
|
|
2570
2680
|
values without metadata about addons.
|
|
2571
2681
|
|
|
@@ -2573,20 +2683,28 @@ class ServerAPI(object):
|
|
|
2573
2683
|
dict[str, Any]: Settings of all addons on server.
|
|
2574
2684
|
"""
|
|
2575
2685
|
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
output = response.data
|
|
2686
|
+
output = self.get_bundle_settings(
|
|
2687
|
+
bundle_name=bundle_name,
|
|
2688
|
+
variant=variant,
|
|
2689
|
+
site_id=site_id,
|
|
2690
|
+
use_site=use_site
|
|
2691
|
+
)
|
|
2583
2692
|
if only_values:
|
|
2584
|
-
|
|
2693
|
+
major, minor, patch, _, _ = self.server_version_tuple
|
|
2694
|
+
if major == 0 and minor >= 3:
|
|
2695
|
+
output = {
|
|
2696
|
+
addon["name"]: addon["settings"]
|
|
2697
|
+
for addon in output["addons"]
|
|
2698
|
+
}
|
|
2699
|
+
else:
|
|
2700
|
+
# Backward compatibility for AYON server < 0.3.0
|
|
2701
|
+
output = output["settings"]
|
|
2585
2702
|
return output
|
|
2586
2703
|
|
|
2587
2704
|
def get_addons_project_settings(
|
|
2588
2705
|
self,
|
|
2589
2706
|
project_name,
|
|
2707
|
+
bundle_name=None,
|
|
2590
2708
|
variant=None,
|
|
2591
2709
|
site_id=None,
|
|
2592
2710
|
use_site=True,
|
|
@@ -2605,11 +2723,18 @@ class ServerAPI(object):
|
|
|
2605
2723
|
argument which is by default set to 'True'. In that case output
|
|
2606
2724
|
contains only value of 'settings' key.
|
|
2607
2725
|
|
|
2726
|
+
Warnings:
|
|
2727
|
+
Behavior of this function changed with AYON server version 0.3.0.
|
|
2728
|
+
Structure of output from server changed. If using
|
|
2729
|
+
'only_values=True' then output should be same as before.
|
|
2730
|
+
|
|
2608
2731
|
Args:
|
|
2609
2732
|
project_name (str): Name of project for which are settings
|
|
2610
2733
|
received.
|
|
2611
|
-
|
|
2612
|
-
settings
|
|
2734
|
+
bundle_name (Optional[str]): Name of bundle for which should be
|
|
2735
|
+
settings received.
|
|
2736
|
+
variant (Optional[Literal['production', 'staging']]): Name of
|
|
2737
|
+
settings variant. Used 'default_settings_variant' by default.
|
|
2613
2738
|
site_id (Optional[str]): Id of site for which want to receive
|
|
2614
2739
|
site overrides.
|
|
2615
2740
|
use_site (bool): To force disable option of using site overrides
|
|
@@ -2623,27 +2748,31 @@ class ServerAPI(object):
|
|
|
2623
2748
|
project.
|
|
2624
2749
|
"""
|
|
2625
2750
|
|
|
2626
|
-
|
|
2627
|
-
"
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
query_values["site"] = site_id
|
|
2637
|
-
query = prepare_query_string(query_values)
|
|
2638
|
-
response = self.get("settings/addons{}".format(query))
|
|
2639
|
-
response.raise_for_status()
|
|
2640
|
-
output = response.data
|
|
2751
|
+
if not project_name:
|
|
2752
|
+
raise ValueError("Project name must be passed.")
|
|
2753
|
+
|
|
2754
|
+
output = self.get_bundle_settings(
|
|
2755
|
+
project_name=project_name,
|
|
2756
|
+
bundle_name=bundle_name,
|
|
2757
|
+
variant=variant,
|
|
2758
|
+
site_id=site_id,
|
|
2759
|
+
use_site=use_site
|
|
2760
|
+
)
|
|
2641
2761
|
if only_values:
|
|
2642
|
-
|
|
2762
|
+
major, minor, patch, _, _ = self.server_version_tuple
|
|
2763
|
+
if major == 0 and minor >= 3:
|
|
2764
|
+
output = {
|
|
2765
|
+
addon["name"]: addon["settings"]
|
|
2766
|
+
for addon in output["addons"]
|
|
2767
|
+
}
|
|
2768
|
+
else:
|
|
2769
|
+
# Backward compatibility for AYON server < 0.3.0
|
|
2770
|
+
output = output["settings"]
|
|
2643
2771
|
return output
|
|
2644
2772
|
|
|
2645
2773
|
def get_addons_settings(
|
|
2646
2774
|
self,
|
|
2775
|
+
bundle_name=None,
|
|
2647
2776
|
project_name=None,
|
|
2648
2777
|
variant=None,
|
|
2649
2778
|
site_id=None,
|
|
@@ -2655,11 +2784,18 @@ class ServerAPI(object):
|
|
|
2655
2784
|
Based on 'project_name' will receive studio settings or project
|
|
2656
2785
|
settings. In case project is not passed is 'site_id' ignored.
|
|
2657
2786
|
|
|
2787
|
+
Warnings:
|
|
2788
|
+
Behavior of this function changed with AYON server version 0.3.0.
|
|
2789
|
+
Structure of output from server changed. If using
|
|
2790
|
+
'only_values=True' then output should be same as before.
|
|
2791
|
+
|
|
2658
2792
|
Args:
|
|
2793
|
+
bundle_name (Optional[str]): Name of bundle for which should be
|
|
2794
|
+
settings received.
|
|
2659
2795
|
project_name (Optional[str]): Name of project for which should be
|
|
2660
2796
|
settings received.
|
|
2661
|
-
variant (Optional[Literal[production, staging]]):
|
|
2662
|
-
|
|
2797
|
+
variant (Optional[Literal['production', 'staging']]): Name of
|
|
2798
|
+
settings variant. Used 'default_settings_variant' by default.
|
|
2663
2799
|
site_id (Optional[str]): Id of site for which want to receive
|
|
2664
2800
|
site overrides.
|
|
2665
2801
|
use_site (Optional[bool]): To force disable option of using site
|
|
@@ -2670,10 +2806,21 @@ class ServerAPI(object):
|
|
|
2670
2806
|
"""
|
|
2671
2807
|
|
|
2672
2808
|
if project_name is None:
|
|
2673
|
-
return self.get_addons_studio_settings(
|
|
2809
|
+
return self.get_addons_studio_settings(
|
|
2810
|
+
bundle_name=bundle_name,
|
|
2811
|
+
variant=variant,
|
|
2812
|
+
site_id=site_id,
|
|
2813
|
+
use_site=use_site,
|
|
2814
|
+
only_values=only_values
|
|
2815
|
+
)
|
|
2674
2816
|
|
|
2675
2817
|
return self.get_addons_project_settings(
|
|
2676
|
-
project_name,
|
|
2818
|
+
project_name=project_name,
|
|
2819
|
+
bundle_name=bundle_name,
|
|
2820
|
+
variant=variant,
|
|
2821
|
+
site_id=site_id,
|
|
2822
|
+
use_site=use_site,
|
|
2823
|
+
only_values=only_values
|
|
2677
2824
|
)
|
|
2678
2825
|
|
|
2679
2826
|
# Entity getters
|
ayon_api/version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""Package declaring Python API for Ayon server."""
|
|
2
|
-
__version__ = "0.
|
|
2
|
+
__version__ = "0.3.1"
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: ayon-python-api
|
|
3
|
+
Version: 0.3.1
|
|
4
|
+
Summary: AYON Python API
|
|
5
|
+
Home-page: https://github.com/ynput/ayon-python-api
|
|
6
|
+
Author: ynput.io
|
|
7
|
+
Author-email: "ynput.io" <info@ynput.io>
|
|
8
|
+
License: Apache License
|
|
9
|
+
Version 2.0, January 2004
|
|
10
|
+
http://www.apache.org/licenses/
|
|
11
|
+
|
|
12
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
13
|
+
|
|
14
|
+
1. Definitions.
|
|
15
|
+
|
|
16
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
17
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
18
|
+
|
|
19
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
20
|
+
the copyright owner that is granting the License.
|
|
21
|
+
|
|
22
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
23
|
+
other entities that control, are controlled by, or are under common
|
|
24
|
+
control with that entity. For the purposes of this definition,
|
|
25
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
26
|
+
direction or management of such entity, whether by contract or
|
|
27
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
28
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
29
|
+
|
|
30
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
31
|
+
exercising permissions granted by this License.
|
|
32
|
+
|
|
33
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
34
|
+
including but not limited to software source code, documentation
|
|
35
|
+
source, and configuration files.
|
|
36
|
+
|
|
37
|
+
"Object" form shall mean any form resulting from mechanical
|
|
38
|
+
transformation or translation of a Source form, including but
|
|
39
|
+
not limited to compiled object code, generated documentation,
|
|
40
|
+
and conversions to other media types.
|
|
41
|
+
|
|
42
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
43
|
+
Object form, made available under the License, as indicated by a
|
|
44
|
+
copyright notice that is included in or attached to the work
|
|
45
|
+
(an example is provided in the Appendix below).
|
|
46
|
+
|
|
47
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
48
|
+
form, that is based on (or derived from) the Work and for which the
|
|
49
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
50
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
51
|
+
of this License, Derivative Works shall not include works that remain
|
|
52
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
53
|
+
the Work and Derivative Works thereof.
|
|
54
|
+
|
|
55
|
+
"Contribution" shall mean any work of authorship, including
|
|
56
|
+
the original version of the Work and any modifications or additions
|
|
57
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
58
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
59
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
60
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
61
|
+
means any form of electronic, verbal, or written communication sent
|
|
62
|
+
to the Licensor or its representatives, including but not limited to
|
|
63
|
+
communication on electronic mailing lists, source code control systems,
|
|
64
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
65
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
66
|
+
excluding communication that is conspicuously marked or otherwise
|
|
67
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
68
|
+
|
|
69
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
70
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
71
|
+
subsequently incorporated within the Work.
|
|
72
|
+
|
|
73
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
77
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
78
|
+
Work and such Derivative Works in Source or Object form.
|
|
79
|
+
|
|
80
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
81
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
82
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
83
|
+
(except as stated in this section) patent license to make, have made,
|
|
84
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
85
|
+
where such license applies only to those patent claims licensable
|
|
86
|
+
by such Contributor that are necessarily infringed by their
|
|
87
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
88
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
89
|
+
institute patent litigation against any entity (including a
|
|
90
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
91
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
92
|
+
or contributory patent infringement, then any patent licenses
|
|
93
|
+
granted to You under this License for that Work shall terminate
|
|
94
|
+
as of the date such litigation is filed.
|
|
95
|
+
|
|
96
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
97
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
98
|
+
modifications, and in Source or Object form, provided that You
|
|
99
|
+
meet the following conditions:
|
|
100
|
+
|
|
101
|
+
(a) You must give any other recipients of the Work or
|
|
102
|
+
Derivative Works a copy of this License; and
|
|
103
|
+
|
|
104
|
+
(b) You must cause any modified files to carry prominent notices
|
|
105
|
+
stating that You changed the files; and
|
|
106
|
+
|
|
107
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
108
|
+
that You distribute, all copyright, patent, trademark, and
|
|
109
|
+
attribution notices from the Source form of the Work,
|
|
110
|
+
excluding those notices that do not pertain to any part of
|
|
111
|
+
the Derivative Works; and
|
|
112
|
+
|
|
113
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
114
|
+
distribution, then any Derivative Works that You distribute must
|
|
115
|
+
include a readable copy of the attribution notices contained
|
|
116
|
+
within such NOTICE file, excluding those notices that do not
|
|
117
|
+
pertain to any part of the Derivative Works, in at least one
|
|
118
|
+
of the following places: within a NOTICE text file distributed
|
|
119
|
+
as part of the Derivative Works; within the Source form or
|
|
120
|
+
documentation, if provided along with the Derivative Works; or,
|
|
121
|
+
within a display generated by the Derivative Works, if and
|
|
122
|
+
wherever such third-party notices normally appear. The contents
|
|
123
|
+
of the NOTICE file are for informational purposes only and
|
|
124
|
+
do not modify the License. You may add Your own attribution
|
|
125
|
+
notices within Derivative Works that You distribute, alongside
|
|
126
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
127
|
+
that such additional attribution notices cannot be construed
|
|
128
|
+
as modifying the License.
|
|
129
|
+
|
|
130
|
+
You may add Your own copyright statement to Your modifications and
|
|
131
|
+
may provide additional or different license terms and conditions
|
|
132
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
133
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
134
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
135
|
+
the conditions stated in this License.
|
|
136
|
+
|
|
137
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
138
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
139
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
140
|
+
this License, without any additional terms or conditions.
|
|
141
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
142
|
+
the terms of any separate license agreement you may have executed
|
|
143
|
+
with Licensor regarding such Contributions.
|
|
144
|
+
|
|
145
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
146
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
147
|
+
except as required for reasonable and customary use in describing the
|
|
148
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
149
|
+
|
|
150
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
151
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
152
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
153
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
154
|
+
implied, including, without limitation, any warranties or conditions
|
|
155
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
156
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
157
|
+
appropriateness of using or redistributing the Work and assume any
|
|
158
|
+
risks associated with Your exercise of permissions under this License.
|
|
159
|
+
|
|
160
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
161
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
162
|
+
unless required by applicable law (such as deliberate and grossly
|
|
163
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
164
|
+
liable to You for damages, including any direct, indirect, special,
|
|
165
|
+
incidental, or consequential damages of any character arising as a
|
|
166
|
+
result of this License or out of the use or inability to use the
|
|
167
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
168
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
169
|
+
other commercial damages or losses), even if such Contributor
|
|
170
|
+
has been advised of the possibility of such damages.
|
|
171
|
+
|
|
172
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
173
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
174
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
175
|
+
or other liability obligations and/or rights consistent with this
|
|
176
|
+
License. However, in accepting such obligations, You may act only
|
|
177
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
178
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
179
|
+
defend, and hold each Contributor harmless for any liability
|
|
180
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
181
|
+
of your accepting any such warranty or additional liability.
|
|
182
|
+
|
|
183
|
+
END OF TERMS AND CONDITIONS
|
|
184
|
+
|
|
185
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
186
|
+
|
|
187
|
+
To apply the Apache License to your work, attach the following
|
|
188
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
189
|
+
replaced with your own identifying information. (Don't include
|
|
190
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
191
|
+
comment syntax for the file format. We also recommend that a
|
|
192
|
+
file or class name and description of purpose be included on the
|
|
193
|
+
same "printed page" as the copyright notice for easier
|
|
194
|
+
identification within third-party archives.
|
|
195
|
+
|
|
196
|
+
Copyright [yyyy] [name of copyright owner]
|
|
197
|
+
|
|
198
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
199
|
+
you may not use this file except in compliance with the License.
|
|
200
|
+
You may obtain a copy of the License at
|
|
201
|
+
|
|
202
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
203
|
+
|
|
204
|
+
Unless required by applicable law or agreed to in writing, software
|
|
205
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
206
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
207
|
+
See the License for the specific language governing permissions and
|
|
208
|
+
limitations under the License.
|
|
209
|
+
|
|
210
|
+
Project-URL: Repository, https://github.com/ynput/ayon-python-api
|
|
211
|
+
Project-URL: Changelog, https://github.com/ynput/ayon-python-api/releases
|
|
212
|
+
Keywords: AYON,ynput,OpenPype,vfx
|
|
213
|
+
Classifier: Development Status :: 3 - Alpha
|
|
214
|
+
Classifier: Programming Language :: Python
|
|
215
|
+
Classifier: Programming Language :: Python :: 2
|
|
216
|
+
Classifier: Programming Language :: Python :: 3
|
|
217
|
+
Description-Content-Type: text/markdown
|
|
218
|
+
License-File: LICENSE
|
|
219
|
+
Requires-Dist: requests (>=2.27.1)
|
|
220
|
+
Requires-Dist: six (>=1.15)
|
|
221
|
+
Requires-Dist: Unidecode (>=1.2.0)
|
|
222
|
+
Requires-Dist: appdirs (<2,>=1)
|
|
223
|
+
|
|
224
|
+
# AYON server API
|
|
225
|
+
Python client for connection server. Client must be (at least for some time) Python 2 compatible because will be used in DCC that are "older".
|
|
226
|
+
|
|
227
|
+
AYON Python api should support connection to server with raw REST functions and prepared functionality for work with entities. Must not contain only functionality that can be used with core server functionality.
|
|
228
|
+
|
|
229
|
+
Module support singleton connection which is using `AYON_SERVER_URL` and `AYON_API_KEY` environment variables as source for connection. The singleton connection is using `ServerAPI` object. There can be created multiple connection to different server at one time, for that purpose use `ServerAPIBase` object.
|
|
230
|
+
|
|
231
|
+
## Install
|
|
232
|
+
AYON python api is available on PyPi:
|
|
233
|
+
|
|
234
|
+
pip install ayon-python-api
|
|
235
|
+
|
|
236
|
+
For development purposes you may follow [build](#build-wheel) guide to build and install custom wheels.
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
## Cloning the repository
|
|
240
|
+
Repository does not have submodules or special cases. Clone is simple as:
|
|
241
|
+
|
|
242
|
+
git clone git@github.com:ynput/ayon-python-api.git
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
## Build wheel
|
|
246
|
+
For wheel build is required a `wheel` module from PyPi:
|
|
247
|
+
|
|
248
|
+
pip install wheel
|
|
249
|
+
|
|
250
|
+
Open terminal and change directory to ayon-python-api repository and build wheel:
|
|
251
|
+
|
|
252
|
+
cd <REPOSITORY ROOT>/ayon-python-api
|
|
253
|
+
python setup.py sdist bdist_wheel
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
Once finished a wheel should be created in `./dist/ayon_python_api-<VERSION>-py3-none-any`.
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
### Wheel installation
|
|
261
|
+
The wheel file can be used to install using pip:
|
|
262
|
+
|
|
263
|
+
pip install <REPOSITORY ROOT>/dist/ayon_python_api-<VERSION>-py3-none-any
|
|
264
|
+
|
|
265
|
+
If pip complain that `ayon-python-api` is already installed just uninstall existing one first:
|
|
266
|
+
|
|
267
|
+
pip uninstall ayon-python-api
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
## TODOs
|
|
271
|
+
- Find more suitable name of `ServerAPI` objects (right now is used `con` or `connection`)
|
|
272
|
+
- Add all available CRUD operation on entities using REST
|
|
273
|
+
- Add folder and task changes to operations
|
|
274
|
+
- Enhance entity hub
|
|
275
|
+
- Missing docstrings in EntityHub -> especially entity arguments are missing
|
|
276
|
+
- Better order of arguments for entity classes
|
|
277
|
+
- Move entity hub to first place
|
|
278
|
+
- Skip those which are invalid for the entity and fake it for base or remove it from base
|
|
279
|
+
- Entity hub should use operations session to do changes
|
|
280
|
+
- Entity hub could also handle 'subset', 'version' and 'representation' entities
|
|
281
|
+
- Missing 'statuses' on project
|
|
282
|
+
- Missing 'status' on folders
|
|
283
|
+
- Missing assignees on tasks
|
|
284
|
+
- Pass docstrings and arguments definitions from `ServerAPI` methods to global functions
|
|
285
|
+
- Split `ServerAPI` into smaller chunks (somehow), the class has 4k+ lines of code
|
|
286
|
+
- Add .pyi stub for ServerAPI
|
|
287
|
+
- Missing websockets connection
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
ayon_api/__init__.py,sha256=
|
|
2
|
-
ayon_api/_api.py,sha256=
|
|
1
|
+
ayon_api/__init__.py,sha256=vtgIZhv3yH3dBUQ_9w7oUqP10QYZX4PMAQRr29cjMpk,7380
|
|
2
|
+
ayon_api/_api.py,sha256=mKQxt6F-9SjMNR8milClPV5Xfpi5AV0fYtDN_FffHHU,30325
|
|
3
3
|
ayon_api/constants.py,sha256=BRhTb_yX_FaQIzeIIdUGh-fKXhiZJbFA0M_zvi9MKWQ,1755
|
|
4
4
|
ayon_api/entity_hub.py,sha256=UH1-aWqftdmZAQDGqsjhpvNwAP6_bTFUk-nC-RIraO4,59757
|
|
5
5
|
ayon_api/events.py,sha256=aJJbAZJ5t0t6x4VQMRfdmOGhIbiRFB0OTUGiKnasFGw,1415
|
|
@@ -7,12 +7,12 @@ ayon_api/exceptions.py,sha256=FHGlt6TyKNc0OC8H0zxoNIS4KljPExM2mgDpCh9cYiI,2691
|
|
|
7
7
|
ayon_api/graphql.py,sha256=4u2pSS85uDsoap0tOkAmi6KCjeKHKClH3Cd7AfY8vGM,25639
|
|
8
8
|
ayon_api/graphql_queries.py,sha256=1f_fAoV1d5rvrlbJ6IPbrcrU56jmrJ-1-ieCW-B5ac8,15583
|
|
9
9
|
ayon_api/operations.py,sha256=55NDgRPDhJ5faU0xUnqC2dktwx5ebJSfHkLmncismKg,19430
|
|
10
|
-
ayon_api/server_api.py,sha256=
|
|
10
|
+
ayon_api/server_api.py,sha256=lCb8CywIA1GVUNxbMutNQeb7VmJiE3cW_bveBXObKNU,187387
|
|
11
11
|
ayon_api/thumbnails.py,sha256=ofm6pBzGCMShryRUP76-qT9xJPtqRZn1kpoX7kVk_WA,6856
|
|
12
12
|
ayon_api/utils.py,sha256=YhQkEHCho1M0D5oQHz0gl3dad-jw5nWGnvOBtvCxVHM,11714
|
|
13
|
-
ayon_api/version.py,sha256=
|
|
14
|
-
ayon_python_api-0.
|
|
15
|
-
ayon_python_api-0.
|
|
16
|
-
ayon_python_api-0.
|
|
17
|
-
ayon_python_api-0.
|
|
18
|
-
ayon_python_api-0.
|
|
13
|
+
ayon_api/version.py,sha256=1SK8QpkzUGlNpe2t4Tg-hHU8GLp_IRePJHErWMLhWIc,74
|
|
14
|
+
ayon_python_api-0.3.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
15
|
+
ayon_python_api-0.3.1.dist-info/METADATA,sha256=sSUx0vmh1NQdeV_oMLS7l93yIbP9ESORpSPvf0oU_G8,16328
|
|
16
|
+
ayon_python_api-0.3.1.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
|
17
|
+
ayon_python_api-0.3.1.dist-info/top_level.txt,sha256=PKrQbX5Cz53_UmSTR_nIySnBkGyHcBTS88SCw9tuVlc,9
|
|
18
|
+
ayon_python_api-0.3.1.dist-info/RECORD,,
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: ayon-python-api
|
|
3
|
-
Version: 0.2.2
|
|
4
|
-
Summary: AYON Python API
|
|
5
|
-
Home-page: https://github.com/ynput/ayon-python-api
|
|
6
|
-
Author: ynput.io
|
|
7
|
-
Author-email: info@ynput.io
|
|
8
|
-
License: Apache License (2.0)
|
|
9
|
-
Keywords: AYON,ynput,OpenPype,vfx
|
|
10
|
-
Classifier: Development Status :: 3 - Alpha
|
|
11
|
-
Classifier: Programming Language :: Python
|
|
12
|
-
Classifier: Programming Language :: Python :: 2
|
|
13
|
-
Classifier: Programming Language :: Python :: 3
|
|
14
|
-
Description-Content-Type: text/markdown
|
|
15
|
-
License-File: LICENSE
|
|
16
|
-
Requires-Dist: requests (>=2.27.1)
|
|
17
|
-
Requires-Dist: six (>=1.15)
|
|
18
|
-
Requires-Dist: Unidecode (>=1.2.0)
|
|
19
|
-
Requires-Dist: appdirs (<2,>=1)
|
|
20
|
-
|
|
21
|
-
# AYON server API
|
|
22
|
-
Python client for connection server. Client must be (at least for some time) Python 2 compatible because will be used in DCC that are "older".
|
|
23
|
-
|
|
24
|
-
AYON Python api should support connection to server with raw REST functions and prepared functionality for work with entities. Must not contain only functionality that can be used with core server functionality.
|
|
25
|
-
|
|
26
|
-
Module support singleton connection which is using `AYON_SERVER_URL` and `AYON_API_KEY` environment variables as source for connection. The singleton connection is using `ServerAPI` object. There can be created multiple connection to different server at one time, for that purpose use `ServerAPIBase` object.
|
|
27
|
-
|
|
28
|
-
## Install
|
|
29
|
-
AYON python api is available on PyPi:
|
|
30
|
-
|
|
31
|
-
pip install ayon-python-api
|
|
32
|
-
|
|
33
|
-
For development purposes you may follow [build](#build-wheel) guide to build and install custom wheels.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
## Cloning the repository
|
|
37
|
-
Repository does not have submodules or special cases. Clone is simple as:
|
|
38
|
-
|
|
39
|
-
git clone git@github.com:ynput/ayon-python-api.git
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
## Build wheel
|
|
43
|
-
For wheel build is required a `wheel` module from PyPi:
|
|
44
|
-
|
|
45
|
-
pip install wheel
|
|
46
|
-
|
|
47
|
-
Open terminal and change directory to ayon-python-api repository and build wheel:
|
|
48
|
-
|
|
49
|
-
cd <REPOSITORY ROOT>/ayon-python-api
|
|
50
|
-
python setup.py sdist bdist_wheel
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
Once finished a wheel should be created in `./dist/ayon_python_api-<VERSION>-py3-none-any`.
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
### Wheel installation
|
|
58
|
-
The wheel file can be used to install using pip:
|
|
59
|
-
|
|
60
|
-
pip install <REPOSITORY ROOT>/dist/ayon_python_api-<VERSION>-py3-none-any
|
|
61
|
-
|
|
62
|
-
If pip complain that `ayon-python-api` is already installed just uninstall existing one first:
|
|
63
|
-
|
|
64
|
-
pip uninstall ayon-python-api
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
## TODOs
|
|
68
|
-
- Find more suitable name of `ServerAPI` objects (right now is used `con` or `connection`)
|
|
69
|
-
- Add all available CRUD operation on entities using REST
|
|
70
|
-
- Add folder and task changes to operations
|
|
71
|
-
- Enhance entity hub
|
|
72
|
-
- Missing docstrings in EntityHub -> especially entity arguments are missing
|
|
73
|
-
- Better order of arguments for entity classes
|
|
74
|
-
- Move entity hub to first place
|
|
75
|
-
- Skip those which are invalid for the entity and fake it for base or remove it from base
|
|
76
|
-
- Entity hub should use operations session to do changes
|
|
77
|
-
- Entity hub could also handle 'subset', 'version' and 'representation' entities
|
|
78
|
-
- Missing 'statuses' on project
|
|
79
|
-
- Missing 'status' on folders
|
|
80
|
-
- Missing assignees on tasks
|
|
81
|
-
- Pass docstrings and arguments definitions from `ServerAPI` methods to global functions
|
|
82
|
-
- Split `ServerAPI` into smaller chunks (somehow), the class has 4k+ lines of code
|
|
83
|
-
- Add .pyi stub for ServerAPI
|
|
84
|
-
- Missing websockets connection
|
|
File without changes
|
|
File without changes
|
|
File without changes
|