aas-standard-parser 0.2.6__tar.gz → 0.2.7__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 (29) hide show
  1. aas_standard_parser-0.2.7/PKG-INFO +92 -0
  2. aas_standard_parser-0.2.7/README.md +58 -0
  3. aas_standard_parser-0.2.7/aas_standard_parser/__init__.py +44 -0
  4. {aas_standard_parser-0.2.6 → aas_standard_parser-0.2.7}/aas_standard_parser/aas_parser.py +3 -3
  5. {aas_standard_parser-0.2.6 → aas_standard_parser-0.2.7}/aas_standard_parser/reference_helpers.py +11 -4
  6. aas_standard_parser-0.2.7/aas_standard_parser/submodel_json_parser.py +35 -0
  7. {aas_standard_parser-0.2.6 → aas_standard_parser-0.2.7}/aas_standard_parser/submodel_parser.py +4 -17
  8. aas_standard_parser-0.2.7/aas_standard_parser/utils.py +27 -0
  9. aas_standard_parser-0.2.7/aas_standard_parser/version_check.py +28 -0
  10. aas_standard_parser-0.2.7/aas_standard_parser.egg-info/PKG-INFO +92 -0
  11. {aas_standard_parser-0.2.6 → aas_standard_parser-0.2.7}/aas_standard_parser.egg-info/SOURCES.txt +2 -0
  12. {aas_standard_parser-0.2.6 → aas_standard_parser-0.2.7}/pyproject.toml +1 -1
  13. aas_standard_parser-0.2.6/PKG-INFO +0 -36
  14. aas_standard_parser-0.2.6/README.md +0 -2
  15. aas_standard_parser-0.2.6/aas_standard_parser/__init__.py +0 -19
  16. aas_standard_parser-0.2.6/aas_standard_parser/utils.py +0 -25
  17. aas_standard_parser-0.2.6/aas_standard_parser.egg-info/PKG-INFO +0 -36
  18. {aas_standard_parser-0.2.6 → aas_standard_parser-0.2.7}/LICENSE +0 -0
  19. {aas_standard_parser-0.2.6 → aas_standard_parser-0.2.7}/aas_standard_parser/aid_parser.py +0 -0
  20. {aas_standard_parser-0.2.6 → aas_standard_parser-0.2.7}/aas_standard_parser/aimc_parser.py +0 -0
  21. {aas_standard_parser-0.2.6 → aas_standard_parser-0.2.7}/aas_standard_parser/classes/aimc_parser_classes.py +0 -0
  22. {aas_standard_parser-0.2.6 → aas_standard_parser-0.2.7}/aas_standard_parser/collection_helpers.py +0 -0
  23. {aas_standard_parser-0.2.6 → aas_standard_parser-0.2.7}/aas_standard_parser/demo/demo_process.py +0 -0
  24. {aas_standard_parser-0.2.6 → aas_standard_parser-0.2.7}/aas_standard_parser/demo/logging_handler.py +0 -0
  25. {aas_standard_parser-0.2.6 → aas_standard_parser-0.2.7}/aas_standard_parser.egg-info/dependency_links.txt +0 -0
  26. {aas_standard_parser-0.2.6 → aas_standard_parser-0.2.7}/aas_standard_parser.egg-info/requires.txt +0 -0
  27. {aas_standard_parser-0.2.6 → aas_standard_parser-0.2.7}/aas_standard_parser.egg-info/top_level.txt +0 -0
  28. {aas_standard_parser-0.2.6 → aas_standard_parser-0.2.7}/setup.cfg +0 -0
  29. {aas_standard_parser-0.2.6 → aas_standard_parser-0.2.7}/tests/test_aimc_parser.py +0 -0
@@ -0,0 +1,92 @@
1
+ Metadata-Version: 2.4
2
+ Name: aas-standard-parser
3
+ Version: 0.2.7
4
+ Summary: Some auxiliary functions for parsing standard submodels
5
+ Author-email: Daniel Klein <daniel.klein@em.ag>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2025 Fluid4.0
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/fluid40/aas-http-client
29
+ Description-Content-Type: text/markdown
30
+ License-File: LICENSE
31
+ Requires-Dist: typing>=3.7.4.3
32
+ Requires-Dist: basyx-python-sdk>=1.2.1
33
+ Dynamic: license-file
34
+
35
+ # aas-standard-parser
36
+
37
+ <div align="center">
38
+ <!-- change this to your projects logo if you have on.
39
+ If you don't have one it might be worth trying chatgpt dall-e to create one for you...
40
+ -->
41
+ <img src="docs/assets/fluid_logo.svg" alt="aas_http_client" width=500 />
42
+ </div>
43
+
44
+ ---
45
+
46
+ [![License: MIT](https://img.shields.io/badge/license-MIT-%23f8a602?label=License&labelColor=%23992b2e)](LICENSE)
47
+ [![CI](https://github.com/fluid40/aas-standard-parser/actions/workflows/CI.yml/badge.svg?branch=main&cache-bust=1)](https://github.com/fluid40/aas-standard-parser/actions)
48
+ [![PyPI version](https://img.shields.io/pypi/v/aas-standard-parser.svg)](https://pypi.org/project/aas-standard-parser/)
49
+
50
+
51
+ This project provides tools for parsing and handling Asset Administration Shell (AAS) standard submodels, with a focus on AID and AIMC submodels. It enables:
52
+
53
+ - Extraction, interpretation, and mapping of submodel elements and their properties
54
+ - Working with references, semantic IDs, and submodel element collections
55
+ - Representation and processing of mapping configurations and source-sink relations
56
+ - Structured and colored logging, including log file management
57
+
58
+ These components enable efficient parsing, transformation, and analysis of AAS submodels in Python-based workflows.
59
+ > **Note:** Most functions in this project utilize the [python aas sdk framework](https://github.com/aas-core-works/aas-core3.0-python) for parsing and handling AAS submodels, ensuring compatibility with the official AAS data models and structures.
60
+ ---
61
+
62
+ ## Provided Parsers
63
+
64
+ - **AID Parser**: Parses AID submodels to extract interface descriptions, properties, and security/authentication details.
65
+ - **AIMC Parser**: Parses AIMC submodels to extract and process mapping configurations and source-sink relations.
66
+ - **AAS Parser**: Utilities to extract submodel IDs from an Asset Administration Shell.
67
+ - **Submodel Parser**: Helpers to retrieve submodel elements by semantic ID or by path within a submodel.
68
+
69
+ ## Helper Modules
70
+
71
+ - **Collection Helpers**: Functions to search and filter submodel elements by semantic ID, idShort, or supplemental semantic ID within collections.
72
+ - **Reference Helpers**: Utilities for working with references, such as constructing idShort paths and extracting values from reference keys.
73
+ - **Utilities**: General utility functions, including loading a submodel from a file.
74
+
75
+ ---
76
+
77
+ ## API References
78
+ - AID Parser
79
+ - AIMC Parser
80
+ - [AAS Parser](docs/api_references/api_aas_parser.md)
81
+ - [Submodel Parser](docs/api_references/api_submodel_parser.md)
82
+ - Collection Helpers
83
+ - [Reference Helpers](docs/api_references/api_reference_helpers.md)
84
+ - [Utilities](docs/api_references/api_utils.md)
85
+
86
+ ## Resources
87
+
88
+ 🤖 [Releases](http://github.com/fluid40/aas-standard-parser/releases)
89
+
90
+ 📦 [Pypi Packages](https://pypi.org/project/aas-standard-parser/)
91
+
92
+ 📜 [MIT License](LICENSE)
@@ -0,0 +1,58 @@
1
+ # aas-standard-parser
2
+
3
+ <div align="center">
4
+ <!-- change this to your projects logo if you have on.
5
+ If you don't have one it might be worth trying chatgpt dall-e to create one for you...
6
+ -->
7
+ <img src="docs/assets/fluid_logo.svg" alt="aas_http_client" width=500 />
8
+ </div>
9
+
10
+ ---
11
+
12
+ [![License: MIT](https://img.shields.io/badge/license-MIT-%23f8a602?label=License&labelColor=%23992b2e)](LICENSE)
13
+ [![CI](https://github.com/fluid40/aas-standard-parser/actions/workflows/CI.yml/badge.svg?branch=main&cache-bust=1)](https://github.com/fluid40/aas-standard-parser/actions)
14
+ [![PyPI version](https://img.shields.io/pypi/v/aas-standard-parser.svg)](https://pypi.org/project/aas-standard-parser/)
15
+
16
+
17
+ This project provides tools for parsing and handling Asset Administration Shell (AAS) standard submodels, with a focus on AID and AIMC submodels. It enables:
18
+
19
+ - Extraction, interpretation, and mapping of submodel elements and their properties
20
+ - Working with references, semantic IDs, and submodel element collections
21
+ - Representation and processing of mapping configurations and source-sink relations
22
+ - Structured and colored logging, including log file management
23
+
24
+ These components enable efficient parsing, transformation, and analysis of AAS submodels in Python-based workflows.
25
+ > **Note:** Most functions in this project utilize the [python aas sdk framework](https://github.com/aas-core-works/aas-core3.0-python) for parsing and handling AAS submodels, ensuring compatibility with the official AAS data models and structures.
26
+ ---
27
+
28
+ ## Provided Parsers
29
+
30
+ - **AID Parser**: Parses AID submodels to extract interface descriptions, properties, and security/authentication details.
31
+ - **AIMC Parser**: Parses AIMC submodels to extract and process mapping configurations and source-sink relations.
32
+ - **AAS Parser**: Utilities to extract submodel IDs from an Asset Administration Shell.
33
+ - **Submodel Parser**: Helpers to retrieve submodel elements by semantic ID or by path within a submodel.
34
+
35
+ ## Helper Modules
36
+
37
+ - **Collection Helpers**: Functions to search and filter submodel elements by semantic ID, idShort, or supplemental semantic ID within collections.
38
+ - **Reference Helpers**: Utilities for working with references, such as constructing idShort paths and extracting values from reference keys.
39
+ - **Utilities**: General utility functions, including loading a submodel from a file.
40
+
41
+ ---
42
+
43
+ ## API References
44
+ - AID Parser
45
+ - AIMC Parser
46
+ - [AAS Parser](docs/api_references/api_aas_parser.md)
47
+ - [Submodel Parser](docs/api_references/api_submodel_parser.md)
48
+ - Collection Helpers
49
+ - [Reference Helpers](docs/api_references/api_reference_helpers.md)
50
+ - [Utilities](docs/api_references/api_utils.md)
51
+
52
+ ## Resources
53
+
54
+ 🤖 [Releases](http://github.com/fluid40/aas-standard-parser/releases)
55
+
56
+ 📦 [Pypi Packages](https://pypi.org/project/aas-standard-parser/)
57
+
58
+ 📜 [MIT License](LICENSE)
@@ -0,0 +1,44 @@
1
+ """AAS Standard parser Package."""
2
+
3
+ import importlib.metadata
4
+ from datetime import datetime, timezone
5
+
6
+ from aas_standard_parser import (
7
+ aas_parser,
8
+ aid_parser,
9
+ aimc_parser,
10
+ collection_helpers,
11
+ reference_helpers,
12
+ submodel_json_parser,
13
+ submodel_parser,
14
+ utils,
15
+ )
16
+ from aas_standard_parser.aid_parser import AIDParser
17
+ from aas_standard_parser.version_check import check_for_update
18
+
19
+ __copyright__ = f"Copyright (C) {datetime.now(tz=timezone.utc).year} Fluid 4.0. All rights reserved."
20
+ __author__ = "Daniel Klein, Celina Adelhardt, Tom Gneuß"
21
+
22
+ try:
23
+ __license__ = "MIT"
24
+ __version__ = importlib.metadata.version(__name__)
25
+ except importlib.metadata.PackageNotFoundError:
26
+ __version__ = "0.0.0-dev"
27
+
28
+ __project__ = "aas-standard-parser"
29
+ __package__ = "aas-standard-parser"
30
+
31
+
32
+ check_for_update()
33
+
34
+ __all__ = [
35
+ "AIDParser",
36
+ "aas_parser",
37
+ "aid_parser",
38
+ "aimc_parser",
39
+ "collection_helpers",
40
+ "reference_helpers",
41
+ "submodel_json_parser",
42
+ "submodel_parser",
43
+ "utils",
44
+ ]
@@ -8,10 +8,10 @@ logger = logging.getLogger(__name__)
8
8
 
9
9
 
10
10
  def get_submodel_ids(shell: model.AssetAdministrationShell) -> list[str]:
11
- """Get all submodel IDs from the given AAS.
11
+ """Get all IDs from the submodels referenced in the given AAS.
12
12
 
13
- :param shell: parent AAS to search within
14
- :return: list of submodel IDs
13
+ :param shell: The Asset Administration Shell to extract submodel IDs from.
14
+ :return: A list of submodel IDs referenced in the AAS.
15
15
  """
16
16
  submodel_ids = []
17
17
  for submodel in shell.submodel:
@@ -1,15 +1,22 @@
1
+ """Helper functions for working with ModelReference objects in the AAS standard parser."""
2
+
1
3
  from basyx.aas.model import ModelReference
2
4
 
3
5
 
4
- def construct_idshort_path_from_reference(reference: ModelReference) -> str:
5
- idshort_path: str = ""
6
+ def construct_id_short_path_from_reference(reference: ModelReference) -> str:
7
+ """Constructs an idShort path from the given ModelReference.
8
+
9
+ :param reference: The ModelReference to construct the idShort path from.
10
+ :return: The constructed idShort path as a string.
11
+ """
12
+ id_short_path: str = ""
6
13
 
7
14
  # start from the second Key and omit the Identifiable at the beginning of the list
8
15
  for key in reference.key[1:]:
9
- idshort_path += key.value + "."
16
+ id_short_path += key.value + "."
10
17
 
11
18
  # get rid of the trailing dot
12
- return idshort_path[:-1]
19
+ return id_short_path[:-1]
13
20
 
14
21
 
15
22
  def get_values_from_keys(reference: ModelReference) -> list[str]:
@@ -0,0 +1,35 @@
1
+ """Module for parsing submodels JSON data."""
2
+
3
+ import logging
4
+
5
+ logger = logging.getLogger(__name__)
6
+
7
+
8
+ def get_value_from_semantic_id_by_index(submodel_data: dict, index: int) -> str | None:
9
+ """Retrieve the value from the semantic ID from a submodel JSON dictionary by index.
10
+
11
+ :param submodel_data: The submodel data as a dictionary.
12
+
13
+ :param index: The index to access if the element is a list or collection.
14
+ :return: The value of the found submodel element or None if not found.
15
+ """
16
+ if "semantic_id" not in submodel_data or len(submodel_data.semantic_id.key) == 0:
17
+ logger.debug(f"Submodel '{submodel_data}' has no semantic ID")
18
+ return None
19
+
20
+ sm_semantic_id = submodel_data.get("semantic_id", {})
21
+ if "keys" not in sm_semantic_id or len(sm_semantic_id["keys"]) == 0:
22
+ logger.debug(f"Submodel '{submodel_data}' has no semantic ID keys")
23
+ return None
24
+
25
+ if len(sm_semantic_id["keys"]) < index + 1:
26
+ logger.debug(f"Submodel '{submodel_data}' has no semantic ID key at index {index}")
27
+ return None
28
+
29
+ key = sm_semantic_id["keys"][index]
30
+
31
+ if "value" not in key:
32
+ logger.debug(f"Submodel '{submodel_data}' has no semantic ID value")
33
+ return None
34
+
35
+ return key["value"]
@@ -3,32 +3,19 @@
3
3
  import logging
4
4
 
5
5
  from basyx.aas import model
6
- from basyx.aas.model import NamespaceSet, SubmodelElement
7
-
8
- from aas_standard_parser import collection_helpers
9
6
 
10
7
  logger = logging.getLogger(__name__)
11
8
 
12
9
 
13
- def get_element_by_semantic_id(collection: NamespaceSet[SubmodelElement], semantic_id: str) -> SubmodelElement | None:
14
- """Get an element from parent collection by its semantic ID (not recursive).
15
-
16
- :param parent: parent collection to search within
17
- :param semantic_id: semantic ID to search for
18
- :return: the found submodel element or None if not found
19
- """
20
- return collection_helpers.find_by_semantic_id(collection, semantic_id)
21
-
22
-
23
- def get_submodel_element_by_path(submodel: model.Submodel, path: str) -> model.SubmodelElement:
24
- """Returns a specific submodel element from the submodel at a specific path.
10
+ def get_submodel_element_by_id_short_path(submodel: model.Submodel, id_short_path: str) -> model.SubmodelElement:
11
+ """Retrieve a specific submodel element from the submodel at a specific idShort path.
25
12
 
26
13
  :param submodel: The submodel to search within.
27
- :param path: IdShort path to the submodel element (dot-separated), e.g., "Element1.Element2[0].Element3".
14
+ :param id_short_path: IdShort path to the submodel element (dot-separated), e.g., "Element1.Element2[0].Element3".
28
15
  :return: The found submodel element or None if not found.
29
16
  """
30
17
  # Split the path by '.' and traverse the structure
31
- parts = path.split(".")
18
+ parts = id_short_path.split(".")
32
19
  current_elements = submodel.submodel_element
33
20
  part_index = 0
34
21
  for part in parts:
@@ -0,0 +1,27 @@
1
+ """Utility functions for AAS standard parser."""
2
+
3
+ import json
4
+ from pathlib import Path
5
+
6
+ from aas_http_client import sdk_tools
7
+ from basyx.aas import model
8
+
9
+
10
+ def create_submodel_from_file(file_path: str) -> model.Submodel:
11
+ """Loads a Submodel structure from a given JSON file and converts it into a model.Submodel object from the python SDK framework.
12
+
13
+ :param file_path: Path to the JSON file containing the Submodel structure.
14
+ :return: A model.Submodel object representing the loaded Submodel structure.
15
+ """
16
+ file = Path(file_path)
17
+ if not file.exists():
18
+ raise FileNotFoundError(f"Submodel structure file not found: {file}")
19
+
20
+ template_data = {}
21
+
22
+ # Load the template JSON file
23
+ with file.open("r", encoding="utf-8") as f:
24
+ template_data = json.load(f)
25
+
26
+ # Load the template JSON into a Submodel object
27
+ return sdk_tools.convert_to_object(template_data)
@@ -0,0 +1,28 @@
1
+ """Utility functions for version checking."""
2
+
3
+ import importlib.metadata
4
+ import logging
5
+
6
+ import requests
7
+
8
+ logger = logging.getLogger(__name__)
9
+
10
+
11
+ def check_for_update(package_name="aas-standard-parser"):
12
+ """Check for updates of the package on PyPI.
13
+
14
+ :param package_name: The name of the package to check for updates, defaults to "aas-standard-parser"
15
+ """
16
+ try:
17
+ current_version = importlib.metadata.version(package_name)
18
+ pypi_url = f"https://pypi.org/pypi/{package_name}/json"
19
+ latest_version = requests.get(pypi_url, timeout=3).json()["info"]["version"]
20
+
21
+ if current_version != latest_version:
22
+ print(
23
+ f"⚠️ A new version for package '{package_name}' is available: "
24
+ f"{latest_version} (currently installed: {current_version}). "
25
+ f"Use the following command to update the package: pip install --upgrade {package_name}"
26
+ )
27
+ except Exception as exc:
28
+ logger.exception(f"Exception occurred while checking for package update: {exc}")
@@ -0,0 +1,92 @@
1
+ Metadata-Version: 2.4
2
+ Name: aas-standard-parser
3
+ Version: 0.2.7
4
+ Summary: Some auxiliary functions for parsing standard submodels
5
+ Author-email: Daniel Klein <daniel.klein@em.ag>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2025 Fluid4.0
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/fluid40/aas-http-client
29
+ Description-Content-Type: text/markdown
30
+ License-File: LICENSE
31
+ Requires-Dist: typing>=3.7.4.3
32
+ Requires-Dist: basyx-python-sdk>=1.2.1
33
+ Dynamic: license-file
34
+
35
+ # aas-standard-parser
36
+
37
+ <div align="center">
38
+ <!-- change this to your projects logo if you have on.
39
+ If you don't have one it might be worth trying chatgpt dall-e to create one for you...
40
+ -->
41
+ <img src="docs/assets/fluid_logo.svg" alt="aas_http_client" width=500 />
42
+ </div>
43
+
44
+ ---
45
+
46
+ [![License: MIT](https://img.shields.io/badge/license-MIT-%23f8a602?label=License&labelColor=%23992b2e)](LICENSE)
47
+ [![CI](https://github.com/fluid40/aas-standard-parser/actions/workflows/CI.yml/badge.svg?branch=main&cache-bust=1)](https://github.com/fluid40/aas-standard-parser/actions)
48
+ [![PyPI version](https://img.shields.io/pypi/v/aas-standard-parser.svg)](https://pypi.org/project/aas-standard-parser/)
49
+
50
+
51
+ This project provides tools for parsing and handling Asset Administration Shell (AAS) standard submodels, with a focus on AID and AIMC submodels. It enables:
52
+
53
+ - Extraction, interpretation, and mapping of submodel elements and their properties
54
+ - Working with references, semantic IDs, and submodel element collections
55
+ - Representation and processing of mapping configurations and source-sink relations
56
+ - Structured and colored logging, including log file management
57
+
58
+ These components enable efficient parsing, transformation, and analysis of AAS submodels in Python-based workflows.
59
+ > **Note:** Most functions in this project utilize the [python aas sdk framework](https://github.com/aas-core-works/aas-core3.0-python) for parsing and handling AAS submodels, ensuring compatibility with the official AAS data models and structures.
60
+ ---
61
+
62
+ ## Provided Parsers
63
+
64
+ - **AID Parser**: Parses AID submodels to extract interface descriptions, properties, and security/authentication details.
65
+ - **AIMC Parser**: Parses AIMC submodels to extract and process mapping configurations and source-sink relations.
66
+ - **AAS Parser**: Utilities to extract submodel IDs from an Asset Administration Shell.
67
+ - **Submodel Parser**: Helpers to retrieve submodel elements by semantic ID or by path within a submodel.
68
+
69
+ ## Helper Modules
70
+
71
+ - **Collection Helpers**: Functions to search and filter submodel elements by semantic ID, idShort, or supplemental semantic ID within collections.
72
+ - **Reference Helpers**: Utilities for working with references, such as constructing idShort paths and extracting values from reference keys.
73
+ - **Utilities**: General utility functions, including loading a submodel from a file.
74
+
75
+ ---
76
+
77
+ ## API References
78
+ - AID Parser
79
+ - AIMC Parser
80
+ - [AAS Parser](docs/api_references/api_aas_parser.md)
81
+ - [Submodel Parser](docs/api_references/api_submodel_parser.md)
82
+ - Collection Helpers
83
+ - [Reference Helpers](docs/api_references/api_reference_helpers.md)
84
+ - [Utilities](docs/api_references/api_utils.md)
85
+
86
+ ## Resources
87
+
88
+ 🤖 [Releases](http://github.com/fluid40/aas-standard-parser/releases)
89
+
90
+ 📦 [Pypi Packages](https://pypi.org/project/aas-standard-parser/)
91
+
92
+ 📜 [MIT License](LICENSE)
@@ -7,8 +7,10 @@ aas_standard_parser/aid_parser.py
7
7
  aas_standard_parser/aimc_parser.py
8
8
  aas_standard_parser/collection_helpers.py
9
9
  aas_standard_parser/reference_helpers.py
10
+ aas_standard_parser/submodel_json_parser.py
10
11
  aas_standard_parser/submodel_parser.py
11
12
  aas_standard_parser/utils.py
13
+ aas_standard_parser/version_check.py
12
14
  aas_standard_parser.egg-info/PKG-INFO
13
15
  aas_standard_parser.egg-info/SOURCES.txt
14
16
  aas_standard_parser.egg-info/dependency_links.txt
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "aas-standard-parser"
7
- version = "0.2.6"
7
+ version = "0.2.7"
8
8
  description = "Some auxiliary functions for parsing standard submodels"
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
@@ -1,36 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: aas-standard-parser
3
- Version: 0.2.6
4
- Summary: Some auxiliary functions for parsing standard submodels
5
- Author-email: Daniel Klein <daniel.klein@em.ag>
6
- License: MIT License
7
-
8
- Copyright (c) 2025 Fluid4.0
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy
11
- of this software and associated documentation files (the "Software"), to deal
12
- in the Software without restriction, including without limitation the rights
13
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- copies of the Software, and to permit persons to whom the Software is
15
- furnished to do so, subject to the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be included in all
18
- copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- SOFTWARE.
27
-
28
- Project-URL: Homepage, https://github.com/fluid40/aas-http-client
29
- Description-Content-Type: text/markdown
30
- License-File: LICENSE
31
- Requires-Dist: typing>=3.7.4.3
32
- Requires-Dist: basyx-python-sdk>=1.2.1
33
- Dynamic: license-file
34
-
35
- # aas-standard-parser
36
- Some auxiliary functions for parsing standard submodels
@@ -1,2 +0,0 @@
1
- # aas-standard-parser
2
- Some auxiliary functions for parsing standard submodels
@@ -1,19 +0,0 @@
1
- import importlib.metadata
2
- from datetime import datetime
3
-
4
- # TODO: introduce MIT license
5
- __copyright__ = f"Copyright (C) {datetime.now().year} :em engineering methods AG. All rights reserved."
6
- __author__ = "Daniel Klein, Celina Adelhardt, Tom Gneuß"
7
-
8
- try:
9
- __version__ = importlib.metadata.version(__name__)
10
- except importlib.metadata.PackageNotFoundError:
11
- __version__ = "0.0.0-dev"
12
-
13
- __project__ = "aas-standard-parser"
14
- __package__ = "aas-standard-parser"
15
-
16
- from aas_standard_parser import aas_parser, aid_parser, aimc_parser, submodel_parser
17
- from aas_standard_parser.aid_parser import AIDParser
18
-
19
- __all__ = ["AIDParser", "aimc_parser", "aas_parser", "aid_parser", "submodel_parser"]
@@ -1,25 +0,0 @@
1
- import json
2
- from pathlib import Path
3
-
4
- from aas_http_client import sdk_tools
5
- from basyx.aas import model
6
-
7
-
8
- def create_submodel_from_file(file_path: str) -> model.Submodel:
9
- """Creates a Submodel from a given file path.
10
-
11
- :param file_path: Path to the file containing the submodel data.
12
- :return: The created Submodel object.
13
- """
14
- file = Path(file_path)
15
- if not file.exists():
16
- raise FileNotFoundError(f"Submodel template file not found: {file}")
17
-
18
- template_data = {}
19
-
20
- # Load the template JSON file
21
- with open(file, "r", encoding="utf-8") as f:
22
- template_data = json.load(f)
23
-
24
- # Load the template JSON into a Submodel object
25
- return sdk_tools.convert_to_object(template_data)
@@ -1,36 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: aas-standard-parser
3
- Version: 0.2.6
4
- Summary: Some auxiliary functions for parsing standard submodels
5
- Author-email: Daniel Klein <daniel.klein@em.ag>
6
- License: MIT License
7
-
8
- Copyright (c) 2025 Fluid4.0
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy
11
- of this software and associated documentation files (the "Software"), to deal
12
- in the Software without restriction, including without limitation the rights
13
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- copies of the Software, and to permit persons to whom the Software is
15
- furnished to do so, subject to the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be included in all
18
- copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- SOFTWARE.
27
-
28
- Project-URL: Homepage, https://github.com/fluid40/aas-http-client
29
- Description-Content-Type: text/markdown
30
- License-File: LICENSE
31
- Requires-Dist: typing>=3.7.4.3
32
- Requires-Dist: basyx-python-sdk>=1.2.1
33
- Dynamic: license-file
34
-
35
- # aas-standard-parser
36
- Some auxiliary functions for parsing standard submodels