aas-standard-parser 0.2.9__tar.gz → 0.3.2__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 (25) hide show
  1. {aas_standard_parser-0.2.9 → aas_standard_parser-0.3.2}/PKG-INFO +7 -5
  2. {aas_standard_parser-0.2.9 → aas_standard_parser-0.3.2}/README.md +1 -1
  3. {aas_standard_parser-0.2.9 → aas_standard_parser-0.3.2}/aas_standard_parser/utils.py +25 -2
  4. {aas_standard_parser-0.2.9 → aas_standard_parser-0.3.2}/aas_standard_parser.egg-info/PKG-INFO +7 -5
  5. aas_standard_parser-0.3.2/aas_standard_parser.egg-info/requires.txt +3 -0
  6. {aas_standard_parser-0.2.9 → aas_standard_parser-0.3.2}/pyproject.toml +8 -3
  7. aas_standard_parser-0.2.9/aas_standard_parser.egg-info/requires.txt +0 -2
  8. {aas_standard_parser-0.2.9 → aas_standard_parser-0.3.2}/LICENSE +0 -0
  9. {aas_standard_parser-0.2.9 → aas_standard_parser-0.3.2}/aas_standard_parser/__init__.py +0 -0
  10. {aas_standard_parser-0.2.9 → aas_standard_parser-0.3.2}/aas_standard_parser/aas_parser.py +0 -0
  11. {aas_standard_parser-0.2.9 → aas_standard_parser-0.3.2}/aas_standard_parser/aid_parser.py +0 -0
  12. {aas_standard_parser-0.2.9 → aas_standard_parser-0.3.2}/aas_standard_parser/aimc_parser.py +0 -0
  13. {aas_standard_parser-0.2.9 → aas_standard_parser-0.3.2}/aas_standard_parser/classes/aimc_parser_classes.py +0 -0
  14. {aas_standard_parser-0.2.9 → aas_standard_parser-0.3.2}/aas_standard_parser/collection_helpers.py +0 -0
  15. {aas_standard_parser-0.2.9 → aas_standard_parser-0.3.2}/aas_standard_parser/demo/demo_process.py +0 -0
  16. {aas_standard_parser-0.2.9 → aas_standard_parser-0.3.2}/aas_standard_parser/demo/logging_handler.py +0 -0
  17. {aas_standard_parser-0.2.9 → aas_standard_parser-0.3.2}/aas_standard_parser/reference_helpers.py +0 -0
  18. {aas_standard_parser-0.2.9 → aas_standard_parser-0.3.2}/aas_standard_parser/submodel_json_parser.py +0 -0
  19. {aas_standard_parser-0.2.9 → aas_standard_parser-0.3.2}/aas_standard_parser/submodel_parser.py +0 -0
  20. {aas_standard_parser-0.2.9 → aas_standard_parser-0.3.2}/aas_standard_parser/version_check.py +0 -0
  21. {aas_standard_parser-0.2.9 → aas_standard_parser-0.3.2}/aas_standard_parser.egg-info/SOURCES.txt +0 -0
  22. {aas_standard_parser-0.2.9 → aas_standard_parser-0.3.2}/aas_standard_parser.egg-info/dependency_links.txt +0 -0
  23. {aas_standard_parser-0.2.9 → aas_standard_parser-0.3.2}/aas_standard_parser.egg-info/top_level.txt +0 -0
  24. {aas_standard_parser-0.2.9 → aas_standard_parser-0.3.2}/setup.cfg +0 -0
  25. {aas_standard_parser-0.2.9 → aas_standard_parser-0.3.2}/tests/test_aimc_parser.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aas-standard-parser
3
- Version: 0.2.9
3
+ Version: 0.3.2
4
4
  Summary: Some auxiliary functions for parsing standard submodels
5
5
  Author-email: Daniel Klein <daniel.klein@em.ag>
6
6
  License: MIT License
@@ -25,11 +25,13 @@ License: MIT License
25
25
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
26
  SOFTWARE.
27
27
 
28
- Project-URL: Homepage, https://github.com/fluid40/aas-http-client
28
+ Project-URL: Homepage, https://github.com/fluid40/aas-standard-parser
29
+ Requires-Python: >=3.11
29
30
  Description-Content-Type: text/markdown
30
31
  License-File: LICENSE
31
- Requires-Dist: typing>=3.7.4.3
32
- Requires-Dist: basyx-python-sdk>=1.2.1
32
+ Requires-Dist: basyx-python-sdk>=2.0.0
33
+ Requires-Dist: python-json-logger>=4.0.0
34
+ Requires-Dist: requests>=2.32.5
33
35
  Dynamic: license-file
34
36
 
35
37
  # aas-standard-parser
@@ -38,7 +40,7 @@ Dynamic: license-file
38
40
  <!-- change this to your projects logo if you have on.
39
41
  If you don't have one it might be worth trying chatgpt dall-e to create one for you...
40
42
  -->
41
- <img src="docs/assets/fluid_logo.svg" alt="aas_http_client" width=500 />
43
+ <img src="docs/assets/fluid_logo.svg" alt="aas_standard_parser" width=500 />
42
44
  </div>
43
45
 
44
46
  ---
@@ -4,7 +4,7 @@
4
4
  <!-- change this to your projects logo if you have on.
5
5
  If you don't have one it might be worth trying chatgpt dall-e to create one for you...
6
6
  -->
7
- <img src="docs/assets/fluid_logo.svg" alt="aas_http_client" width=500 />
7
+ <img src="docs/assets/fluid_logo.svg" alt="aas_standard_parser" width=500 />
8
8
  </div>
9
9
 
10
10
  ---
@@ -1,11 +1,15 @@
1
1
  """Utility functions for AAS standard parser."""
2
2
 
3
3
  import json
4
+ import logging
4
5
  from pathlib import Path
6
+ from typing import Any
5
7
 
6
- from aas_http_client import sdk_tools
8
+ import basyx.aas.adapter.json
7
9
  from basyx.aas import model
8
10
 
11
+ logger = logging.getLogger(__name__)
12
+
9
13
 
10
14
  def create_submodel_from_file(file_path: str) -> model.Submodel:
11
15
  """Loads a Submodel structure from a given JSON file and converts it into a model.Submodel object from the python SDK framework.
@@ -24,4 +28,23 @@ def create_submodel_from_file(file_path: str) -> model.Submodel:
24
28
  template_data = json.load(f)
25
29
 
26
30
  # Load the template JSON into a Submodel object
27
- return sdk_tools.convert_to_object(template_data)
31
+ return _convert_to_object(template_data)
32
+
33
+
34
+ def _convert_to_object(content: dict) -> Any | None:
35
+ """Convert a dictionary to a BaSyx SDK framework object.
36
+
37
+ :param content: dictionary to convert
38
+ :return: BaSyx SDK framework object or None
39
+ """
40
+ if not content or len(content) == 0:
41
+ logger.debug("Empty content provided for conversion to object.")
42
+ return None
43
+
44
+ try:
45
+ dict_string = json.dumps(content)
46
+ return json.loads(dict_string, cls=basyx.aas.adapter.json.json_deserialization.AASFromJsonDecoder)
47
+ except Exception as e:
48
+ logger.error(f"Decoding error: {e}")
49
+ logger.error(f"In JSON: {content}")
50
+ return None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aas-standard-parser
3
- Version: 0.2.9
3
+ Version: 0.3.2
4
4
  Summary: Some auxiliary functions for parsing standard submodels
5
5
  Author-email: Daniel Klein <daniel.klein@em.ag>
6
6
  License: MIT License
@@ -25,11 +25,13 @@ License: MIT License
25
25
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
26
  SOFTWARE.
27
27
 
28
- Project-URL: Homepage, https://github.com/fluid40/aas-http-client
28
+ Project-URL: Homepage, https://github.com/fluid40/aas-standard-parser
29
+ Requires-Python: >=3.11
29
30
  Description-Content-Type: text/markdown
30
31
  License-File: LICENSE
31
- Requires-Dist: typing>=3.7.4.3
32
- Requires-Dist: basyx-python-sdk>=1.2.1
32
+ Requires-Dist: basyx-python-sdk>=2.0.0
33
+ Requires-Dist: python-json-logger>=4.0.0
34
+ Requires-Dist: requests>=2.32.5
33
35
  Dynamic: license-file
34
36
 
35
37
  # aas-standard-parser
@@ -38,7 +40,7 @@ Dynamic: license-file
38
40
  <!-- change this to your projects logo if you have on.
39
41
  If you don't have one it might be worth trying chatgpt dall-e to create one for you...
40
42
  -->
41
- <img src="docs/assets/fluid_logo.svg" alt="aas_http_client" width=500 />
43
+ <img src="docs/assets/fluid_logo.svg" alt="aas_standard_parser" width=500 />
42
44
  </div>
43
45
 
44
46
  ---
@@ -0,0 +1,3 @@
1
+ basyx-python-sdk>=2.0.0
2
+ python-json-logger>=4.0.0
3
+ requests>=2.32.5
@@ -4,14 +4,19 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "aas-standard-parser"
7
- version = "0.2.9"
7
+ version = "0.3.2"
8
8
  description = "Some auxiliary functions for parsing standard submodels"
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
11
11
  authors = [{ name = "Daniel Klein", email = "daniel.klein@em.ag" }]
12
- dependencies = ["typing>=3.7.4.3", "basyx-python-sdk>=1.2.1"]
12
+ requires-python = ">=3.11"
13
+ dependencies = [
14
+ "basyx-python-sdk>=2.0.0",
15
+ "python-json-logger>=4.0.0",
16
+ "requests>=2.32.5",
17
+ ]
13
18
  [project.urls]
14
- Homepage = "https://github.com/fluid40/aas-http-client"
19
+ Homepage = "https://github.com/fluid40/aas-standard-parser"
15
20
 
16
21
  [tool.commitizen]
17
22
  name = "cz_conventional_commits"
@@ -1,2 +0,0 @@
1
- typing>=3.7.4.3
2
- basyx-python-sdk>=1.2.1