cognite-neat 0.123.34__py3-none-any.whl → 0.123.35__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.
Potentially problematic release.
This version of cognite-neat might be problematic. Click here for more details.
- cognite/neat/_version.py +1 -1
- cognite/neat/v0/plugins/__init__.py +2 -1
- cognite/neat/v0/plugins/_base.py +9 -0
- cognite/neat/v0/plugins/_data_model.py +48 -0
- cognite/neat/v0/plugins/_manager.py +6 -15
- cognite/neat/v0/session/_plugin.py +1 -2
- {cognite_neat-0.123.34.dist-info → cognite_neat-0.123.35.dist-info}/METADATA +1 -1
- {cognite_neat-0.123.34.dist-info → cognite_neat-0.123.35.dist-info}/RECORD +10 -11
- cognite/neat/v0/plugins/data_model/__init__.py +0 -0
- cognite/neat/v0/plugins/data_model/importers/__init__.py +0 -5
- cognite/neat/v0/plugins/data_model/importers/_base.py +0 -28
- {cognite_neat-0.123.34.dist-info → cognite_neat-0.123.35.dist-info}/WHEEL +0 -0
- {cognite_neat-0.123.34.dist-info → cognite_neat-0.123.35.dist-info}/licenses/LICENSE +0 -0
cognite/neat/_version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version__ = "0.123.
|
|
1
|
+
__version__ = "0.123.35"
|
|
2
2
|
__engine__ = "^2.0.4"
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
from cognite.neat.v0.core._data_model.importers._base import BaseImporter
|
|
5
|
+
from cognite.neat.v0.core._data_model.transformers._base import VerifiedDataModelTransformer
|
|
6
|
+
|
|
7
|
+
from ._base import NeatPlugin
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class DataModelImporterPlugin(NeatPlugin):
|
|
11
|
+
"""This class is used an interface for data model import plugins.
|
|
12
|
+
Any plugin that is used for importing data models should inherit from this class.
|
|
13
|
+
It is expected to implement the `configure` method which returns a configured importer.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
def configure(self, io: str | Path | None, **kwargs: Any) -> BaseImporter:
|
|
17
|
+
"""Return a configure plugin for data model import.
|
|
18
|
+
Args:
|
|
19
|
+
io (str | Path | None): The input/output interface for the plugin.
|
|
20
|
+
**kwargs (Any): Additional keyword arguments for configuration.
|
|
21
|
+
Returns:
|
|
22
|
+
BaseImporter: A configured instance of the BaseImporter.
|
|
23
|
+
!!! note "Returns"
|
|
24
|
+
The method must return an instance of `BaseImporter` or its subclasses
|
|
25
|
+
meaning it must implement the `BaseImporter` interface.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
raise NotImplementedError()
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class DataModelTransformerPlugin(NeatPlugin):
|
|
32
|
+
"""This class is used as an interface for data model transformer plugins.
|
|
33
|
+
Any plugin that is used for transforming data models should inherit from this class.
|
|
34
|
+
It is expected to implement the `configure` method which returns a configured transformer.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
def configure(self, **kwargs: Any) -> VerifiedDataModelTransformer:
|
|
38
|
+
"""Return a configure plugin for data model import.
|
|
39
|
+
Args:
|
|
40
|
+
**kwargs (Any): Additional keyword arguments for configuration.
|
|
41
|
+
Returns:
|
|
42
|
+
VerifiedDataModelTransformer: A configured instance of the VerifiedDataModelTransformer.
|
|
43
|
+
!!! note "Returns"
|
|
44
|
+
The method must return an instance of `VerifiedDataModelTransformer` or its subclasses
|
|
45
|
+
meaning it must implement the `VerifiedDataModelTransformer` interface.
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
raise NotImplementedError()
|
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
"""Plugin manager for external plugins."""
|
|
2
2
|
|
|
3
3
|
from importlib import metadata
|
|
4
|
-
from typing import Any, ClassVar
|
|
4
|
+
from typing import Any, ClassVar
|
|
5
5
|
|
|
6
|
+
from ._base import NeatPlugin
|
|
7
|
+
from ._data_model import DataModelImporterPlugin, DataModelTransformerPlugin
|
|
6
8
|
from ._issues import PluginDuplicateError, PluginError, PluginLoadingError
|
|
7
|
-
from .data_model.importers import DataModelImporterPlugin
|
|
8
|
-
|
|
9
|
-
# Here we configure entry points where external plugins are going to be registered.
|
|
10
|
-
plugins_entry_points = {
|
|
11
|
-
"cognite.neat.v0.plugins.data_model.importers": DataModelImporterPlugin,
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
#: Type alias for all supported plugin types
|
|
15
|
-
NeatPlugin: TypeAlias = DataModelImporterPlugin
|
|
16
|
-
|
|
17
|
-
# Generic type variable for plugin types
|
|
18
|
-
T_NeatPlugin = TypeVar("T_NeatPlugin", bound=NeatPlugin)
|
|
19
9
|
|
|
20
10
|
|
|
21
11
|
class Plugin:
|
|
@@ -48,12 +38,13 @@ class PluginManager:
|
|
|
48
38
|
|
|
49
39
|
_plugins_entry_points: ClassVar[dict[str, type[NeatPlugin]]] = {
|
|
50
40
|
"cognite.neat.v0.plugins.data_model.importers": DataModelImporterPlugin,
|
|
41
|
+
"cognite.neat.v0.plugins.data_model.transformers": DataModelTransformerPlugin,
|
|
51
42
|
}
|
|
52
43
|
|
|
53
44
|
def __init__(self, plugins: dict[tuple[str, type[NeatPlugin]], Any]) -> None:
|
|
54
45
|
self._plugins = plugins
|
|
55
46
|
|
|
56
|
-
def get(self, name: str, type_: type[
|
|
47
|
+
def get(self, name: str, type_: type[NeatPlugin]) -> type[NeatPlugin]:
|
|
57
48
|
"""
|
|
58
49
|
Returns desired plugin
|
|
59
50
|
|
|
@@ -63,7 +54,7 @@ class PluginManager:
|
|
|
63
54
|
"""
|
|
64
55
|
try:
|
|
65
56
|
plugin_class = self._plugins[(name, type_)]
|
|
66
|
-
return
|
|
57
|
+
return plugin_class
|
|
67
58
|
except KeyError:
|
|
68
59
|
raise PluginError(plugin_name=name, plugin_type=type_.__name__) from None
|
|
69
60
|
|
|
@@ -4,8 +4,7 @@ from typing import Any
|
|
|
4
4
|
|
|
5
5
|
from cognite.neat.v0.core._issues._base import IssueList
|
|
6
6
|
from cognite.neat.v0.core._utils.reader._base import NeatReader
|
|
7
|
-
from cognite.neat.v0.plugins import get_plugin_manager
|
|
8
|
-
from cognite.neat.v0.plugins.data_model.importers._base import DataModelImporterPlugin
|
|
7
|
+
from cognite.neat.v0.plugins import DataModelImporterPlugin, get_plugin_manager
|
|
9
8
|
from cognite.neat.v0.session._experimental import ExperimentalFlags
|
|
10
9
|
|
|
11
10
|
from ._state import SessionState
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cognite-neat
|
|
3
|
-
Version: 0.123.
|
|
3
|
+
Version: 0.123.35
|
|
4
4
|
Summary: Knowledge graph transformation
|
|
5
5
|
Project-URL: Documentation, https://cognite-neat.readthedocs-hosted.com/
|
|
6
6
|
Project-URL: Homepage, https://cognite-neat.readthedocs-hosted.com/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
cognite/neat/__init__.py,sha256=Lo4DbjDOwnhCYUoAgPp5RG1fDdF7OlnomalTe7n1ydw,211
|
|
2
|
-
cognite/neat/_version.py,sha256=
|
|
2
|
+
cognite/neat/_version.py,sha256=oyuRoPyhH1BP1A6GaXszY7yVBk58ETdF9YpPI-S9EPQ,47
|
|
3
3
|
cognite/neat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
cognite/neat/_data_model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
cognite/neat/_data_model/_constants.py,sha256=NGGvWHlQqhkkSBP_AqoofGYjNph3SiZX6QPINlMsy04,107
|
|
@@ -182,12 +182,11 @@ cognite/neat/v0/core/_utils/upload.py,sha256=nRhq8G63avFZW-o9HCsepXCk1qFmFfm0EpE
|
|
|
182
182
|
cognite/neat/v0/core/_utils/xml_.py,sha256=FQkq84u35MUsnKcL6nTMJ9ajtG9D5i1u4VBnhGqP2DQ,1710
|
|
183
183
|
cognite/neat/v0/core/_utils/reader/__init__.py,sha256=fPkrNB_9hLB7CyHTCFV_xEbIfOMqUQzNly5JN33-QfM,146
|
|
184
184
|
cognite/neat/v0/core/_utils/reader/_base.py,sha256=baZVNEFv7F2xheQOy34K0sBjsHQTUT6se3kZDrBsVXA,5420
|
|
185
|
-
cognite/neat/v0/plugins/__init__.py,sha256=
|
|
185
|
+
cognite/neat/v0/plugins/__init__.py,sha256=acsDoiw0ztT2T-RyUIPtr8rfWpQBj4M6LmSEuAJcQjQ,209
|
|
186
|
+
cognite/neat/v0/plugins/_base.py,sha256=zYy9b7LeDrijRHWzj_ASv4WlsSjo12Msu3DIyBW2zT8,255
|
|
187
|
+
cognite/neat/v0/plugins/_data_model.py,sha256=MSfb9Gtz-whsY3-usMaPYBxpc9-C5qN3gWdN5ca6wDI,2088
|
|
186
188
|
cognite/neat/v0/plugins/_issues.py,sha256=9lbLlxgPSVHjirOhEHyNQ0Pf3NH82Psj_DuTCcJDQQQ,943
|
|
187
|
-
cognite/neat/v0/plugins/_manager.py,sha256=
|
|
188
|
-
cognite/neat/v0/plugins/data_model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
189
|
-
cognite/neat/v0/plugins/data_model/importers/__init__.py,sha256=d4UJNCFR1DXPY7lv5LdCW2hiStEhvXiu2g_bRSIp1y0,89
|
|
190
|
-
cognite/neat/v0/plugins/data_model/importers/_base.py,sha256=fgqf9-HPpiSf9GCyHfcERiOhjNQVk_uAQDz3E-7ezTM,1037
|
|
189
|
+
cognite/neat/v0/plugins/_manager.py,sha256=Pmaw5yjobMJ64OYaODX3FTaH1Q7hW9rzbz0A8wyIZcI,3683
|
|
191
190
|
cognite/neat/v0/session/__init__.py,sha256=fxQ5URVlUnmEGYyB8Baw7IDq-uYacqkigbc4b-Pr9Fw,58
|
|
192
191
|
cognite/neat/v0/session/_base.py,sha256=cLVrNEIizWKdPb2LRtXYxQRQczAnyHXJ46Ak1P4X03k,12967
|
|
193
192
|
cognite/neat/v0/session/_collector.py,sha256=YCPeapbxBK-vAFMq7ekLy0Pn796M9AM7B8hxFtgsOUU,4236
|
|
@@ -197,7 +196,7 @@ cognite/neat/v0/session/_explore.py,sha256=YQF8ubCm-dkpO5WuVfYGTkQjhF_XKHFcG6Ko5
|
|
|
197
196
|
cognite/neat/v0/session/_fix.py,sha256=PrXfrSR2DMkKD_k3MajaaziKJaYdIp9wr5aHvra66V4,925
|
|
198
197
|
cognite/neat/v0/session/_inspect.py,sha256=6xC-tLJfP7sbSQpIlpPmCQWklGxK_rEXBE41jtuUQ-s,10184
|
|
199
198
|
cognite/neat/v0/session/_mapping.py,sha256=9lQFnB0wpizo4ySIEDMWh183qpHh8TlVL7uOgAtJUxE,2904
|
|
200
|
-
cognite/neat/v0/session/_plugin.py,sha256=
|
|
199
|
+
cognite/neat/v0/session/_plugin.py,sha256=TqEeUYDiZmOyl33h44J5OlqkH7VzgGi63nJFidpBV4M,2235
|
|
201
200
|
cognite/neat/v0/session/_prepare.py,sha256=HFdDmBnYRpaCm90s_A0byHLJIZwKrt2ve6i3EyN0V6w,12802
|
|
202
201
|
cognite/neat/v0/session/_read.py,sha256=2pdlWa-OHQ4j2gRKNTeBzWBOipDPnznnqyys-yzUq2s,34658
|
|
203
202
|
cognite/neat/v0/session/_set.py,sha256=qFi3YrYBd09MfHVJ2Ak0PCGigTAhGttfnA2iWSYwUt4,4617
|
|
@@ -213,7 +212,7 @@ cognite/neat/v0/session/engine/__init__.py,sha256=D3MxUorEs6-NtgoICqtZ8PISQrjrr4
|
|
|
213
212
|
cognite/neat/v0/session/engine/_import.py,sha256=1QxA2_EK613lXYAHKQbZyw2yjo5P9XuiX4Z6_6-WMNQ,169
|
|
214
213
|
cognite/neat/v0/session/engine/_interface.py,sha256=3W-cYr493c_mW3P5O6MKN1xEQg3cA7NHR_ev3zdF9Vk,533
|
|
215
214
|
cognite/neat/v0/session/engine/_load.py,sha256=u0x7vuQCRoNcPt25KJBJRn8sJabonYK4vtSZpiTdP4k,5201
|
|
216
|
-
cognite_neat-0.123.
|
|
217
|
-
cognite_neat-0.123.
|
|
218
|
-
cognite_neat-0.123.
|
|
219
|
-
cognite_neat-0.123.
|
|
215
|
+
cognite_neat-0.123.35.dist-info/METADATA,sha256=6euHGIZPibwW7EYiWDy5Y829gpbSJyKlt7xjQDD5UkI,9195
|
|
216
|
+
cognite_neat-0.123.35.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
217
|
+
cognite_neat-0.123.35.dist-info/licenses/LICENSE,sha256=W8VmvFia4WHa3Gqxq1Ygrq85McUNqIGDVgtdvzT-XqA,11351
|
|
218
|
+
cognite_neat-0.123.35.dist-info/RECORD,,
|
|
File without changes
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
from pathlib import Path
|
|
2
|
-
from typing import Any
|
|
3
|
-
|
|
4
|
-
from cognite.neat.v0.core._data_model.importers._base import BaseImporter
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class DataModelImporterPlugin:
|
|
8
|
-
"""This class is used an interface for data model import plugins.
|
|
9
|
-
Any plugin that is used for importing data models should inherit from this class.
|
|
10
|
-
It is expected to implement the `configure` method which returns a configured importer.
|
|
11
|
-
"""
|
|
12
|
-
|
|
13
|
-
def configure(self, io: str | Path | None, **kwargs: Any) -> BaseImporter:
|
|
14
|
-
"""Return a configure plugin for data model import.
|
|
15
|
-
|
|
16
|
-
Args:
|
|
17
|
-
io (str | Path | None): The input/output interface for the plugin.
|
|
18
|
-
**kwargs (Any): Additional keyword arguments for configuration.
|
|
19
|
-
|
|
20
|
-
Returns:
|
|
21
|
-
BaseImporter: A configured instance of the BaseImporter.
|
|
22
|
-
|
|
23
|
-
!!! note "Returns"
|
|
24
|
-
The method must return an instance of `BaseImporter` or its subclasses
|
|
25
|
-
meaning it must implement the `BaseImporter` interface.
|
|
26
|
-
"""
|
|
27
|
-
|
|
28
|
-
raise NotImplementedError()
|
|
File without changes
|
|
File without changes
|