polyanalyst6api 0.35.2__tar.gz → 0.36.0__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.
- {polyanalyst6api-0.35.2 → polyanalyst6api-0.36.0}/PKG-INFO +6 -9
- {polyanalyst6api-0.35.2 → polyanalyst6api-0.36.0}/polyanalyst6api/__init__.py +1 -1
- {polyanalyst6api-0.35.2 → polyanalyst6api-0.36.0}/polyanalyst6api/api.py +9 -2
- {polyanalyst6api-0.35.2 → polyanalyst6api-0.36.0}/polyanalyst6api/project.py +39 -9
- {polyanalyst6api-0.35.2 → polyanalyst6api-0.36.0}/pyproject.toml +3 -7
- {polyanalyst6api-0.35.2 → polyanalyst6api-0.36.0}/LICENSE +0 -0
- {polyanalyst6api-0.35.2 → polyanalyst6api-0.36.0}/README.md +0 -0
- {polyanalyst6api-0.35.2 → polyanalyst6api-0.36.0}/polyanalyst6api/drive.py +0 -0
- {polyanalyst6api-0.35.2 → polyanalyst6api-0.36.0}/polyanalyst6api/exceptions.py +0 -0
- {polyanalyst6api-0.35.2 → polyanalyst6api-0.36.0}/polyanalyst6api/report.py +0 -0
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: polyanalyst6api
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.36.0
|
|
4
4
|
Summary: polyanalyst6api is a PolyAnalyst API client for Python.
|
|
5
|
-
Home-page: https://github.com/Megaputer/polyanalyst6api-py
|
|
6
5
|
License: MIT
|
|
6
|
+
License-File: LICENSE
|
|
7
7
|
Keywords: megaputer,polyanalyst,polyanalyst6api,api
|
|
8
8
|
Author: yatmanov
|
|
9
9
|
Author-email: yatmanov@megaputer.ru
|
|
10
|
-
Requires-Python: >=3.
|
|
10
|
+
Requires-Python: >=3.9,<4.0
|
|
11
11
|
Classifier: License :: OSI Approved :: MIT License
|
|
12
12
|
Classifier: Programming Language :: Python :: 3
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
15
13
|
Classifier: Programming Language :: Python :: 3.9
|
|
16
14
|
Classifier: Programming Language :: Python :: 3.10
|
|
17
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
18
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
19
17
|
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
19
|
Classifier: Topic :: Internet
|
|
21
20
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
21
|
Requires-Dist: pytus (>=0.2.1,<0.3.0)
|
|
23
|
-
Requires-Dist: requests (>=2.
|
|
24
|
-
Requires-Dist: urllib3 (==1.26.18) ; python_version == "3.7"
|
|
25
|
-
Requires-Dist: urllib3 ; python_version >= "3.8"
|
|
22
|
+
Requires-Dist: requests (>=2.32,<3.0)
|
|
26
23
|
Project-URL: Changelog, https://github.com/Megaputer/polyanalyst6api-py/blob/master/CHANGELOG.md
|
|
27
24
|
Project-URL: Documentation, https://polyanalyst6api-py.rtfd.io/
|
|
28
25
|
Project-URL: Repository, https://github.com/Megaputer/polyanalyst6api-py
|
|
@@ -204,7 +204,7 @@ class API:
|
|
|
204
204
|
project_space: Optional[str] = None,
|
|
205
205
|
on_conflict: str = 'Cancel',
|
|
206
206
|
wait: bool = False
|
|
207
|
-
|
|
207
|
+
) -> Union[str, Dict]:
|
|
208
208
|
"""
|
|
209
209
|
Import project from file on server file system.
|
|
210
210
|
|
|
@@ -254,11 +254,18 @@ class API:
|
|
|
254
254
|
if not wait:
|
|
255
255
|
return import_id
|
|
256
256
|
|
|
257
|
+
# Started,
|
|
258
|
+
# Unpacking,
|
|
259
|
+
# CheckingReferences,
|
|
260
|
+
# Error,
|
|
261
|
+
# Imported,
|
|
262
|
+
# Cancelled
|
|
263
|
+
|
|
257
264
|
while True:
|
|
258
265
|
time.sleep(1)
|
|
259
266
|
status = self.get_project_import_status(import_id)
|
|
260
267
|
# status has only empty state key when the server rebooted during the project import: T32492#776729
|
|
261
|
-
if status.get('state') in ('Error', 'Imported'):
|
|
268
|
+
if status.get('state') in ('Error', 'Imported', 'Cancelled'):
|
|
262
269
|
return status
|
|
263
270
|
|
|
264
271
|
def project(self, uuid: str) -> Project:
|
|
@@ -80,7 +80,7 @@ class Project:
|
|
|
80
80
|
task['startTime'] = datetime.datetime.utcfromtimestamp(task['startTime'] / 1000)
|
|
81
81
|
return json
|
|
82
82
|
|
|
83
|
-
def save(self) -> None:
|
|
83
|
+
def save(self, wait: bool = False) -> None: # TODO project/save/status do exist
|
|
84
84
|
"""Initiates saving of all changes that have been made in the project."""
|
|
85
85
|
self.api.post('project/save', json={'prjUUID': self.uuid})
|
|
86
86
|
|
|
@@ -277,6 +277,14 @@ class Project:
|
|
|
277
277
|
.. versionadded:: 0.31
|
|
278
278
|
"""
|
|
279
279
|
return self.api.get('project/status', params={'prjUUID': self.uuid})
|
|
280
|
+
|
|
281
|
+
def info(self):
|
|
282
|
+
"""This operation returns information about a project.
|
|
283
|
+
|
|
284
|
+
:return: project information
|
|
285
|
+
"""
|
|
286
|
+
return self.api.get('project/info', params={'prjUUID': self.uuid})
|
|
287
|
+
|
|
280
288
|
|
|
281
289
|
def unload(self, force_unload: bool = False) -> None:
|
|
282
290
|
"""
|
|
@@ -506,7 +514,7 @@ class Project:
|
|
|
506
514
|
Use :meth:`Project.get_execution_stats` instead.
|
|
507
515
|
"""
|
|
508
516
|
warnings.warn(
|
|
509
|
-
'Project.get_execution_statistics() is deprecated, use
|
|
517
|
+
'Project.get_execution_statistics() is deprecated, use Project.get_execution_stats() instead.',
|
|
510
518
|
DeprecationWarning,
|
|
511
519
|
stacklevel=2,
|
|
512
520
|
)
|
|
@@ -706,12 +714,18 @@ class DataSet:
|
|
|
706
714
|
|
|
707
715
|
return self._api.get('dataset/preview', params=params)
|
|
708
716
|
|
|
709
|
-
def iter_rows(
|
|
717
|
+
def iter_rows(
|
|
718
|
+
self,
|
|
719
|
+
start: int = 0,
|
|
720
|
+
stop: Optional[int] = None,
|
|
721
|
+
fetch_files: bool = False
|
|
722
|
+
) -> Iterator[Dict[str, JSON_VAL]]:
|
|
710
723
|
"""
|
|
711
724
|
Iterate over rows in dataset.
|
|
712
725
|
|
|
713
|
-
:param start:
|
|
714
|
-
:param stop:
|
|
726
|
+
:param start: starting row index. 0 by default (the first row)
|
|
727
|
+
:param stop: ending index. None by default, which means iterates to the last row
|
|
728
|
+
:param fetch_files: whatever to download file attachments as bytes. False by default
|
|
715
729
|
|
|
716
730
|
:raises: ValueError if `start` or `stop` is out of datasets' row range
|
|
717
731
|
|
|
@@ -734,8 +748,9 @@ class DataSet:
|
|
|
734
748
|
if not 0 <= start <= stop <= max_row:
|
|
735
749
|
raise ValueError(f'start and stop arguments must be within dataset row range: (0, {max_row})')
|
|
736
750
|
|
|
737
|
-
|
|
751
|
+
values = self._values(stop)
|
|
738
752
|
get_text = self._cell_text
|
|
753
|
+
get_file = self._binary_content
|
|
739
754
|
|
|
740
755
|
class RowIterator:
|
|
741
756
|
def __init__(self):
|
|
@@ -752,10 +767,10 @@ class DataSet:
|
|
|
752
767
|
columns = info.get('columnsInfo') or info['columns']
|
|
753
768
|
for column in columns:
|
|
754
769
|
if column['flags'].get('getTextAlways'):
|
|
755
|
-
|
|
770
|
+
_value = get_text(self.idx, column['id'])
|
|
756
771
|
# elif column['type'] == 'DateTime': # todo convert to python datetime?
|
|
757
772
|
else:
|
|
758
|
-
_value =
|
|
773
|
+
_value = values['table'][self.idx][column['id']]
|
|
759
774
|
if _value == 1e100:
|
|
760
775
|
_value = None
|
|
761
776
|
elif _value == 8e100:
|
|
@@ -763,7 +778,10 @@ class DataSet:
|
|
|
763
778
|
elif _value == -8e100:
|
|
764
779
|
_value = -math.inf
|
|
765
780
|
|
|
766
|
-
|
|
781
|
+
if fetch_files and str(column['id']) in values['binaryContent']:
|
|
782
|
+
_value = get_file(values['textIDs'][str(column['id'])][str(self.idx)], '_')
|
|
783
|
+
|
|
784
|
+
result[column['title']] = _value
|
|
767
785
|
|
|
768
786
|
self.idx += 1
|
|
769
787
|
return result
|
|
@@ -793,3 +811,15 @@ class DataSet:
|
|
|
793
811
|
'col': col,
|
|
794
812
|
},
|
|
795
813
|
)['text']
|
|
814
|
+
|
|
815
|
+
@retry_on_invalid_guid
|
|
816
|
+
def _binary_content(self, key: str, filename: str) -> bytes:
|
|
817
|
+
return self._api.request(
|
|
818
|
+
'dataset/get-binary-content',
|
|
819
|
+
method='GET',
|
|
820
|
+
params={
|
|
821
|
+
'wrapperGuid': self.guid,
|
|
822
|
+
'key': key,
|
|
823
|
+
'fileName': filename,
|
|
824
|
+
},
|
|
825
|
+
)[0].content
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "polyanalyst6api"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.36.0"
|
|
4
4
|
description = "polyanalyst6api is a PolyAnalyst API client for Python."
|
|
5
5
|
authors = ["yatmanov <yatmanov@megaputer.ru>"]
|
|
6
6
|
license = "MIT"
|
|
@@ -20,13 +20,9 @@ classifiers = [
|
|
|
20
20
|
"Changelog" = "https://github.com/Megaputer/polyanalyst6api-py/blob/master/CHANGELOG.md"
|
|
21
21
|
|
|
22
22
|
[tool.poetry.dependencies]
|
|
23
|
-
python = "^3.
|
|
24
|
-
requests = "^2.
|
|
23
|
+
python = "^3.9"
|
|
24
|
+
requests = "^2.32"
|
|
25
25
|
pytus = "^0.2.1"
|
|
26
|
-
urllib3 = [
|
|
27
|
-
{version = "1.26.18", python = "3.7"},
|
|
28
|
-
{version = "*", python = ">=3.8"}
|
|
29
|
-
]
|
|
30
26
|
|
|
31
27
|
[tool.poetry.group.test.dependencies]
|
|
32
28
|
pytest = "^7.4.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|