malevich-coretools 0.3.20__tar.gz → 0.3.24__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.
- {malevich_coretools-0.3.20/malevich_coretools.egg-info → malevich_coretools-0.3.24}/PKG-INFO +1 -1
- malevich_coretools-0.3.24/VERSION +1 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/abstract/abstract.py +6 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/funcs/funcs.py +4 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/funcs/helpers.py +8 -2
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/secondary/const.py +1 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/utils.py +38 -2
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24/malevich_coretools.egg-info}/PKG-INFO +1 -1
- malevich_coretools-0.3.20/VERSION +0 -1
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/LICENSE +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/MANIFEST.in +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/README.md +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/__init__.py +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/abstract/__init__.py +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/abstract/pipeline.py +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/abstract/statuses.py +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/admin/__init__.py +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/admin/utils.py +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/batch/__init__.py +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/batch/utils.py +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/funcs/__init__.py +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/funcs/checks.py +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/secondary/__init__.py +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/secondary/config.py +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/secondary/helpers.py +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/secondary/kafka_utils.py +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/tools/__init__.py +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/tools/abstract.py +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/tools/vast.py +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools.egg-info/SOURCES.txt +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools.egg-info/dependency_links.txt +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools.egg-info/requires.txt +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools.egg-info/top_level.txt +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/pyproject.toml +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/requirements.txt +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/setup.cfg +0 -0
- {malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/setup.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.3.24
|
{malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/abstract/abstract.py
RENAMED
|
@@ -422,6 +422,11 @@ class ProcessorFunctionInfo(FunctionInfo):
|
|
|
422
422
|
contextClass: Optional[Dict[str, Any]] = None # model_json_schema
|
|
423
423
|
|
|
424
424
|
|
|
425
|
+
class ConditionFunctionInfo(FunctionInfo):
|
|
426
|
+
# contextClass: Optional[Dict[str, Any]] = None # model_json_schema
|
|
427
|
+
...
|
|
428
|
+
|
|
429
|
+
|
|
425
430
|
class OutputFunctionInfo(FunctionInfo):
|
|
426
431
|
collectionOutNames: Optional[List[str]] = None
|
|
427
432
|
|
|
@@ -438,6 +443,7 @@ class InitInfo(BaseModel):
|
|
|
438
443
|
class AppFunctionsInfo(BaseModel):
|
|
439
444
|
inputs: Dict[Alias.Id, InputFunctionInfo] = dict()
|
|
440
445
|
processors: Dict[Alias.Id, ProcessorFunctionInfo] = dict()
|
|
446
|
+
conditions: Dict[Alias.Id, ConditionFunctionInfo] = dict()
|
|
441
447
|
outputs: Dict[Alias.Id, OutputFunctionInfo] = dict()
|
|
442
448
|
schemes: Dict[Alias.Id, str] = dict()
|
|
443
449
|
inits: Dict[Alias.Id, InitInfo] = dict()
|
|
@@ -30,6 +30,10 @@ def get_docs_id(id: str, *args, **kwargs) -> ResultDoc:
|
|
|
30
30
|
return model_from_json(send_to_core_get(DOCS_ID(id, None), *args, **kwargs), ResultDoc)
|
|
31
31
|
|
|
32
32
|
|
|
33
|
+
def get_docs_name(name: str, *args, **kwargs) -> ResultDoc:
|
|
34
|
+
return model_from_json(send_to_core_get(DOCS_NAME(name, None), *args, **kwargs), ResultDoc)
|
|
35
|
+
|
|
36
|
+
|
|
33
37
|
def post_docs(data: DocWithName, wait: bool, *args, **kwargs) -> Alias.Id:
|
|
34
38
|
return send_to_core_modify(DOCS(wait), data, *args, **kwargs)
|
|
35
39
|
|
|
@@ -34,7 +34,10 @@ def create_collection_from_file_df(
|
|
|
34
34
|
*args,
|
|
35
35
|
**kwargs
|
|
36
36
|
) -> Alias.Id:
|
|
37
|
-
|
|
37
|
+
try:
|
|
38
|
+
data = pd.read_csv(file)
|
|
39
|
+
except pd.errors.EmptyDataError:
|
|
40
|
+
data = pd.DataFrame()
|
|
38
41
|
if name is None:
|
|
39
42
|
name = file
|
|
40
43
|
return create_collection_from_df(data, name=file, metadata=metadata, *args, **kwargs)
|
|
@@ -63,7 +66,10 @@ def raw_collection_from_file(
|
|
|
63
66
|
name: Optional[str] = None,
|
|
64
67
|
metadata: Optional[Union[Dict[str, Any], str]] = None,
|
|
65
68
|
) -> DocsDataCollection:
|
|
66
|
-
|
|
69
|
+
try:
|
|
70
|
+
data = pd.read_csv(file)
|
|
71
|
+
except pd.errors.EmptyDataError:
|
|
72
|
+
data = pd.DataFrame()
|
|
67
73
|
return raw_collection_from_df(data, name, metadata)
|
|
68
74
|
|
|
69
75
|
|
{malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/secondary/const.py
RENAMED
|
@@ -39,6 +39,7 @@ def with_key_values(url: str, key_values: Dict[str, Optional[str]]) -> str:
|
|
|
39
39
|
DOCS_MAIN = f"{API_VERSION}/docs"
|
|
40
40
|
DOCS = lambda wait: with_wait(f"{DOCS_MAIN}/", wait)
|
|
41
41
|
DOCS_ID = lambda id, wait: with_wait(f"{DOCS_MAIN}/{id}", wait)
|
|
42
|
+
DOCS_NAME = lambda name, wait: with_wait(f"{DOCS_MAIN}/name/{name}", wait)
|
|
42
43
|
|
|
43
44
|
## CollectionsController
|
|
44
45
|
COLLECTIONS_MAIN = f"{API_VERSION}/collections"
|
|
@@ -2,7 +2,7 @@ import json
|
|
|
2
2
|
import os
|
|
3
3
|
import re
|
|
4
4
|
import subprocess
|
|
5
|
-
from typing import Union
|
|
5
|
+
from typing import Type, Union
|
|
6
6
|
|
|
7
7
|
import pandas as pd
|
|
8
8
|
|
|
@@ -148,8 +148,23 @@ def get_doc(
|
|
|
148
148
|
return f.get_docs_id(id, auth=auth, conn_url=conn_url)
|
|
149
149
|
|
|
150
150
|
|
|
151
|
+
def get_doc_by_name(
|
|
152
|
+
name: str,
|
|
153
|
+
*,
|
|
154
|
+
auth: Optional[AUTH] = None,
|
|
155
|
+
conn_url: Optional[str] = None,
|
|
156
|
+
batcher: Optional[Batcher] = None,
|
|
157
|
+
) -> ResultDoc:
|
|
158
|
+
"""return doc by `name` """
|
|
159
|
+
if batcher is None:
|
|
160
|
+
batcher = Config.BATCHER
|
|
161
|
+
if batcher is not None:
|
|
162
|
+
return batcher.add("getDocByName", vars={"name": name}, result_model=ResultDoc)
|
|
163
|
+
return f.get_docs_name(name, auth=auth, conn_url=conn_url)
|
|
164
|
+
|
|
165
|
+
|
|
151
166
|
def create_doc(
|
|
152
|
-
data: Alias.Json,
|
|
167
|
+
data: Union[Alias.Json, Dict, Type[BaseModel]],
|
|
153
168
|
name: Optional[str],
|
|
154
169
|
wait: bool = True,
|
|
155
170
|
*,
|
|
@@ -160,6 +175,10 @@ def create_doc(
|
|
|
160
175
|
"""save doc with `data` and `name`, return `id` """
|
|
161
176
|
if batcher is None:
|
|
162
177
|
batcher = Config.BATCHER
|
|
178
|
+
if isinstance(data, Dict):
|
|
179
|
+
data = json.dumps(data)
|
|
180
|
+
elif issubclass(data.__class__, BaseModel):
|
|
181
|
+
data = data.model_dump_json()
|
|
163
182
|
data = DocWithName(data=data, name=name)
|
|
164
183
|
if batcher is not None:
|
|
165
184
|
return batcher.add("postDoc", data=data)
|
|
@@ -3267,6 +3286,23 @@ def get_collection_by_name_to_df(
|
|
|
3267
3286
|
return pd.DataFrame.from_records(records)
|
|
3268
3287
|
|
|
3269
3288
|
|
|
3289
|
+
def create_doc_from_file(
|
|
3290
|
+
filename: str,
|
|
3291
|
+
name: Optional[str] = None,
|
|
3292
|
+
*,
|
|
3293
|
+
auth: Optional[AUTH] = None,
|
|
3294
|
+
conn_url: Optional[str] = None,
|
|
3295
|
+
batcher: Optional[Batcher] = None,
|
|
3296
|
+
) -> Alias.Id:
|
|
3297
|
+
"""create doc\n
|
|
3298
|
+
return doc id"""
|
|
3299
|
+
with open(filename) as f:
|
|
3300
|
+
data = json.load(f)
|
|
3301
|
+
return create_doc(
|
|
3302
|
+
data, name, auth=auth, conn_url=conn_url, batcher=batcher
|
|
3303
|
+
)
|
|
3304
|
+
|
|
3305
|
+
|
|
3270
3306
|
def create_schemes_by_path(
|
|
3271
3307
|
path: str,
|
|
3272
3308
|
wait: bool = True,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.3.20
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/abstract/__init__.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/abstract/pipeline.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/abstract/statuses.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/admin/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/batch/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/funcs/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/secondary/__init__.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/secondary/config.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/secondary/helpers.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/secondary/kafka_utils.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/tools/__init__.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools/tools/abstract.py
RENAMED
|
File without changes
|
|
File without changes
|
{malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools.egg-info/requires.txt
RENAMED
|
File without changes
|
{malevich_coretools-0.3.20 → malevich_coretools-0.3.24}/malevich_coretools.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|