aas-standard-parser 0.2.7__py3-none-any.whl → 0.2.8__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.
@@ -10,23 +10,25 @@ def get_value_from_semantic_id_by_index(submodel_data: dict, index: int) -> str
10
10
 
11
11
  :param submodel_data: The submodel data as a dictionary.
12
12
 
13
- :param index: The index to access if the element is a list or collection.
13
+ :param index: The index to access if the element is a list or collection, defaults to 0.
14
14
  :return: The value of the found submodel element or None if not found.
15
15
  """
16
- if "semantic_id" not in submodel_data or len(submodel_data.semantic_id.key) == 0:
16
+ if "semanticId" not in submodel_data:
17
17
  logger.debug(f"Submodel '{submodel_data}' has no semantic ID")
18
18
  return None
19
19
 
20
- sm_semantic_id = submodel_data.get("semantic_id", {})
20
+ sm_semantic_id = submodel_data.get("semanticId", {})
21
21
  if "keys" not in sm_semantic_id or len(sm_semantic_id["keys"]) == 0:
22
22
  logger.debug(f"Submodel '{submodel_data}' has no semantic ID keys")
23
23
  return None
24
24
 
25
- if len(sm_semantic_id["keys"]) < index + 1:
25
+ keys = sm_semantic_id.get("keys", [])
26
+
27
+ if len(keys) < index + 1:
26
28
  logger.debug(f"Submodel '{submodel_data}' has no semantic ID key at index {index}")
27
29
  return None
28
30
 
29
- key = sm_semantic_id["keys"][index]
31
+ key = keys[index]
30
32
 
31
33
  if "value" not in key:
32
34
  logger.debug(f"Submodel '{submodel_data}' has no semantic ID value")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aas-standard-parser
3
- Version: 0.2.7
3
+ Version: 0.2.8
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
@@ -4,15 +4,15 @@ aas_standard_parser/aid_parser.py,sha256=9vp8_kJRfExTmw8tjmO32n1eHFAE5ItmfPlZ2OR
4
4
  aas_standard_parser/aimc_parser.py,sha256=3GSM-jBj-9OqNDnL7CssqogNOZEd7_fjRtxwzRZi-iA,9972
5
5
  aas_standard_parser/collection_helpers.py,sha256=fTQGQiC-bGD41Qx0FDDBtWhvkeZtEe6Sh-aT93ePwro,4153
6
6
  aas_standard_parser/reference_helpers.py,sha256=HJMK1FjoEkPipw9kcT7k75EYioHz_SwcLLqXdFo9Eew,1339
7
- aas_standard_parser/submodel_json_parser.py,sha256=uy1tEQH5AAiysVbtwLHEK_V_bVRMx7SMQLhhm6m3MOc,1260
7
+ aas_standard_parser/submodel_json_parser.py,sha256=Sab5d4xJyKp80inAaNg71mTSLSGbfEl-KJ6wI0zOoQg,1237
8
8
  aas_standard_parser/submodel_parser.py,sha256=cKDKUBoKMJb1q6ISalJhLlE1VRqqFHTDWsv6BdeSmXU,2653
9
9
  aas_standard_parser/utils.py,sha256=TSOvTZxhPp4s63rn-xzLQasDxEiHyk6BcHhIkzaUTek,905
10
10
  aas_standard_parser/version_check.py,sha256=P1nb2WvVVU5RaQ4mWViFLnF9QkUv61Zc2EApYPGiiC8,1058
11
11
  aas_standard_parser/classes/aimc_parser_classes.py,sha256=PwKpuyB36urFc8YqQ6KtrG8H5WLd-3R2c3yST8Yyc_w,2581
12
12
  aas_standard_parser/demo/demo_process.py,sha256=Xn9uD0xLoNx0ZvB3Lk0oYkGBRHaEfUbfqv5_SpPWYck,530
13
13
  aas_standard_parser/demo/logging_handler.py,sha256=x-eX4XDU3sZTJE22rzJSiaWQ8wRMbtaFpFBAeAcbIzI,5752
14
- aas_standard_parser-0.2.7.dist-info/licenses/LICENSE,sha256=simqYMD2P9Ikm0Kh9n7VGNpaVcm2TMVVQmECYZ_xVZ8,1065
15
- aas_standard_parser-0.2.7.dist-info/METADATA,sha256=hLgmuUuUXjM6FkGYoPFajsss7XUdzv48apwg0wI5Ru0,4502
16
- aas_standard_parser-0.2.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
- aas_standard_parser-0.2.7.dist-info/top_level.txt,sha256=OQaK6cwYttR1-eKTz5u4M0jbwSfp4HqJ56chaf0nHnw,20
18
- aas_standard_parser-0.2.7.dist-info/RECORD,,
14
+ aas_standard_parser-0.2.8.dist-info/licenses/LICENSE,sha256=simqYMD2P9Ikm0Kh9n7VGNpaVcm2TMVVQmECYZ_xVZ8,1065
15
+ aas_standard_parser-0.2.8.dist-info/METADATA,sha256=iYZ1gBaUPbyY_nCzfDQxeo9LGeLycKaaL1vDw2FoH7A,4502
16
+ aas_standard_parser-0.2.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
+ aas_standard_parser-0.2.8.dist-info/top_level.txt,sha256=OQaK6cwYttR1-eKTz5u4M0jbwSfp4HqJ56chaf0nHnw,20
18
+ aas_standard_parser-0.2.8.dist-info/RECORD,,