malevich-coretools 0.3.30__tar.gz → 0.3.31__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.

Potentially problematic release.


This version of malevich-coretools might be problematic. Click here for more details.

Files changed (37) hide show
  1. {malevich_coretools-0.3.30/malevich_coretools.egg-info → malevich_coretools-0.3.31}/PKG-INFO +1 -1
  2. malevich_coretools-0.3.31/VERSION +1 -0
  3. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/malevich_coretools/abstract/abstract.py +11 -0
  4. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/malevich_coretools/funcs/funcs.py +40 -0
  5. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/malevich_coretools/funcs/helpers.py +39 -2
  6. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/malevich_coretools/secondary/const.py +12 -0
  7. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/malevich_coretools/utils.py +230 -0
  8. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31/malevich_coretools.egg-info}/PKG-INFO +1 -1
  9. malevich_coretools-0.3.30/VERSION +0 -1
  10. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/LICENSE +0 -0
  11. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/MANIFEST.in +0 -0
  12. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/README.md +0 -0
  13. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/malevich_coretools/__init__.py +0 -0
  14. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/malevich_coretools/abstract/__init__.py +0 -0
  15. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/malevich_coretools/abstract/pipeline.py +0 -0
  16. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/malevich_coretools/abstract/statuses.py +0 -0
  17. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/malevich_coretools/admin/__init__.py +0 -0
  18. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/malevich_coretools/admin/utils.py +0 -0
  19. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/malevich_coretools/batch/__init__.py +0 -0
  20. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/malevich_coretools/batch/utils.py +0 -0
  21. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/malevich_coretools/funcs/__init__.py +0 -0
  22. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/malevich_coretools/funcs/checks.py +0 -0
  23. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/malevich_coretools/secondary/__init__.py +0 -0
  24. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/malevich_coretools/secondary/config.py +0 -0
  25. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/malevich_coretools/secondary/helpers.py +0 -0
  26. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/malevich_coretools/secondary/kafka_utils.py +0 -0
  27. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/malevich_coretools/tools/__init__.py +0 -0
  28. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/malevich_coretools/tools/abstract.py +0 -0
  29. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/malevich_coretools/tools/vast.py +0 -0
  30. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/malevich_coretools.egg-info/SOURCES.txt +0 -0
  31. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/malevich_coretools.egg-info/dependency_links.txt +0 -0
  32. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/malevich_coretools.egg-info/requires.txt +0 -0
  33. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/malevich_coretools.egg-info/top_level.txt +0 -0
  34. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/pyproject.toml +0 -0
  35. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/requirements.txt +0 -0
  36. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/setup.cfg +0 -0
  37. {malevich_coretools-0.3.30 → malevich_coretools-0.3.31}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: malevich-coretools
3
- Version: 0.3.30
3
+ Version: 0.3.31
4
4
  Author: Andrew Pogrebnoj
5
5
  Author-email: andrew@onjulius.co
6
6
  License-File: LICENSE
@@ -0,0 +1 @@
1
+ 0.3.31
@@ -604,3 +604,14 @@ class LimitsScope(BaseModel): # for superuser/admin
604
604
  assetsLimit: Optional[int] = None
605
605
  allowCommonGpu: Optional[bool] = None
606
606
  gpuDiskMax: Optional[int] = None
607
+
608
+
609
+ class UserAnalytics(BaseModel):
610
+ name: str
611
+ data: Dict[str, Any]
612
+ timestamp: Optional[str] = None
613
+ id: Optional[str] = None
614
+
615
+
616
+ class UserAnalyticsBatch(BaseModel):
617
+ data: List[UserAnalytics]
@@ -92,6 +92,10 @@ def post_collections_data(data: DocsDataCollection, wait: bool=True, *args, **kw
92
92
  return send_to_core_modify(COLLECTIONS_DATA(wait), data, *args, **kwargs)
93
93
 
94
94
 
95
+ def post_collections_data_id(id: str, data: DocsDataCollection, wait: bool=True, *args, **kwargs) -> Alias.Id:
96
+ return send_to_core_modify(COLLECTIONS_DATA_ID(id, wait), data, *args, **kwargs)
97
+
98
+
95
99
  def post_collections_id_add(id: str, data: DocsCollectionChange, wait: bool, *args, **kwargs) -> Alias.Info:
96
100
  return send_to_core_modify(COLLECTIONS_ID_ADD(id, wait), data, *args, **kwargs)
97
101
 
@@ -386,6 +390,10 @@ def get_userApps_mapIds(*args, **kwargs) -> ResultOwnAndSharedIdsMap:
386
390
  return model_from_json(send_to_core_get(USER_APPS_MAP_IDS, *args, **kwargs), ResultOwnAndSharedIdsMap)
387
391
 
388
392
 
393
+ def get_userApps_mapId(id, *args, **kwargs) -> Alias.Id:
394
+ return send_to_core_get(USER_APPS_MAP_ID(id), is_text=True, *args, **kwargs)
395
+
396
+
389
397
  def get_userApps_id(id: str, *args, **kwargs) -> UserApp:
390
398
  return model_from_json(send_to_core_get(USER_APPS_ID(id, None), *args, **kwargs), UserApp)
391
399
 
@@ -424,6 +432,10 @@ def get_userTasks_mapIds(*args, **kwargs) -> ResultIdsMap:
424
432
  return model_from_json(send_to_core_get(USER_TASKS_MAP_IDS, *args, **kwargs), ResultIdsMap)
425
433
 
426
434
 
435
+ def get_userTasks_mapId(id: str, *args, **kwargs) -> Alias.Id:
436
+ return send_to_core_get(USER_TASKS_MAP_ID(id), is_text=True, *args, **kwargs)
437
+
438
+
427
439
  def get_userTasks_id(id: str, *args, **kwargs) -> UserTask:
428
440
  return model_from_json(send_to_core_get(USER_TASKS_ID(id, None), *args, **kwargs), UserTask)
429
441
 
@@ -462,6 +474,10 @@ def get_userPipelines_mapIds(*args, **kwargs) -> ResultIdsMap:
462
474
  return model_from_json(send_to_core_get(USER_PIPELINES_MAP_IDS, *args, **kwargs), ResultIdsMap)
463
475
 
464
476
 
477
+ def get_userPipelines_mapId(id: str, *args, **kwargs) -> Alias.Id:
478
+ return send_to_core_get(USER_PIPELINES_MAP_ID(id), is_text=True, *args, **kwargs)
479
+
480
+
465
481
  def get_userPipelines_id(id: str, *args, **kwargs) -> Pipeline:
466
482
  return model_from_json(send_to_core_get(USER_PIPELINES_ID(id, None), *args, **kwargs), Pipeline)
467
483
 
@@ -500,6 +516,10 @@ def get_userCfgs_mapIds(*args, **kwargs) -> ResultIdsMap:
500
516
  return model_from_json(send_to_core_get(USER_CFGS_MAP_IDS, *args, **kwargs), ResultIdsMap)
501
517
 
502
518
 
519
+ def get_userCfgs_mapId(id: str, *args, **kwargs) -> Alias.Id:
520
+ return send_to_core_get(USER_CFGS_MAP_ID(id), is_text=True, *args, **kwargs)
521
+
522
+
503
523
  def get_userCfgs_id(id: str, *args, **kwargs) -> ResultUserCfg:
504
524
  return model_from_json(send_to_core_get(USER_CFGS_ID(id, None), *args, **kwargs), ResultUserCfg)
505
525
 
@@ -716,6 +736,26 @@ def post_handler_url(url: Optional[str], wait: bool, *args, **kwargs) -> Alias.I
716
736
  return send_to_core_modify(HANDLER_URL(url, wait), *args, **kwargs)
717
737
 
718
738
 
739
+ def get_analytics(*args, **kwargs) -> UserAnalyticsBatch:
740
+ return model_from_json(send_to_core_get(ANALYTICS(None), *args, **kwargs), UserAnalyticsBatch)
741
+
742
+
743
+ def get_analytics_by_id(id: str, *args, **kwargs) -> UserAnalytics:
744
+ return model_from_json(send_to_core_get(ANALYTICS_ID(id, None), *args, **kwargs), UserAnalytics)
745
+
746
+
747
+ def get_analytics_by_name(name: str, *args, **kwargs) -> UserAnalyticsBatch:
748
+ return model_from_json(send_to_core_get(ANALYTICS_NAME(name, None), *args, **kwargs), UserAnalyticsBatch)
749
+
750
+
751
+ def post_analytics(data: UserAnalytics, wait: bool, *args, **kwargs) -> Alias.Id:
752
+ return send_to_core_modify(ANALYTICS(wait), data, *args, **kwargs)
753
+
754
+
755
+ def post_analytics_many(data: UserAnalyticsBatch, wait: bool, *args, **kwargs) -> ResultIds:
756
+ return model_from_json(send_to_core_modify(ANALYTICS_MANY(wait), data, *args, **kwargs), ResultIds)
757
+
758
+
719
759
  async def kafka_send(data: KafkaMsg, *args, **kwargs) -> Union[Alias.Info, KafkaMsg]:
720
760
  result = await send_to_core_post_async(KAFKA_SEND, data, *args, **kwargs)
721
761
  try:
@@ -21,10 +21,13 @@ from malevich_coretools.abstract.abstract import (
21
21
  )
22
22
  from malevich_coretools.batch import Batcher
23
23
  from malevich_coretools.funcs.checks import check_profile_mode
24
- from malevich_coretools.funcs.funcs import post_collections_data
24
+ from malevich_coretools.funcs.funcs import (
25
+ post_collections_data,
26
+ post_collections_data_id,
27
+ )
25
28
  from malevich_coretools.secondary import Config, to_json
26
29
 
27
- __all__ = ["create_collection_from_file_df", "raw_collection_from_df", "raw_collection_from_file", "create_collection_from_df", "create_app_settings", "create_user_config", "create_task_component", "create_task_policy", "create_restrictions", "create_run_settings", "create_endpoint_override", "create_cfg_struct"]
30
+ __all__ = ["create_collection_from_file_df", "update_collection_from_file_df", "raw_collection_from_df", "raw_collection_from_file", "create_collection_from_df", "update_collection_from_df", "create_app_settings", "create_user_config", "create_task_component", "create_task_policy", "create_restrictions", "create_run_settings", "create_endpoint_override", "create_cfg_struct"]
28
31
 
29
32
 
30
33
  def create_collection_from_file_df(
@@ -43,6 +46,23 @@ def create_collection_from_file_df(
43
46
  return create_collection_from_df(data, name=file, metadata=metadata, *args, **kwargs)
44
47
 
45
48
 
49
+ def update_collection_from_file_df(
50
+ id: str,
51
+ file: str,
52
+ name: Optional[str],
53
+ metadata: Optional[Union[Dict[str, Any], str]],
54
+ *args,
55
+ **kwargs
56
+ ) -> Alias.Id:
57
+ try:
58
+ data = pd.read_csv(file)
59
+ except pd.errors.EmptyDataError:
60
+ data = pd.DataFrame()
61
+ if name is None:
62
+ name = file
63
+ return update_collection_from_df(id, data, name=file, metadata=metadata, *args, **kwargs)
64
+
65
+
46
66
  def raw_collection_from_df(
47
67
  data: pd.DataFrame,
48
68
  name: Optional[str],
@@ -89,6 +109,23 @@ def create_collection_from_df(
89
109
  return post_collections_data(data, *args, **kwargs)
90
110
 
91
111
 
112
+ def update_collection_from_df(
113
+ id: str,
114
+ data: pd.DataFrame,
115
+ name: Optional[str],
116
+ metadata: Optional[Union[Dict[str, Any], str]],
117
+ batcher: Optional[Batcher] = None,
118
+ *args,
119
+ **kwargs
120
+ ) -> Alias.Id:
121
+ if batcher is None:
122
+ batcher = Config.BATCHER
123
+ data = raw_collection_from_df(data, name, metadata)
124
+ if batcher is not None:
125
+ return batcher.add("postCollectionByDocsAndId", data=data, vars={"id": id})
126
+ return post_collections_data_id(id, data, *args, **kwargs)
127
+
128
+
92
129
  def create_app_settings(
93
130
  app_id: str,
94
131
  task_id: Optional[str] = None,
@@ -55,6 +55,7 @@ COLLECTIONS_ID_ADD = lambda id, wait: with_wait(f"{COLLECTIONS_MAIN}/{urllib.par
55
55
  COLLECTIONS_ID_COPY = lambda id, full_copy, wait: with_key_values(f"{COLLECTIONS_MAIN}/{urllib.parse.quote(str(id), safe='')}/copy", {"wait": None if wait is None else bool_to_str(wait), "fullCopy": None if full_copy is None else bool_to_str(full_copy)})
56
56
  COLLECTIONS_ID_DEL = lambda id, wait: with_wait(f"{COLLECTIONS_MAIN}/{urllib.parse.quote(str(id), safe='')}/del", wait)
57
57
  COLLECTIONS_DATA = lambda wait: with_wait(f"{COLLECTIONS_MAIN}/data", wait)
58
+ COLLECTIONS_DATA_ID = lambda id, wait: with_wait(f"{COLLECTIONS_MAIN}/data/{urllib.parse.quote(str(id), safe='')}", wait)
58
59
  COLLECTIONS_APPLY_SCHEME = lambda id, wait: with_wait(f"{COLLECTIONS_MAIN}/{urllib.parse.quote(str(id), safe='')}/applyScheme", wait)
59
60
  COLLECTIONS_FIX_SCHEME = lambda id, wait: with_wait(f"{COLLECTIONS_MAIN}/{urllib.parse.quote(str(id), safe='')}/fixScheme", wait)
60
61
  COLLECTIONS_UNFIX_SCHEME = lambda id, wait: with_wait(f"{COLLECTIONS_MAIN}/{urllib.parse.quote(str(id), safe='')}/unfixScheme", wait)
@@ -115,6 +116,7 @@ USER_APPS_MAIN = f"{API_VERSION}/userApps"
115
116
  USER_APPS = lambda wait: with_wait(f"{USER_APPS_MAIN}/", wait)
116
117
  USER_APPS_REAL_IDS = f"{USER_APPS_MAIN}/realIds"
117
118
  USER_APPS_MAP_IDS = f"{USER_APPS_MAIN}/mapIds"
119
+ USER_APPS_MAP_ID = lambda id: f"{USER_APPS_MAIN}/mapIds/{urllib.parse.quote(str(id), safe='')}"
118
120
  USER_APPS_ID = lambda id, wait: with_wait(f"{USER_APPS_MAIN}/{urllib.parse.quote(str(id), safe='')}", wait)
119
121
  USER_APPS_REAL_ID = lambda id: f"{USER_APPS_MAIN}/realIds/{urllib.parse.quote(str(id), safe='')}"
120
122
 
@@ -123,6 +125,7 @@ USER_TASKS_MAIN = f"{API_VERSION}/userTasks"
123
125
  USER_TASKS = lambda wait: with_wait(f"{USER_TASKS_MAIN}/", wait)
124
126
  USER_TASKS_REAL_IDS = f"{USER_TASKS_MAIN}/realIds"
125
127
  USER_TASKS_MAP_IDS = f"{USER_TASKS_MAIN}/mapIds"
128
+ USER_TASKS_MAP_ID = lambda id: f"{USER_TASKS_MAIN}/mapIds/{urllib.parse.quote(str(id), safe='')}"
126
129
  USER_TASKS_ID = lambda id, wait: with_wait(f"{USER_TASKS_MAIN}/{urllib.parse.quote(str(id), safe='')}", wait)
127
130
  USER_TASKS_REAL_ID = lambda id: f"{USER_TASKS_MAIN}/realIds/{urllib.parse.quote(str(id), safe='')}"
128
131
 
@@ -131,6 +134,7 @@ USER_PIPELINES_MAIN = f"{API_VERSION}/userPipelines"
131
134
  USER_PIPELINES = lambda wait: with_wait(f"{USER_PIPELINES_MAIN}/", wait)
132
135
  USER_PIPELINES_REAL_IDS = f"{USER_PIPELINES_MAIN}/realIds"
133
136
  USER_PIPELINES_MAP_IDS = f"{USER_PIPELINES_MAIN}/mapIds"
137
+ USER_PIPELINES_MAP_ID = lambda id: f"{USER_PIPELINES_MAIN}/mapIds/{urllib.parse.quote(str(id), safe='')}"
134
138
  USER_PIPELINES_ID = lambda id, wait: with_wait(f"{USER_PIPELINES_MAIN}/{urllib.parse.quote(str(id), safe='')}", wait)
135
139
  USER_PIPELINES_REAL_ID = lambda id: f"{USER_PIPELINES_MAIN}/realIds/{urllib.parse.quote(str(id), safe='')}"
136
140
 
@@ -139,6 +143,7 @@ USER_CFGS_MAIN = f"{API_VERSION}/userCfgs"
139
143
  USER_CFGS = lambda wait: with_wait(f"{USER_CFGS_MAIN}/", wait)
140
144
  USER_CFGS_REAL_IDS = f"{USER_CFGS_MAIN}/realIds"
141
145
  USER_CFGS_MAP_IDS = f"{USER_CFGS_MAIN}/mapIds"
146
+ USER_CFGS_MAP_ID = lambda id: f"{USER_CFGS_MAIN}/mapIds/{urllib.parse.quote(str(id), safe='')}"
142
147
  USER_CFGS_ID = lambda id, wait: with_wait(f"{USER_CFGS_MAIN}/{urllib.parse.quote(str(id), safe='')}", wait)
143
148
  USER_CFGS_REAL_ID = lambda id: f"{USER_CFGS_MAIN}/realIds/{urllib.parse.quote(str(id), safe='')}"
144
149
 
@@ -192,6 +197,13 @@ LIMITS_USER = lambda wait: with_wait(f"{LIMITS_MAIN}/user", wait)
192
197
  HANDLER_URL_MAIN = f"{API_VERSION}/handlerUrls"
193
198
  HANDLER_URL = lambda url, wait: with_key_values(f"{HANDLER_URL_MAIN}/", {"url": url, "wait": bool_to_str(wait)})
194
199
 
200
+ ## AnalyticsController
201
+ ANALYTICS_MAIN = f"{API_VERSION}/analytics"
202
+ ANALYTICS = lambda wait: with_wait(f"{ANALYTICS_MAIN}/", wait)
203
+ ANALYTICS_MANY = lambda wait: with_wait(f"{ANALYTICS_MAIN}/many", wait)
204
+ ANALYTICS_ID = lambda id, wait: with_wait(f"{ANALYTICS_MAIN}/{id}", wait)
205
+ ANALYTICS_NAME = lambda name, wait: with_wait(f"{ANALYTICS_MAIN}/name/{name}", wait)
206
+
195
207
  ### Kafka
196
208
  KAFKA_SEND = f"{MANAGER_MAIN}/kafkaMsg"
197
209
 
@@ -456,6 +456,32 @@ def create_collection_by_docs(
456
456
  )
457
457
 
458
458
 
459
+ def update_collection_by_docs(
460
+ id: str,
461
+ docs: List[Alias.Json],
462
+ name: Optional[str] = None,
463
+ metadata: Optional[str] = None,
464
+ wait: bool = True,
465
+ *,
466
+ auth: Optional[AUTH] = None,
467
+ conn_url: Optional[str] = None,
468
+ batcher: Optional[Batcher] = None,
469
+ ) -> Alias.Id:
470
+ """update collection by `id` with `docs`, return `id` """
471
+ if batcher is None:
472
+ batcher = Config.BATCHER
473
+ data = DocsDataCollection(data=docs, name=name, metadata=metadata)
474
+ if batcher is not None:
475
+ return batcher.add("postCollectionByDocsAndId", data=data, vars={"id": id})
476
+ return f.post_collections_data_id(
477
+ id,
478
+ data,
479
+ wait=wait,
480
+ auth=auth,
481
+ conn_url=conn_url,
482
+ )
483
+
484
+
459
485
  def add_to_collection(
460
486
  id: str,
461
487
  ids: List[str],
@@ -1542,6 +1568,21 @@ def get_apps_map(
1542
1568
  return f.get_userApps_mapIds(auth=auth, conn_url=conn_url)
1543
1569
 
1544
1570
 
1571
+ def get_app_map(
1572
+ id: str,
1573
+ *,
1574
+ auth: Optional[AUTH] = None,
1575
+ conn_url: Optional[str] = None,
1576
+ batcher: Optional[Batcher] = None,
1577
+ ) -> Alias.Id:
1578
+ """return real id by app id for current user"""
1579
+ if batcher is None:
1580
+ batcher = Config.BATCHER
1581
+ if batcher is not None:
1582
+ return batcher.add("getAppsMapIdsById", vars={"id": id})
1583
+ return f.get_userApps_mapId(id, auth=auth, conn_url=conn_url)
1584
+
1585
+
1545
1586
  def get_app(
1546
1587
  id: str,
1547
1588
  *,
@@ -1754,6 +1795,21 @@ def get_tasks_map(
1754
1795
  return f.get_userTasks_mapIds(auth=auth, conn_url=conn_url)
1755
1796
 
1756
1797
 
1798
+ def get_task_map(
1799
+ id: str,
1800
+ *,
1801
+ auth: Optional[AUTH] = None,
1802
+ conn_url: Optional[str] = None,
1803
+ batcher: Optional[Batcher] = None,
1804
+ ) -> Alias.Id:
1805
+ """return real id by task id for current user"""
1806
+ if batcher is None:
1807
+ batcher = Config.BATCHER
1808
+ if batcher is not None:
1809
+ return batcher.add("getTasksMapIdsById", vars={"id": id})
1810
+ return f.get_userTasks_mapId(id, auth=auth, conn_url=conn_url)
1811
+
1812
+
1757
1813
  def get_task(
1758
1814
  id: str,
1759
1815
  *,
@@ -1925,6 +1981,21 @@ def get_pipelines_map(
1925
1981
  return f.get_userPipelines_mapIds(auth=auth, conn_url=conn_url)
1926
1982
 
1927
1983
 
1984
+ def get_pipeline_map(
1985
+ id: str,
1986
+ *,
1987
+ auth: Optional[AUTH] = None,
1988
+ conn_url: Optional[str] = None,
1989
+ batcher: Optional[Batcher] = None,
1990
+ ) -> Alias.Id:
1991
+ """return real id by pipeline id for current user"""
1992
+ if batcher is None:
1993
+ batcher = Config.BATCHER
1994
+ if batcher is not None:
1995
+ return batcher.add("getPipelinesMapIdsById", vars={"id": id})
1996
+ return f.get_userPipelines_mapId(id, auth=auth, conn_url=conn_url)
1997
+
1998
+
1928
1999
  def get_pipeline(
1929
2000
  id: str,
1930
2001
  *,
@@ -2098,6 +2169,22 @@ def get_cfgs_map(
2098
2169
  return f.get_userCfgs_mapIds(auth=auth, conn_url=conn_url)
2099
2170
 
2100
2171
 
2172
+
2173
+ def get_cfg_map(
2174
+ id: str,
2175
+ *,
2176
+ auth: Optional[AUTH] = None,
2177
+ conn_url: Optional[str] = None,
2178
+ batcher: Optional[Batcher] = None,
2179
+ ) -> Alias.Id:
2180
+ """return real id by cfg id for current user"""
2181
+ if batcher is None:
2182
+ batcher = Config.BATCHER
2183
+ if batcher is not None:
2184
+ return batcher.add("getCfgsMapIdsById", vars={"id": id})
2185
+ return f.get_userCfgs_mapId(id, auth=auth, conn_url=conn_url)
2186
+
2187
+
2101
2188
  def get_cfg(
2102
2189
  id: str,
2103
2190
  *,
@@ -3211,6 +3298,115 @@ def update_user_handler_url(
3211
3298
  )
3212
3299
 
3213
3300
 
3301
+ # Analytics
3302
+
3303
+
3304
+ def get_analytics(
3305
+ *,
3306
+ auth: Optional[AUTH] = None,
3307
+ conn_url: Optional[str] = None,
3308
+ batcher: Optional[Batcher] = None,
3309
+ ) -> UserAnalyticsBatch:
3310
+ """return all analytics for current user """
3311
+ if batcher is None:
3312
+ batcher = Config.BATCHER
3313
+ if batcher is not None:
3314
+ return batcher.add("getAnalytics", result_model=UserAnalyticsBatch)
3315
+ return f.get_analytics(auth=auth, conn_url=conn_url)
3316
+
3317
+
3318
+ def get_analytics_by_id(
3319
+ id: str,
3320
+ *,
3321
+ auth: Optional[AUTH] = None,
3322
+ conn_url: Optional[str] = None,
3323
+ batcher: Optional[Batcher] = None,
3324
+ ) -> UserAnalytics:
3325
+ """return analytics by `id` """
3326
+ if batcher is None:
3327
+ batcher = Config.BATCHER
3328
+ if batcher is not None:
3329
+ return batcher.add("getAnalyticsById", vars={"id": id}, result_model=UserAnalytics)
3330
+ return f.get_analytics_by_id(id, auth=auth, conn_url=conn_url)
3331
+
3332
+
3333
+ def get_analytics_by_name(
3334
+ name: str,
3335
+ *,
3336
+ auth: Optional[AUTH] = None,
3337
+ conn_url: Optional[str] = None,
3338
+ batcher: Optional[Batcher] = None,
3339
+ ) -> UserAnalyticsBatch:
3340
+ """return analytics by `name` """
3341
+ if batcher is None:
3342
+ batcher = Config.BATCHER
3343
+ if batcher is not None:
3344
+ return batcher.add("getAnalyticsByName", vars={"name": name}, result_model=UserAnalyticsBatch)
3345
+ return f.get_analytics_by_name(name, auth=auth, conn_url=conn_url)
3346
+
3347
+
3348
+ def create_analytics(
3349
+ data: Dict[str, Any],
3350
+ name: str,
3351
+ timestamp: Optional[str] = None,
3352
+ wait: bool = True,
3353
+ *,
3354
+ auth: Optional[AUTH] = None,
3355
+ conn_url: Optional[str] = None,
3356
+ batcher: Optional[Batcher] = None,
3357
+ ) -> Alias.Id:
3358
+ """save analytics with `data`, `name` and `timestamp`, return `id` """
3359
+ if batcher is None:
3360
+ batcher = Config.BATCHER
3361
+ data = UserAnalytics(name=name, data=data, timestamp=timestamp)
3362
+ if batcher is not None:
3363
+ return batcher.add("postAnalytics", data=data)
3364
+ return f.post_analytics(
3365
+ data, wait=wait, auth=auth, conn_url=conn_url
3366
+ )
3367
+
3368
+
3369
+ def update_analytics(
3370
+ id: str,
3371
+ data: Dict[str, Any],
3372
+ name: str,
3373
+ timestamp: Optional[str] = None,
3374
+ wait: bool = True,
3375
+ *,
3376
+ auth: Optional[AUTH] = None,
3377
+ conn_url: Optional[str] = None,
3378
+ batcher: Optional[Batcher] = None,
3379
+ ) -> Alias.Id:
3380
+ """update analytics by `id` with `data`, `name` and `timestamp`, return `id` """
3381
+ if batcher is None:
3382
+ batcher = Config.BATCHER
3383
+ data = UserAnalytics(name=name, data=data, timestamp=timestamp, id=id)
3384
+ if batcher is not None:
3385
+ return batcher.add("postAnalytics", data=data)
3386
+ return f.post_analytics(
3387
+ data, wait=wait, auth=auth, conn_url=conn_url
3388
+ )
3389
+
3390
+
3391
+ def update_analytics_many(
3392
+ data: List[UserAnalytics],
3393
+ wait: bool = True,
3394
+ *,
3395
+ auth: Optional[AUTH] = None,
3396
+ conn_url: Optional[str] = None,
3397
+ batcher: Optional[Batcher] = None,
3398
+ ) -> ResultIds:
3399
+ """update analytics by list of UserAnalytics, return ResultIds """
3400
+ if batcher is None:
3401
+ batcher = Config.BATCHER
3402
+ data = UserAnalyticsBatch(data=data)
3403
+ if batcher is not None:
3404
+ return batcher.add("postAnalyticsMany", data=data, result_model=ResultIds)
3405
+ return f.post_analytics_many(
3406
+ data, wait=wait, auth=auth, conn_url=conn_url
3407
+ )
3408
+
3409
+
3214
3410
  # kafka
3215
3411
 
3216
3412
 
@@ -3271,6 +3467,23 @@ def create_collection_from_file(
3271
3467
  )
3272
3468
 
3273
3469
 
3470
+ def update_collection_from_file(
3471
+ id: str,
3472
+ filename: str,
3473
+ name: Optional[str] = None,
3474
+ metadata: Optional[Union[Dict[str, Any], str]] = None,
3475
+ *,
3476
+ auth: Optional[AUTH] = None,
3477
+ conn_url: Optional[str] = None,
3478
+ batcher: Optional[Batcher] = None,
3479
+ ) -> Alias.Id:
3480
+ """create collection\n
3481
+ return collection id"""
3482
+ return fh.update_collection_from_file_df(
3483
+ id, filename, name, metadata, auth=auth, conn_url=conn_url, batcher=batcher
3484
+ )
3485
+
3486
+
3274
3487
  def create_collection_from_df(
3275
3488
  data: pd.DataFrame,
3276
3489
  name: Optional[str] = None,
@@ -3287,6 +3500,23 @@ def create_collection_from_df(
3287
3500
  )
3288
3501
 
3289
3502
 
3503
+ def update_collection_from_df(
3504
+ id: str,
3505
+ data: pd.DataFrame,
3506
+ name: Optional[str] = None,
3507
+ metadata: Optional[Union[Dict[str, Any], str]] = None,
3508
+ *,
3509
+ auth: Optional[AUTH] = None,
3510
+ conn_url: Optional[str] = None,
3511
+ batcher: Optional[Batcher] = None,
3512
+ ) -> Alias.Id:
3513
+ """update collection by id\n
3514
+ return collection id"""
3515
+ return fh.update_collection_from_df(
3516
+ id, data, name, metadata, auth=auth, conn_url=conn_url, batcher=batcher
3517
+ )
3518
+
3519
+
3290
3520
  def get_collection_to_df(
3291
3521
  id: str,
3292
3522
  offset: int = 0,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: malevich-coretools
3
- Version: 0.3.30
3
+ Version: 0.3.31
4
4
  Author: Andrew Pogrebnoj
5
5
  Author-email: andrew@onjulius.co
6
6
  License-File: LICENSE
@@ -1 +0,0 @@
1
- 0.3.30