labfreed 1.0.0a9__tar.gz → 1.0.0a10__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 (74) hide show
  1. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/PKG-INFO +1 -1
  2. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/__init__.py +1 -1
  3. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_attributes/api_data_models/request.py +1 -1
  4. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_attributes/client/client.py +1 -1
  5. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_attributes/pythonic/attribute_server_factory.py +33 -26
  6. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  7. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/.github/workflows/pypi-publish.yml +0 -0
  8. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/.github/workflows/run-tests.yml +0 -0
  9. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/CHANGELOG.md +0 -0
  10. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/LICENSE +0 -0
  11. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/README.md +0 -0
  12. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/labfreed_extended/app/app_infrastructure.py +0 -0
  13. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/labfreed_extended/app/formatted_print.py +0 -0
  14. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/labfreed_extended/app/pac_info/html_renderer/external-link.svg +0 -0
  15. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/labfreed_extended/app/pac_info/html_renderer/macros.jinja.html +0 -0
  16. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/labfreed_extended/app/pac_info/html_renderer/pac-info-style.css +0 -0
  17. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/labfreed_extended/app/pac_info/html_renderer/pac_info.jinja.html +0 -0
  18. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/labfreed_extended/app/pac_info/html_renderer/pac_info_card.jinja.html +0 -0
  19. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/labfreed_extended/app/pac_info/pac_info.py +0 -0
  20. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/labfreed_infrastructure.py +0 -0
  21. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_attributes/__init__.py +0 -0
  22. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_attributes/api_data_models/response.py +0 -0
  23. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_attributes/api_data_models/server_capabilities_response.py +0 -0
  24. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_attributes/client/__init__.py +0 -0
  25. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_attributes/client/attribute_cache.py +0 -0
  26. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_attributes/pythonic/excel_attribute_data_source.py +0 -0
  27. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_attributes/pythonic/py_attributes.py +0 -0
  28. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_attributes/pythonic/py_dict_data_source.py +0 -0
  29. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_attributes/server/__init__.py +0 -0
  30. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_attributes/server/attribute_data_sources.py +0 -0
  31. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_attributes/server/server.py +0 -0
  32. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_attributes/server/translation_data_sources.py +0 -0
  33. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_attributes/well_knonw_attribute_keys.py +0 -0
  34. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_cat/__init__.py +0 -0
  35. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_cat/category_base.py +0 -0
  36. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_cat/pac_cat.py +0 -0
  37. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_cat/predefined_categories.py +0 -0
  38. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_id/__init__.py +0 -0
  39. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_id/extension.py +0 -0
  40. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_id/id_segment.py +0 -0
  41. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_id/pac_id.py +0 -0
  42. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_id/url_parser.py +0 -0
  43. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_id/url_serializer.py +0 -0
  44. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_id_resolver/__init__.py +0 -0
  45. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_id_resolver/cit_common.py +0 -0
  46. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_id_resolver/cit_v1.py +0 -0
  47. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_id_resolver/cit_v2.py +0 -0
  48. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_id_resolver/resolver.py +0 -0
  49. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/pac_id_resolver/services.py +0 -0
  50. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/qr/__init__.py +0 -0
  51. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/qr/generate_qr.py +0 -0
  52. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/trex/__init__.py +0 -0
  53. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/trex/pythonic/__init__.py +0 -0
  54. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/trex/pythonic/data_table.py +0 -0
  55. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/trex/pythonic/pyTREX.py +0 -0
  56. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/trex/pythonic/quantity.py +0 -0
  57. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/trex/table_segment.py +0 -0
  58. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/trex/trex.py +0 -0
  59. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/trex/trex_base_models.py +0 -0
  60. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/trex/value_segments.py +0 -0
  61. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/utilities/base36.py +0 -0
  62. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/utilities/ensure_utc_time.py +0 -0
  63. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/utilities/translations.py +0 -0
  64. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/well_known_extensions/__init__.py +0 -0
  65. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/well_known_extensions/default_extension_interpreters.py +0 -0
  66. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/well_known_extensions/display_name_extension.py +0 -0
  67. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/well_known_extensions/trex_extension.py +0 -0
  68. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/well_known_keys/gs1/__init__.py +0 -0
  69. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/well_known_keys/gs1/gs1_ai_enum_sorted.py +0 -0
  70. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/well_known_keys/labfreed/well_known_keys.py +0 -0
  71. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/well_known_keys/unece/UneceUnits.json +0 -0
  72. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/well_known_keys/unece/__init__.py +0 -0
  73. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/labfreed/well_known_keys/unece/unece_units.py +0 -0
  74. {labfreed-1.0.0a9 → labfreed-1.0.0a10}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: labfreed
3
- Version: 1.0.0a9
3
+ Version: 1.0.0a10
4
4
  Summary: Python implementation of LabFREED building blocks
5
5
  Author-email: Reto Thürer <thuerer.r@buchi.com>
6
6
  Requires-Python: >=3.11
@@ -2,7 +2,7 @@
2
2
  Python implementation of LabFREED building blocks
3
3
  '''
4
4
 
5
- __version__ = "1.0.0a9"
5
+ __version__ = "1.0.0a10"
6
6
 
7
7
  from labfreed.pac_id import * # noqa: F403
8
8
  from labfreed.pac_cat import * # noqa: F403
@@ -8,7 +8,7 @@ class AttributeRequestPayload(LabFREED_BaseModel):
8
8
  model_config = ConfigDict(frozen=True)
9
9
 
10
10
  pac_ids: list[str]
11
- language_preferences: list[str]
11
+ language_preferences: list[str]|None = None
12
12
  restrict_to_attribute_groups: list[str]|None = None
13
13
  suppress_forward_lookup: bool = False
14
14
 
@@ -142,7 +142,7 @@ class AttributeClient():
142
142
  r = AttributeResponsePayload.model_validate_json(response_body_str)
143
143
  except ValidationError as e:
144
144
  print(e)
145
- raise AttributeServerError("The server accepted the request, and sent a reponse. However, the response is adhering to the PAC Attributes specifications. Contact the server admin.")
145
+ raise AttributeServerError("The server accepted the request, and sent a reponse. However, the response is not adhering to the PAC Attributes specifications. Contact the server admin.")
146
146
 
147
147
 
148
148
  # update cache
@@ -1,7 +1,7 @@
1
1
  from enum import Enum
2
2
  from typing import Any, Protocol
3
3
 
4
- from flask import Blueprint, current_app
4
+ from flask import Blueprint, current_app, url_for
5
5
  from labfreed.pac_attributes.api_data_models.request import AttributeRequestPayload
6
6
  from labfreed.pac_attributes.server.server import AttributeGroupDataSource, AttributeServerRequestHandler, InvalidRequestError, TranslationDataSource
7
7
 
@@ -87,7 +87,7 @@ class AttributeFlaskApp(Flask):
87
87
  except Exception as e:
88
88
  print(e)
89
89
  return "The request was valid, but the server encountered an error", 500
90
- return response_body
90
+ return (response_body, 200, {"Content-Type": "application/json"})
91
91
 
92
92
  @bp.route("/", methods=["GET"], strict_slashes=False)
93
93
  def capabilities():
@@ -96,31 +96,38 @@ class AttributeFlaskApp(Flask):
96
96
  authentication_required = bool(current_app.config.get('AUTHENTICATOR'))
97
97
  example_request = AttributeRequestPayload(pac_ids=['HTTPS://PAC.METTORIUS.COM/EXAMPLE'], language_preferences=['fr', 'de']).model_dump_json(indent=2, exclude_none=True, exclude_unset=True)
98
98
  server_address = request.url.rstrip('/')
99
+ css_url = url_for("static", filename="style.css")
99
100
  response = f'''
100
- <body>
101
- This is a <h1>LabFREED attribute server </h1>
102
- <h2>Capabilities</h2>
103
- Available Attribute Groups: {', '.join([f'<a href="{ag}"> {ag} </a>' for ag in capabilities.available_attribute_groups])} <br>
104
-
105
- Supported Languages: {', '.join([f'<b> {l} </b>' for l in capabilities.supported_languages])} <br>
106
- Default Language: <b>{capabilities.default_language}</b> <br>
107
-
108
-
109
- <h2>How to use</h2>
110
- Make a <b>POST</b> request to <a href="{server_address}">{server_address}</a> with the following body:
111
- <pre>{example_request}</pre>
112
- Consult <a href="https://github.com/ApiniLabs/PAC-Attributes"> the specification </a> for details. <br>
113
-
114
-
115
- {'This server <b> requires authentication </b> ' if authentication_required else ''}
116
- <br>
117
-
118
- {"<h2>Further Information</h2>"if doc_text else ""}
119
- {doc_text or ""}
120
-
121
-
122
- </body>
123
- '''
101
+ <html>
102
+ <head>
103
+ <link rel="stylesheet" type="text/css" href="{css_url}">
104
+ </head>
105
+
106
+ <body>
107
+ This is a <h1>LabFREED attribute server </h1>
108
+ <h2>Capabilities</h2>
109
+ Available Attribute Groups: {', '.join([f'<a href="{ag}"> {ag} </a>' for ag in capabilities.available_attribute_groups])} <br>
110
+
111
+ Supported Languages: {', '.join([f'<b> {l} </b>' for l in capabilities.supported_languages])} <br>
112
+ Default Language: <b>{capabilities.default_language}</b> <br>
113
+
114
+
115
+ <h2>How to use</h2>
116
+ Make a <b>POST</b> request to <a href="{server_address}">{server_address}</a> with the following body:
117
+ <pre>{example_request}</pre>
118
+ Consult <a href="https://github.com/ApiniLabs/PAC-Attributes"> the specification </a> for details. <br>
119
+
120
+
121
+ {'This server <b> requires authentication </b> ' if authentication_required else ''}
122
+ <br>
123
+
124
+ {"<h2>Further Information</h2>"if doc_text else ""}
125
+ {doc_text or ""}
126
+
127
+
128
+ </body>
129
+ </html>
130
+ '''
124
131
 
125
132
  return response
126
133
 
File without changes
File without changes
File without changes
File without changes