most-client 1.0.26__py3-none-any.whl → 1.0.28__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.
- most/api.py +7 -2
- most/async_api.py +7 -2
- most/types.py +10 -10
- {most_client-1.0.26.dist-info → most_client-1.0.28.dist-info}/METADATA +1 -1
- most_client-1.0.28.dist-info/RECORD +11 -0
- most_client-1.0.26.dist-info/RECORD +0 -11
- {most_client-1.0.26.dist-info → most_client-1.0.28.dist-info}/WHEEL +0 -0
- {most_client-1.0.26.dist-info → most_client-1.0.28.dist-info}/top_level.txt +0 -0
- {most_client-1.0.26.dist-info → most_client-1.0.28.dist-info}/zip-safe +0 -0
most/api.py
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
import io
|
2
2
|
import os
|
3
3
|
import uuid
|
4
|
+
from datetime import datetime, timezone
|
4
5
|
from pathlib import Path
|
5
6
|
from typing import Dict, List, Optional, Union
|
6
7
|
import json5
|
7
8
|
import httpx
|
8
|
-
from adaptix import Retort
|
9
|
+
from adaptix import Retort, loader
|
9
10
|
from pydub import AudioSegment
|
10
11
|
from most._constrants import DEFAULT_MAX_RETRIES, DEFAULT_RETRY_DELAY
|
11
12
|
from most.score_calculation import ScoreCalculation
|
@@ -22,7 +23,11 @@ from most.types import (
|
|
22
23
|
|
23
24
|
|
24
25
|
class MostClient(object):
|
25
|
-
retort = Retort(
|
26
|
+
retort = Retort(recipe=[
|
27
|
+
loader(int, lambda x: int(x)),
|
28
|
+
loader(float, lambda x: float(x)),
|
29
|
+
loader(datetime, lambda x: datetime.fromtimestamp(x).replace(tzinfo=timezone.utc)),
|
30
|
+
],)
|
26
31
|
|
27
32
|
def __init__(self,
|
28
33
|
client_id=None,
|
most/async_api.py
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
import io
|
2
2
|
import os
|
3
3
|
import uuid
|
4
|
+
from datetime import datetime, timezone
|
4
5
|
from pathlib import Path
|
5
6
|
from typing import Dict, List, Optional, Union
|
6
7
|
import httpx
|
7
8
|
import json5
|
8
|
-
from adaptix import Retort
|
9
|
+
from adaptix import Retort, loader
|
9
10
|
from pydub import AudioSegment
|
10
11
|
from most._constrants import DEFAULT_MAX_RETRIES
|
11
12
|
from most.score_calculation import ScoreCalculation
|
@@ -22,7 +23,11 @@ from most.types import (
|
|
22
23
|
|
23
24
|
|
24
25
|
class AsyncMostClient(object):
|
25
|
-
retort = Retort(
|
26
|
+
retort = Retort(recipe=[
|
27
|
+
loader(int, lambda x: int(x)),
|
28
|
+
loader(float, lambda x: float(x)),
|
29
|
+
loader(datetime, lambda x: datetime.fromtimestamp(x).replace(tzinfo=timezone.utc)),
|
30
|
+
])
|
26
31
|
|
27
32
|
def __init__(self,
|
28
33
|
client_id=None,
|
most/types.py
CHANGED
@@ -30,8 +30,8 @@ class Text(DataClassJsonMixin):
|
|
30
30
|
@dataclass
|
31
31
|
class SubcolumnResult(DataClassJsonMixin):
|
32
32
|
name: str
|
33
|
-
score: Optional[int]
|
34
|
-
description: str
|
33
|
+
score: Optional[int] = None
|
34
|
+
description: str = ""
|
35
35
|
|
36
36
|
|
37
37
|
@dataclass_json
|
@@ -73,11 +73,11 @@ class JobStatus(DataClassJsonMixin):
|
|
73
73
|
@dataclass
|
74
74
|
class Result(DataClassJsonMixin):
|
75
75
|
id: str
|
76
|
-
text: Optional[str]
|
77
|
-
url: Optional[str]
|
78
|
-
results: Optional[List[ColumnResult]]
|
79
|
-
created_at: Optional[datetime]
|
80
|
-
applied_at: Optional[datetime]
|
76
|
+
text: Optional[str] = None
|
77
|
+
url: Optional[str] = None
|
78
|
+
results: Optional[List[ColumnResult]] = None
|
79
|
+
created_at: Optional[datetime] = None
|
80
|
+
applied_at: Optional[datetime] = None
|
81
81
|
|
82
82
|
def get_script(self) -> Optional[Script]:
|
83
83
|
if self.results is None:
|
@@ -120,9 +120,9 @@ class Dialog(DataClassJsonMixin):
|
|
120
120
|
@dataclass
|
121
121
|
class DialogResult(DataClassJsonMixin):
|
122
122
|
id: str
|
123
|
-
dialog: Optional[Dialog]
|
124
|
-
url: Optional[str]
|
125
|
-
results: Optional[List[ColumnResult]]
|
123
|
+
dialog: Optional[Dialog] = None
|
124
|
+
url: Optional[str] = None
|
125
|
+
results: Optional[List[ColumnResult]] = None
|
126
126
|
|
127
127
|
|
128
128
|
@dataclass_json
|
@@ -0,0 +1,11 @@
|
|
1
|
+
most/__init__.py,sha256=62uFFeM_1VVR83K3bTYWK3PEoqnmFCy9aWYerQ6U4Ds,67
|
2
|
+
most/_constrants.py,sha256=SlHKcBoXwe_sPzk8tdbb7lqhQz-Bfo__FhSoeFWodZE,217
|
3
|
+
most/api.py,sha256=_xqIj24dm1bINPy54zZ4Xqp5V8DQa05TN3zocuZW7io,17895
|
4
|
+
most/async_api.py,sha256=bt3natlTmqbafo1hJ5TUkxMssz4l8o6_sLNRbTAoU4A,18912
|
5
|
+
most/score_calculation.py,sha256=1XU1LfIH5LSCwAbAaKkr-EjH5qOTXrJKOUvhCCawka4,1054
|
6
|
+
most/types.py,sha256=ukhG70TPfSR9Xp11mQpXsaSBvKcbFW64PbXiUWtgG5E,3771
|
7
|
+
most_client-1.0.28.dist-info/METADATA,sha256=fGmSQqhd578FQN8SgZV0dY6A4Wo7GXV6_e5HB0b15i8,1027
|
8
|
+
most_client-1.0.28.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
9
|
+
most_client-1.0.28.dist-info/top_level.txt,sha256=2g5fk02LKkM1hV3pVVti_LQ60TToLBcR2zQ3JEKGVk8,5
|
10
|
+
most_client-1.0.28.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
11
|
+
most_client-1.0.28.dist-info/RECORD,,
|
@@ -1,11 +0,0 @@
|
|
1
|
-
most/__init__.py,sha256=62uFFeM_1VVR83K3bTYWK3PEoqnmFCy9aWYerQ6U4Ds,67
|
2
|
-
most/_constrants.py,sha256=SlHKcBoXwe_sPzk8tdbb7lqhQz-Bfo__FhSoeFWodZE,217
|
3
|
-
most/api.py,sha256=t4RqDp-dJUfMayv_0FtBD8yKaGVZpnixCc7D7-UFSKY,17658
|
4
|
-
most/async_api.py,sha256=dBZIrzyPfstFMysxVNfrQdd4WDabBIsWMu2ogLsnPb4,18676
|
5
|
-
most/score_calculation.py,sha256=1XU1LfIH5LSCwAbAaKkr-EjH5qOTXrJKOUvhCCawka4,1054
|
6
|
-
most/types.py,sha256=3Sh_WsROcGtoqUx92Uu3N720n8c3tzQNiaV-09B0m5s,3703
|
7
|
-
most_client-1.0.26.dist-info/METADATA,sha256=ZS_1q6DxGm4TSb3VTel8oABNRNvFxjqyzCcNn5PAHtw,1027
|
8
|
-
most_client-1.0.26.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
9
|
-
most_client-1.0.26.dist-info/top_level.txt,sha256=2g5fk02LKkM1hV3pVVti_LQ60TToLBcR2zQ3JEKGVk8,5
|
10
|
-
most_client-1.0.26.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
11
|
-
most_client-1.0.26.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|