industrial-model 0.1.3__tar.gz → 0.1.4__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.
- {industrial_model-0.1.3 → industrial_model-0.1.4}/PKG-INFO +24 -4
- {industrial_model-0.1.3 → industrial_model-0.1.4}/README.md +23 -3
- {industrial_model-0.1.3 → industrial_model-0.1.4}/pyproject.toml +1 -1
- {industrial_model-0.1.3 → industrial_model-0.1.4}/.gitignore +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/.python-version +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/__init__.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/cognite_adapters/__init__.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/cognite_adapters/filter_mapper.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/cognite_adapters/optimizer.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/cognite_adapters/query_mapper.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/cognite_adapters/query_result_mapper.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/cognite_adapters/schemas.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/cognite_adapters/sort_mapper.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/cognite_adapters/utils.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/cognite_adapters/view_mapper.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/config.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/constants.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/engines/__init__.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/engines/async_engine.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/engines/engine.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/models/__init__.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/models/base.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/models/entities.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/py.typed +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/queries/__init__.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/queries/models.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/queries/params.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/statements/__init__.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/statements/expressions.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/utils.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/scripts/build.sh +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/scripts/format.sh +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/scripts/lint.sh +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/tests/__init__.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/tests/cognite-sdk-config.yaml +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/tests/hubs.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/tests/tests_adapter.py +0 -0
- {industrial_model-0.1.3 → industrial_model-0.1.4}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: industrial-model
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: Industrial Model ORM
|
|
5
5
|
Author-email: Lucas Alves <lucasrosaalves@gmail.com>
|
|
6
6
|
Classifier: Programming Language :: Python
|
|
@@ -81,7 +81,27 @@ class Country(ViewInstance):
|
|
|
81
81
|
class Person(ViewInstance):
|
|
82
82
|
name: str
|
|
83
83
|
birthday: datetime.date
|
|
84
|
-
|
|
84
|
+
lives_in: Country
|
|
85
|
+
cars: list[Car]
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
# By default, the ORM maps the class name to the view in the data model.
|
|
89
|
+
# You can override this behavior using the `view_config` field.
|
|
90
|
+
|
|
91
|
+
# For improved query performance, you can configure `instance_spaces` or `instance_spaces_prefix`
|
|
92
|
+
# in the `view_config`. These options include space filters in the generated queries,
|
|
93
|
+
# which can significantly reduce response times when working with large datasets.
|
|
94
|
+
|
|
95
|
+
class AnotherPerson(ViewInstance):
|
|
96
|
+
view_config = ViewInstanceConfig(
|
|
97
|
+
view_external_id="Person", # Maps this class to the 'Person' view
|
|
98
|
+
instance_spaces_prefix="Industr-", # Filters queries to spaces with this prefix
|
|
99
|
+
instance_spaces=["Industrial-Data"] # Alternatively, explicitly filter by these spaces
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
name: str
|
|
103
|
+
birthday: datetime.date
|
|
104
|
+
lives_in: Country
|
|
85
105
|
cars: list[Car]
|
|
86
106
|
|
|
87
107
|
|
|
@@ -128,9 +148,9 @@ result = engine.query(statement)
|
|
|
128
148
|
# 4. Nested filtering using relationships
|
|
129
149
|
statement = select(Person).where(
|
|
130
150
|
or_(
|
|
131
|
-
col(Person.
|
|
151
|
+
col(Person.lives_in).nested_(Country.name == "usa"),
|
|
132
152
|
and_(
|
|
133
|
-
col(Person.
|
|
153
|
+
col(Person.lives_in).nested_(col(Country.name).equals_("bra")),
|
|
134
154
|
col(Person.birthday).equals_("2023-01-01")
|
|
135
155
|
)
|
|
136
156
|
)
|
|
@@ -61,7 +61,27 @@ class Country(ViewInstance):
|
|
|
61
61
|
class Person(ViewInstance):
|
|
62
62
|
name: str
|
|
63
63
|
birthday: datetime.date
|
|
64
|
-
|
|
64
|
+
lives_in: Country
|
|
65
|
+
cars: list[Car]
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
# By default, the ORM maps the class name to the view in the data model.
|
|
69
|
+
# You can override this behavior using the `view_config` field.
|
|
70
|
+
|
|
71
|
+
# For improved query performance, you can configure `instance_spaces` or `instance_spaces_prefix`
|
|
72
|
+
# in the `view_config`. These options include space filters in the generated queries,
|
|
73
|
+
# which can significantly reduce response times when working with large datasets.
|
|
74
|
+
|
|
75
|
+
class AnotherPerson(ViewInstance):
|
|
76
|
+
view_config = ViewInstanceConfig(
|
|
77
|
+
view_external_id="Person", # Maps this class to the 'Person' view
|
|
78
|
+
instance_spaces_prefix="Industr-", # Filters queries to spaces with this prefix
|
|
79
|
+
instance_spaces=["Industrial-Data"] # Alternatively, explicitly filter by these spaces
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
name: str
|
|
83
|
+
birthday: datetime.date
|
|
84
|
+
lives_in: Country
|
|
65
85
|
cars: list[Car]
|
|
66
86
|
|
|
67
87
|
|
|
@@ -108,9 +128,9 @@ result = engine.query(statement)
|
|
|
108
128
|
# 4. Nested filtering using relationships
|
|
109
129
|
statement = select(Person).where(
|
|
110
130
|
or_(
|
|
111
|
-
col(Person.
|
|
131
|
+
col(Person.lives_in).nested_(Country.name == "usa"),
|
|
112
132
|
and_(
|
|
113
|
-
col(Person.
|
|
133
|
+
col(Person.lives_in).nested_(col(Country.name).equals_("bra")),
|
|
114
134
|
col(Person.birthday).equals_("2023-01-01")
|
|
115
135
|
)
|
|
116
136
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/cognite_adapters/__init__.py
RENAMED
|
File without changes
|
{industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/cognite_adapters/filter_mapper.py
RENAMED
|
File without changes
|
{industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/cognite_adapters/optimizer.py
RENAMED
|
File without changes
|
{industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/cognite_adapters/query_mapper.py
RENAMED
|
File without changes
|
|
File without changes
|
{industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/cognite_adapters/schemas.py
RENAMED
|
File without changes
|
{industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/cognite_adapters/sort_mapper.py
RENAMED
|
File without changes
|
{industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/cognite_adapters/utils.py
RENAMED
|
File without changes
|
{industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/cognite_adapters/view_mapper.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/statements/expressions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|