aas-http-client 0.1.5__py3-none-any.whl → 0.1.6__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.

Potentially problematic release.


This version of aas-http-client might be problematic. Click here for more details.

@@ -14,7 +14,9 @@ __package__ = "aas-http-client"
14
14
 
15
15
  from aas_http_client.core.version_check import check_for_update
16
16
  from aas_http_client.client import create_client_by_config, create_client_by_url, AasHttpClient
17
+ from aas_http_client.utilities import model_builder
18
+ from aas_http_client.wrapper.sdk_wrapper import create_wrapper_by_config, create_wrapper_by_url, SdkWrapper
17
19
 
18
20
  check_for_update()
19
21
 
20
- __all__ = ["create_client_by_config", "create_client_by_url", "AasHttpClient"]
22
+ __all__ = ["create_client_by_config", "create_client_by_url", "AasHttpClient", "model_builder", "create_wrapper_by_config", "create_wrapper_by_url", "SdkWrapper"]
aas_http_client/client.py CHANGED
@@ -166,7 +166,7 @@ class AasHttpClient(BaseModel):
166
166
 
167
167
  return True
168
168
 
169
- def put_shells_submodels(self, aas_id: str, submodel_id: str, submodel_data: dict) -> bool:
169
+ def put_shells_submodels_by_id(self, aas_id: str, submodel_id: str, submodel_data: dict) -> bool:
170
170
  """Update a submodel by its ID for a specific Asset Administration Shell (AAS).
171
171
 
172
172
  :param aas_id: ID of the AAS to update the submodel for
@@ -257,7 +257,7 @@ class AasHttpClient(BaseModel):
257
257
  ref_dict_string = response.content.decode("utf-8")
258
258
  return json.loads(ref_dict_string, cls=basyx.aas.adapter.json.AASFromJsonDecoder)
259
259
 
260
- def get_shells_submodels(self, aas_id: str, submodel_id: str) -> Submodel | None:
260
+ def get_shells_submodels_by_id(self, aas_id: str, submodel_id: str) -> Submodel | None:
261
261
  """Get a submodel by its ID for a specific Asset Administration Shell (AAS).
262
262
 
263
263
  :param aas_id: ID of the AAS to retrieve the submodel from
@@ -268,6 +268,7 @@ class AasHttpClient(BaseModel):
268
268
  decoded_submodel_id: str = decode_base_64(submodel_id)
269
269
 
270
270
  url = f"{self.base_url}/shells/{decoded_aas_id}/submodels/{decoded_submodel_id}"
271
+ #/shells/{aasIdentifier}/submodels/{submodelIdentifier}
271
272
 
272
273
  try:
273
274
  response = self._session.get(url, headers=HEADERS, timeout=self.time_out)
@@ -307,7 +308,7 @@ class AasHttpClient(BaseModel):
307
308
 
308
309
  return True
309
310
 
310
- def post_submodels(self, submodel_data: dict) -> bool:
311
+ def post_submodels(self, submodel_data: dict) -> dict:
311
312
  """Post a submodel to the REST API.
312
313
 
313
314
  :param submodel_data: Json data of the Submodel to post
@@ -327,9 +328,10 @@ class AasHttpClient(BaseModel):
327
328
  logger.error(f"Error call REST API: {e}")
328
329
  return False
329
330
 
330
- return True
331
+ content = response.content.decode("utf-8")
332
+ return json.loads(content)
331
333
 
332
- def put_submodels(self, identifier: str, submodel_data: dict) -> bool:
334
+ def put_submodels_by_id(self, identifier: str, submodel_data: dict) -> bool:
333
335
  """Update a submodel by its ID in the REST API.
334
336
 
335
337
  :param identifier: Identifier of the submodel to update
@@ -353,30 +355,6 @@ class AasHttpClient(BaseModel):
353
355
 
354
356
  return True
355
357
 
356
- def get_submodel_by_id(self, submodel_id: str) -> dict | None:
357
- """Get a submodel by its ID from the REST API.
358
-
359
- :param submodel_id: ID of the submodel to retrieve
360
- :return: Submodel object or None if an error occurred
361
- """
362
- decoded_submodel_id: str = decode_base_64(submodel_id)
363
- url = f"{self.base_url}/submodels/{decoded_submodel_id}"
364
-
365
- try:
366
- response = self._session.get(url, headers=HEADERS, timeout=self.time_out)
367
- logger.debug(f"Call REST API url '{response.url}'")
368
-
369
- if response.status_code != STATUS_CODE_200:
370
- log_response_errors(response)
371
- return None
372
-
373
- except requests.exceptions.RequestException as e:
374
- logger.error(f"Error call REST API: {e}")
375
- return None
376
-
377
- content = response.content.decode("utf-8")
378
- return json.loads(content)
379
-
380
358
  def get_submodels(self) -> list[dict] | None:
381
359
  """Get all submodels from the REST API.
382
360
 
@@ -34,7 +34,10 @@ def create_base_submodel(id_short: str, namespace: str = "basyx_python_aas_serve
34
34
  :param description: description of the Submodel, defaults to ""
35
35
  :return: Submodel instance
36
36
  """
37
- identifier = f"{namespace}/{id_short}"
37
+ if namespace:
38
+ identifier = f"{namespace}/{id_short}"
39
+ else:
40
+ identifier = id_short
38
41
  sm = Submodel(identifier)
39
42
  sm.id_short = id_short
40
43
 
@@ -101,7 +104,10 @@ def create_base_asset_information(id_short: str, namespace: str = "basyx_python_
101
104
  :param namespace: namespace of the AssetInformation, defaults to "basyx_python_aas_server"
102
105
  :return: AssetInformation instance
103
106
  """
104
- identifier = f"{namespace}/{id_short}"
107
+ if namespace:
108
+ identifier = f"{namespace}/{id_short}"
109
+ else:
110
+ identifier = id_short
105
111
  return AssetInformation(AssetKind.INSTANCE, identifier)
106
112
 
107
113
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aas-http-client
3
- Version: 0.1.5
3
+ Version: 0.1.6
4
4
  Summary: Generic HTTP client for communicating with various types of AAS servers
5
5
  Author-email: Daniel Klein <daniel.klein@em.ag>
6
6
  License: MIT License
@@ -32,20 +32,19 @@ Dynamic: license-file
32
32
 
33
33
  <!-- TODO: Go through the readme and enter the information here -->
34
34
 
35
- # BaSyx Python PoC
35
+ # AAS HTTP Client
36
36
 
37
37
  <div align="center">
38
38
  <!-- change this to your projects logo if you have on.
39
39
  If you don't have one it might be worth trying chatgpt dall-e to create one for you...
40
40
  -->
41
- <img src="docs/assets/fluid_logo.svg" alt="basyx_python_poc" width=500 />
41
+ <img src="docs/assets/fluid_logo.svg" alt="aas_http_client" width=500 />
42
42
  </div>
43
43
 
44
44
  ---
45
45
 
46
46
  [![License: em](https://img.shields.io/badge/license-emSL-%23f8a602?label=License&labelColor=%23992b2e)](LICENSES/LicenseRef-em.txt)
47
47
  [![CI](https://github.com/engineering-methods/basyx_python_poc/actions/workflows/ci.yml/badge.svg?branch=master&cache-bust=1)](https://github.com/engineering-methods/basyx_python_poc/actions)
48
- [![codecov](https://codecov.io/gh/engineering-methods/basyx_python_poc/branch/master/graph/badge.svg)](https://codecov.io/gh/engineering-methods/basyx_python_poc)
49
48
 
50
49
  Proof of concept for a AAS application using the BaSyx Python SDK and Python AAS Server.
51
50
 
@@ -58,3 +57,5 @@ Proof of concept for a AAS application using the BaSyx Python SDK and Python AAS
58
57
  👨‍⚕️ [Troubleshooting](docs/troubleshooting.md)
59
58
 
60
59
  🤖 [Releases](https://github.com/engineering-methods/basyx_python_poc/releases)
60
+
61
+ 📦 [Pypi Packages](https://pypi.org/project/aas-http-client/)
@@ -1,15 +1,15 @@
1
- aas_http_client/__init__.py,sha256=M9EBVZcs0jg7v0RaziftjGcOzNET8gsgJ_-oRXNZxDo,657
2
- aas_http_client/client.py,sha256=3I29OJJUPd2tP_46dDntyvzAlcFQHrMD2iEfc_mpn2I,21428
1
+ aas_http_client/__init__.py,sha256=cAr1mQzWp0G0LKtkAOYzc9t95OY3jM3Aj4bKnxx0Dso,901
2
+ aas_http_client/client.py,sha256=KppHWikO21T8Z_JP-bbc9DeyCsgFXQ6xTQoOfETJmcU,20672
3
3
  aas_http_client/core/encoder.py,sha256=FS7P0FPakzFsGz70eRFDHQZFA_2nlKLlWIxavtnFrPg,660
4
4
  aas_http_client/core/version_check.py,sha256=721Zs3xSRrJTYZtAxkaUWg9LLKtpU7oFM62DzQHZdE4,705
5
5
  aas_http_client/demo/demo_process.py,sha256=-9-oQEi_B08W-POl2SVP4COodGPHN3mTw9rrPgLLpeY,2170
6
6
  aas_http_client/demo/logging_handler.py,sha256=VJtZ4u3x_LhYZQtfNck7FuXhGFZm7gid0uDhvf9GjJ8,5596
7
7
  aas_http_client/utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- aas_http_client/utilities/model_builder.py,sha256=bDK9cOrU4vlkQTHTgmeiVftQduKSZSKGAX10weSHQWs,3756
8
+ aas_http_client/utilities/model_builder.py,sha256=jOFTvZPDG08VgrkkRgw0SZz1e_NjVi_Kx2Ty8lqp35I,3886
9
9
  aas_http_client/wrapper/python_sdk_wrapper_tmp.py,sha256=J1ze7TXKMiOjA5dDVNrc-GRoxQ_9r7rU8qW8C0yErG0,24206
10
10
  aas_http_client/wrapper/sdk_wrapper.py,sha256=sUfdawn9TWNbs7YELBTuMKBhiqd_eeQwk-AmzPWgLII,11117
11
- aas_http_client-0.1.5.dist-info/licenses/LICENSE,sha256=simqYMD2P9Ikm0Kh9n7VGNpaVcm2TMVVQmECYZ_xVZ8,1065
12
- aas_http_client-0.1.5.dist-info/METADATA,sha256=0W3KjbyhUkX7Pva9H8Mgl5dhgPl-r7Yce3ni_6w5ajI,2754
13
- aas_http_client-0.1.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
- aas_http_client-0.1.5.dist-info/top_level.txt,sha256=vzvoz2vjeTLwpuz-Y-eEfoQ7T3byoaKshVlFMFH5NaM,16
15
- aas_http_client-0.1.5.dist-info/RECORD,,
11
+ aas_http_client-0.1.6.dist-info/licenses/LICENSE,sha256=simqYMD2P9Ikm0Kh9n7VGNpaVcm2TMVVQmECYZ_xVZ8,1065
12
+ aas_http_client-0.1.6.dist-info/METADATA,sha256=Ex8-ItTIzszynmOTrSapdAHBIfZF8ZJ4zuGdTBRp4YU,2654
13
+ aas_http_client-0.1.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
+ aas_http_client-0.1.6.dist-info/top_level.txt,sha256=vzvoz2vjeTLwpuz-Y-eEfoQ7T3byoaKshVlFMFH5NaM,16
15
+ aas_http_client-0.1.6.dist-info/RECORD,,