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

@@ -8,6 +8,9 @@ __version__ = importlib.metadata.version(__name__)
8
8
  __project__ = "aas-http-client"
9
9
  __package__ = "aas-http-client"
10
10
 
11
+ from aas_http_client.core.version_check import check_for_update
11
12
  from aas_http_client.client import create_client_by_config, create_client_by_url, AasxServerInterface
12
13
 
13
- __all__ = ["create_client_by_config", "create_client_by_url"]
14
+ check_for_update()
15
+
16
+ __all__ = ["create_client_by_config", "create_client_by_url", "AasxServerInterface"]
aas_http_client/client.py CHANGED
@@ -10,7 +10,7 @@ import basyx.aas.adapter.json
10
10
  import basyx.aas.adapter.json.json_serialization as js
11
11
  import requests
12
12
  from basyx.aas.model import AssetAdministrationShell, Reference, Submodel
13
- from core.encoder import decode_base_64, encode_base_64
13
+ from aas_http_client.core.encoder import decode_base_64, encode_base_64
14
14
  from pydantic import BaseModel, PrivateAttr, ValidationError
15
15
  from requests import Session
16
16
  from requests.auth import HTTPBasicAuth
@@ -0,0 +1,17 @@
1
+ import requests
2
+ import importlib.metadata
3
+
4
+ def check_for_update(package_name="aas-http-client"):
5
+ try:
6
+ current_version = importlib.metadata.version(package_name)
7
+ pypi_url = f"https://pypi.org/pypi/{package_name}/json"
8
+ latest_version = requests.get(pypi_url, timeout=3).json()["info"]["version"]
9
+
10
+ if current_version != latest_version:
11
+ print(
12
+ f"⚠️ A new version for package '{package_name}' is available: "
13
+ f"{latest_version} (currently installed: {current_version}). "
14
+ f"Use the following command to update the package: pip install --upgrade {package_name}"
15
+ )
16
+ except Exception:
17
+ pass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aas-http-client
3
- Version: 0.1.3
3
+ Version: 0.1.4
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
@@ -0,0 +1,9 @@
1
+ aas_http_client/__init__.py,sha256=0G7BtUBA13vzzs1Nk8-gnnBSJLM6JYrwacxSamC2VSE,577
2
+ aas_http_client/client.py,sha256=J1ze7TXKMiOjA5dDVNrc-GRoxQ_9r7rU8qW8C0yErG0,24206
3
+ aas_http_client/core/encoder.py,sha256=FS7P0FPakzFsGz70eRFDHQZFA_2nlKLlWIxavtnFrPg,660
4
+ aas_http_client/core/version_check.py,sha256=721Zs3xSRrJTYZtAxkaUWg9LLKtpU7oFM62DzQHZdE4,705
5
+ aas_http_client-0.1.4.dist-info/licenses/LICENSE,sha256=simqYMD2P9Ikm0Kh9n7VGNpaVcm2TMVVQmECYZ_xVZ8,1065
6
+ aas_http_client-0.1.4.dist-info/METADATA,sha256=N2VTAX0NAc65x11V9zz2Wk_cHj8vT3mqySi96NSLjOI,2754
7
+ aas_http_client-0.1.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
+ aas_http_client-0.1.4.dist-info/top_level.txt,sha256=vzvoz2vjeTLwpuz-Y-eEfoQ7T3byoaKshVlFMFH5NaM,16
9
+ aas_http_client-0.1.4.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- aas_http_client/__init__.py,sha256=rB1C7XD-5BYvgx7HanHekZxgYxePk8hOB4EFSbaLjy0,470
2
- aas_http_client/client.py,sha256=MYLOedeslxw2Seyxd_zon87ryCosifiFOu8WJ7zcBGU,24190
3
- aas_http_client/core/encoder.py,sha256=FS7P0FPakzFsGz70eRFDHQZFA_2nlKLlWIxavtnFrPg,660
4
- aas_http_client-0.1.3.dist-info/licenses/LICENSE,sha256=simqYMD2P9Ikm0Kh9n7VGNpaVcm2TMVVQmECYZ_xVZ8,1065
5
- aas_http_client-0.1.3.dist-info/METADATA,sha256=20IKKrib_BEHGL5PwwJMY0THlDh1UX-atrJ3ohFFUbo,2754
6
- aas_http_client-0.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
- aas_http_client-0.1.3.dist-info/top_level.txt,sha256=vzvoz2vjeTLwpuz-Y-eEfoQ7T3byoaKshVlFMFH5NaM,16
8
- aas_http_client-0.1.3.dist-info/RECORD,,