ayon-python-api 1.0.0rc2__tar.gz → 1.0.1__tar.gz

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.
Files changed (23) hide show
  1. {ayon-python-api-1.0.0rc2 → ayon-python-api-1.0.1}/PKG-INFO +2 -2
  2. {ayon-python-api-1.0.0rc2 → ayon-python-api-1.0.1}/ayon_api/__init__.py +0 -4
  3. {ayon-python-api-1.0.0rc2 → ayon-python-api-1.0.1}/ayon_api/_api.py +29 -35
  4. {ayon-python-api-1.0.0rc2 → ayon-python-api-1.0.1}/ayon_api/constants.py +12 -0
  5. {ayon-python-api-1.0.0rc2 → ayon-python-api-1.0.1}/ayon_api/entity_hub.py +105 -102
  6. {ayon-python-api-1.0.0rc2 → ayon-python-api-1.0.1}/ayon_api/exceptions.py +4 -1
  7. {ayon-python-api-1.0.0rc2 → ayon-python-api-1.0.1}/ayon_api/graphql.py +26 -28
  8. {ayon-python-api-1.0.0rc2 → ayon-python-api-1.0.1}/ayon_api/graphql_queries.py +6 -10
  9. {ayon-python-api-1.0.0rc2 → ayon-python-api-1.0.1}/ayon_api/operations.py +18 -22
  10. {ayon-python-api-1.0.0rc2 → ayon-python-api-1.0.1}/ayon_api/server_api.py +377 -442
  11. {ayon-python-api-1.0.0rc2 → ayon-python-api-1.0.1}/ayon_api/utils.py +31 -36
  12. {ayon-python-api-1.0.0rc2 → ayon-python-api-1.0.1}/ayon_api/version.py +1 -1
  13. {ayon-python-api-1.0.0rc2 → ayon-python-api-1.0.1}/ayon_python_api.egg-info/PKG-INFO +2 -2
  14. {ayon-python-api-1.0.0rc2 → ayon-python-api-1.0.1}/pyproject.toml +17 -4
  15. {ayon-python-api-1.0.0rc2 → ayon-python-api-1.0.1}/setup.py +1 -1
  16. {ayon-python-api-1.0.0rc2 → ayon-python-api-1.0.1}/LICENSE +0 -0
  17. {ayon-python-api-1.0.0rc2 → ayon-python-api-1.0.1}/README.md +0 -0
  18. {ayon-python-api-1.0.0rc2 → ayon-python-api-1.0.1}/ayon_api/events.py +0 -0
  19. {ayon-python-api-1.0.0rc2 → ayon-python-api-1.0.1}/ayon_python_api.egg-info/SOURCES.txt +0 -0
  20. {ayon-python-api-1.0.0rc2 → ayon-python-api-1.0.1}/ayon_python_api.egg-info/dependency_links.txt +0 -0
  21. {ayon-python-api-1.0.0rc2 → ayon-python-api-1.0.1}/ayon_python_api.egg-info/requires.txt +0 -0
  22. {ayon-python-api-1.0.0rc2 → ayon-python-api-1.0.1}/ayon_python_api.egg-info/top_level.txt +0 -0
  23. {ayon-python-api-1.0.0rc2 → ayon-python-api-1.0.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ayon-python-api
3
- Version: 1.0.0rc2
3
+ Version: 1.0.1
4
4
  Summary: AYON Python API
5
5
  Home-page: https://github.com/ynput/ayon-python-api
6
6
  Author: ynput.io
@@ -210,7 +210,7 @@ License: Apache License
210
210
  Project-URL: Repository, https://github.com/ynput/ayon-python-api
211
211
  Project-URL: Changelog, https://github.com/ynput/ayon-python-api/releases
212
212
  Keywords: AYON,ynput,OpenPype,vfx
213
- Classifier: Development Status :: 3 - Alpha
213
+ Classifier: Development Status :: 5 - Production/Stable
214
214
  Classifier: Programming Language :: Python
215
215
  Classifier: Programming Language :: Python :: 2
216
216
  Classifier: Programming Language :: Python :: 3
@@ -75,8 +75,6 @@ from ._api import (
75
75
  download_installer,
76
76
  upload_installer,
77
77
 
78
- get_dependencies_info,
79
- update_dependency_info,
80
78
  get_dependency_packages,
81
79
  create_dependency_package,
82
80
  update_dependency_package,
@@ -277,8 +275,6 @@ __all__ = (
277
275
  "download_installer",
278
276
  "upload_installer",
279
277
 
280
- "get_dependencies_info",
281
- "update_dependency_info",
282
278
  "get_dependency_packages",
283
279
  "create_dependency_package",
284
280
  "update_dependency_package",
@@ -56,8 +56,8 @@ class GlobalServerAPI(ServerAPI):
56
56
 
57
57
  If user is the same as current user and token is available the
58
58
  login is skipped.
59
- """
60
59
 
60
+ """
61
61
  previous_token = self._access_token
62
62
  super(GlobalServerAPI, self).login(username, password)
63
63
  if self.has_valid_token and previous_token != self._access_token:
@@ -78,8 +78,8 @@ class GlobalServerAPI(ServerAPI):
78
78
  Args:
79
79
  url (str): New server url.
80
80
  token (str): User's token.
81
- """
82
81
 
82
+ """
83
83
  os.environ[SERVER_URL_ENV_KEY] = url or ""
84
84
  os.environ[SERVER_API_ENV_KEY] = token or ""
85
85
 
@@ -89,8 +89,8 @@ class GlobalContext:
89
89
 
90
90
  Goal is to avoid create connection on import which can be dangerous in
91
91
  some cases.
92
- """
93
92
 
93
+ """
94
94
  _connection = None
95
95
 
96
96
  @classmethod
@@ -138,8 +138,8 @@ class ServiceContext:
138
138
  All what must be done is to call 'init_service' function/method. The
139
139
  arguments are for cases when the service is running in specific environment
140
140
  and their values are e.g. loaded from private file or for testing purposes.
141
- """
142
141
 
142
+ """
143
143
  token = None
144
144
  server_url = None
145
145
  addon_name = None
@@ -191,8 +191,8 @@ def init_service(*args, **kwargs):
191
191
 
192
192
  The service expect specific environment variables. The variables must all
193
193
  be set to make the connection work as a service.
194
- """
195
194
 
195
+ """
196
196
  ServiceContext.init_service(*args, **kwargs)
197
197
 
198
198
 
@@ -204,8 +204,8 @@ def get_service_addon_name():
204
204
 
205
205
  Returns:
206
206
  Union[str, None]: Name of addon or None.
207
- """
208
207
 
208
+ """
209
209
  return ServiceContext.addon_name
210
210
 
211
211
 
@@ -217,8 +217,8 @@ def get_service_addon_version():
217
217
 
218
218
  Returns:
219
219
  Union[str, None]: Version of addon or None.
220
- """
221
220
 
221
+ """
222
222
  return ServiceContext.addon_version
223
223
 
224
224
 
@@ -230,29 +230,34 @@ def get_service_name():
230
230
 
231
231
  Returns:
232
232
  Union[str, None]: Name of service if service was registered.
233
+
233
234
  """
234
-
235
235
  return ServiceContext.service_name
236
236
 
237
237
 
238
- def get_service_addon_settings():
238
+ def get_service_addon_settings(project_name=None):
239
239
  """Addon settings of service which initialized service.
240
240
 
241
241
  Service context must be initialized to be able to use this function. Call
242
242
  'init_service' on you service start to do so.
243
243
 
244
+ Args:
245
+ project_name (Optional[str]): Project name.
246
+
244
247
  Returns:
245
248
  Dict[str, Any]: Addon settings.
246
249
 
247
250
  Raises:
248
251
  ValueError: When service was not initialized.
249
- """
250
252
 
253
+ """
251
254
  addon_name = get_service_addon_name()
252
255
  addon_version = get_service_addon_version()
253
256
  if addon_name is None or addon_version is None:
254
257
  raise ValueError("Service is not initialized")
255
- return get_addon_settings(addon_name, addon_version)
258
+ return get_addon_settings(
259
+ addon_name, addon_version, project_name=project_name
260
+ )
256
261
 
257
262
 
258
263
  def is_connection_created():
@@ -260,8 +265,8 @@ def is_connection_created():
260
265
 
261
266
  Returns:
262
267
  bool: True if connection was connected.
263
- """
264
268
 
269
+ """
265
270
  return GlobalContext.is_connection_created()
266
271
 
267
272
 
@@ -274,14 +279,13 @@ def create_connection(site_id=None, client_version=None):
274
279
 
275
280
  Returns:
276
281
  GlobalServerAPI: Created connection.
277
- """
278
282
 
283
+ """
279
284
  return GlobalContext.create_connection(site_id, client_version)
280
285
 
281
286
 
282
287
  def close_connection():
283
288
  """Close global connection if is connected."""
284
-
285
289
  GlobalContext.close_connection()
286
290
 
287
291
 
@@ -293,8 +297,8 @@ def change_token(url, token):
293
297
  Args:
294
298
  url (str): Server url.
295
299
  token (str): API key token.
296
- """
297
300
 
301
+ """
298
302
  GlobalContext.change_token(url, token)
299
303
 
300
304
 
@@ -304,8 +308,8 @@ def set_environments(url, token):
304
308
  Args:
305
309
  url (Union[str, None]): Url to server or None to unset environments.
306
310
  token (Union[str, None]): API key token to be used for connection.
307
- """
308
311
 
312
+ """
309
313
  GlobalServerAPI.set_environments(url, token)
310
314
 
311
315
 
@@ -317,8 +321,8 @@ def get_server_api_connection():
317
321
 
318
322
  Returns:
319
323
  GlobalServerAPI: Object of connection to server.
320
- """
321
324
 
325
+ """
322
326
  return GlobalContext.get_server_api_connection()
323
327
 
324
328
 
@@ -334,8 +338,8 @@ def set_site_id(site_id):
334
338
 
335
339
  Args:
336
340
  site_id (Union[str, None]): Site id used in connection.
337
- """
338
341
 
342
+ """
339
343
  con = get_server_api_connection()
340
344
  con.set_site_id(site_id)
341
345
 
@@ -347,8 +351,8 @@ def get_client_version():
347
351
 
348
352
  Returns:
349
353
  str: Client version string used in connection.
350
- """
351
354
 
355
+ """
352
356
  con = get_server_api_connection()
353
357
  return con.get_client_version()
354
358
 
@@ -360,8 +364,8 @@ def set_client_version(client_version):
360
364
 
361
365
  Args:
362
366
  client_version (Union[str, None]): Client version string.
363
- """
364
367
 
368
+ """
365
369
  con = get_server_api_connection()
366
370
  con.set_client_version(client_version)
367
371
 
@@ -371,8 +375,8 @@ def get_default_settings_variant():
371
375
 
372
376
  Returns:
373
377
  Union[str, None]: name of variant or None.
374
- """
375
378
 
379
+ """
376
380
  con = get_server_api_connection()
377
381
  return con.get_default_settings_variant()
378
382
 
@@ -382,12 +386,12 @@ def set_default_settings_variant(variant):
382
386
 
383
387
  Note:
384
388
  It is recommended to set only 'production' or 'staging' variants
385
- as default variant.
389
+ as default variant.
386
390
 
387
391
  Args:
388
392
  variant (Union[str, None]): Settings variant name.
389
- """
390
393
 
394
+ """
391
395
  con = get_server_api_connection()
392
396
  return con.set_default_settings_variant(variant)
393
397
 
@@ -397,8 +401,8 @@ def get_sender():
397
401
 
398
402
  Returns:
399
403
  Union[str, None]: Sender name or None.
400
- """
401
404
 
405
+ """
402
406
  con = get_server_api_connection()
403
407
  return con.get_sender()
404
408
 
@@ -408,8 +412,8 @@ def set_sender(sender):
408
412
 
409
413
  Args:
410
414
  sender (Union[str, None]): Sender name or None.
411
- """
412
415
 
416
+ """
413
417
  con = get_server_api_connection()
414
418
  return con.set_sender(sender)
415
419
 
@@ -611,16 +615,6 @@ def upload_installer(*args, **kwargs):
611
615
 
612
616
 
613
617
  # Dependency packages
614
- def get_dependencies_info(*args, **kwargs):
615
- con = get_server_api_connection()
616
- return con.get_dependencies_info(*args, **kwargs)
617
-
618
-
619
- def update_dependency_info(*args, **kwargs):
620
- con = get_server_api_connection()
621
- return con.update_dependency_info(*args, **kwargs)
622
-
623
-
624
618
  def download_dependency_package(*args, **kwargs):
625
619
  con = get_server_api_connection()
626
620
  return con.download_dependency_package(*args, **kwargs)
@@ -146,3 +146,15 @@ DEFAULT_EVENT_FIELDS = {
146
146
  "updatedAt",
147
147
  "user",
148
148
  }
149
+
150
+ DEFAULT_LINK_FIELDS = {
151
+ "id",
152
+ "linkType",
153
+ "projectName",
154
+ "entityType",
155
+ "entityId",
156
+ "name",
157
+ "direction",
158
+ "description",
159
+ "author",
160
+ }