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.
Files changed (38) hide show
  1. {industrial_model-0.1.3 → industrial_model-0.1.4}/PKG-INFO +24 -4
  2. {industrial_model-0.1.3 → industrial_model-0.1.4}/README.md +23 -3
  3. {industrial_model-0.1.3 → industrial_model-0.1.4}/pyproject.toml +1 -1
  4. {industrial_model-0.1.3 → industrial_model-0.1.4}/.gitignore +0 -0
  5. {industrial_model-0.1.3 → industrial_model-0.1.4}/.python-version +0 -0
  6. {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/__init__.py +0 -0
  7. {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/cognite_adapters/__init__.py +0 -0
  8. {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/cognite_adapters/filter_mapper.py +0 -0
  9. {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/cognite_adapters/optimizer.py +0 -0
  10. {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/cognite_adapters/query_mapper.py +0 -0
  11. {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/cognite_adapters/query_result_mapper.py +0 -0
  12. {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/cognite_adapters/schemas.py +0 -0
  13. {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/cognite_adapters/sort_mapper.py +0 -0
  14. {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/cognite_adapters/utils.py +0 -0
  15. {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/cognite_adapters/view_mapper.py +0 -0
  16. {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/config.py +0 -0
  17. {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/constants.py +0 -0
  18. {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/engines/__init__.py +0 -0
  19. {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/engines/async_engine.py +0 -0
  20. {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/engines/engine.py +0 -0
  21. {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/models/__init__.py +0 -0
  22. {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/models/base.py +0 -0
  23. {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/models/entities.py +0 -0
  24. {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/py.typed +0 -0
  25. {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/queries/__init__.py +0 -0
  26. {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/queries/models.py +0 -0
  27. {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/queries/params.py +0 -0
  28. {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/statements/__init__.py +0 -0
  29. {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/statements/expressions.py +0 -0
  30. {industrial_model-0.1.3 → industrial_model-0.1.4}/industrial_model/utils.py +0 -0
  31. {industrial_model-0.1.3 → industrial_model-0.1.4}/scripts/build.sh +0 -0
  32. {industrial_model-0.1.3 → industrial_model-0.1.4}/scripts/format.sh +0 -0
  33. {industrial_model-0.1.3 → industrial_model-0.1.4}/scripts/lint.sh +0 -0
  34. {industrial_model-0.1.3 → industrial_model-0.1.4}/tests/__init__.py +0 -0
  35. {industrial_model-0.1.3 → industrial_model-0.1.4}/tests/cognite-sdk-config.yaml +0 -0
  36. {industrial_model-0.1.3 → industrial_model-0.1.4}/tests/hubs.py +0 -0
  37. {industrial_model-0.1.3 → industrial_model-0.1.4}/tests/tests_adapter.py +0 -0
  38. {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
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
- livesIn: Country
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.livesIn).nested_(Country.name == "usa"),
151
+ col(Person.lives_in).nested_(Country.name == "usa"),
132
152
  and_(
133
- col(Person.livesIn).nested_(col(Country.name).equals_("bra")),
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
- livesIn: Country
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.livesIn).nested_(Country.name == "usa"),
131
+ col(Person.lives_in).nested_(Country.name == "usa"),
112
132
  and_(
113
- col(Person.livesIn).nested_(col(Country.name).equals_("bra")),
133
+ col(Person.lives_in).nested_(col(Country.name).equals_("bra")),
114
134
  col(Person.birthday).equals_("2023-01-01")
115
135
  )
116
136
  )
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "industrial-model"
3
- version = "0.1.3"
3
+ version = "0.1.4"
4
4
  description = "Industrial Model ORM"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"