labfreed 1.0.0a17__tar.gz → 1.0.0a18__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.
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/PKG-INFO +1 -1
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/__init__.py +1 -1
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/labfreed_extended/app/app_infrastructure.py +1 -1
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_attributes/api_data_models/response.py +4 -3
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_attributes/client/client.py +1 -1
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_attributes/pythonic/attribute_server_factory.py +1 -1
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_attributes/pythonic/py_attributes.py +8 -5
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/.github/workflows/pypi-publish.yml +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/.github/workflows/run-tests.yml +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/CHANGELOG.md +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/LICENSE +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/README.md +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/labfreed_extended/app/formatted_print.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/labfreed_extended/app/pac_info/html_renderer/external-link.svg +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/labfreed_extended/app/pac_info/html_renderer/macros.jinja.html +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/labfreed_extended/app/pac_info/html_renderer/pac-info-style.css +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/labfreed_extended/app/pac_info/html_renderer/pac_info.jinja.html +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/labfreed_extended/app/pac_info/html_renderer/pac_info_card.jinja.html +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/labfreed_extended/app/pac_info/pac_info.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/labfreed_infrastructure.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_attributes/__init__.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_attributes/api_data_models/request.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_attributes/api_data_models/server_capabilities_response.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_attributes/client/__init__.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_attributes/client/attribute_cache.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_attributes/pythonic/excel_attribute_data_source.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_attributes/pythonic/py_dict_data_source.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_attributes/server/__init__.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_attributes/server/attribute_data_sources.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_attributes/server/server.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_attributes/server/translation_data_sources.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_attributes/well_knonw_attribute_keys.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_cat/__init__.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_cat/category_base.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_cat/pac_cat.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_cat/predefined_categories.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_id/__init__.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_id/extension.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_id/id_segment.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_id/pac_id.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_id/url_parser.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_id/url_serializer.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_id_resolver/__init__.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_id_resolver/cit_v1.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_id_resolver/resolver.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_id_resolver/resolver_config.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_id_resolver/resolver_config_common.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_id_resolver/services.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/qr/__init__.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/qr/generate_qr.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/trex/__init__.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/trex/pythonic/__init__.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/trex/pythonic/data_table.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/trex/pythonic/pyTREX.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/trex/pythonic/quantity.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/trex/table_segment.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/trex/trex.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/trex/trex_base_models.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/trex/value_segments.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/utilities/base36.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/utilities/ensure_utc_time.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/utilities/translations.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/well_known_extensions/__init__.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/well_known_extensions/default_extension_interpreters.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/well_known_extensions/display_name_extension.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/well_known_extensions/text_base36_extension.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/well_known_extensions/trex_extension.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/well_known_keys/gs1/__init__.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/well_known_keys/gs1/gs1_ai_enum_sorted.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/well_known_keys/labfreed/well_known_keys.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/well_known_keys/unece/UneceUnits.json +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/well_known_keys/unece/__init__.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/well_known_keys/unece/unece_units.py +0 -0
- {labfreed-1.0.0a17 → labfreed-1.0.0a18}/pyproject.toml +0 -0
{labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/labfreed_extended/app/app_infrastructure.py
RENAMED
|
@@ -44,7 +44,7 @@ class Labfreed_App_Infrastructure():
|
|
|
44
44
|
self._resolver._resolver_configs.discard(resolver_config)
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
def process_pac(self, pac_url
|
|
47
|
+
def process_pac(self, pac_url) -> PacInfo:
|
|
48
48
|
if not isinstance(pac_url, PAC_ID):
|
|
49
49
|
pac = PAC_ID.from_url(pac_url)
|
|
50
50
|
else:
|
|
@@ -38,7 +38,7 @@ class DateTimeAttribute(AttributeBase):
|
|
|
38
38
|
type: Literal["datetime"]
|
|
39
39
|
value: datetime
|
|
40
40
|
|
|
41
|
-
@field_validator('value', mode='
|
|
41
|
+
@field_validator('value', mode='after')
|
|
42
42
|
def set_utc__if_naive(cls, value):
|
|
43
43
|
if isinstance(value, datetime):
|
|
44
44
|
return ensure_utc(value)
|
|
@@ -49,14 +49,15 @@ class DateTimeListAttribute(AttributeBase):
|
|
|
49
49
|
type: Literal["datetime-list"]
|
|
50
50
|
value: list[datetime]
|
|
51
51
|
|
|
52
|
-
@field_validator('value', mode='
|
|
52
|
+
@field_validator('value', mode='after')
|
|
53
53
|
def set_utc__if_naive(cls, value):
|
|
54
54
|
value_out = []
|
|
55
55
|
for v in value:
|
|
56
56
|
if isinstance(v, datetime):
|
|
57
57
|
value_out.append(ensure_utc(v))
|
|
58
58
|
else:
|
|
59
|
-
|
|
59
|
+
raise ValueError(f'{v} is of type {type(v)}. It must be datetime')
|
|
60
|
+
return value_out
|
|
60
61
|
|
|
61
62
|
|
|
62
63
|
|
|
@@ -51,7 +51,7 @@ def http_attribute_request_default_callback_factory(session: requests.Session =
|
|
|
51
51
|
|
|
52
52
|
def callback(url: str, attribute_request_body: str) -> tuple[int, str]:
|
|
53
53
|
try:
|
|
54
|
-
resp = session.post(url, data=attribute_request_body, headers={'Content-Type': 'application/json'}, timeout=10)
|
|
54
|
+
resp = session.post(url, data=attribute_request_body, headers={'Content-Type': 'application/json; ; charset=utf-8'}, timeout=10)
|
|
55
55
|
return resp.status_code, resp.text
|
|
56
56
|
except requests.exceptions.RequestException as e:
|
|
57
57
|
return 500, str(e)
|
{labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_attributes/pythonic/attribute_server_factory.py
RENAMED
|
@@ -86,7 +86,7 @@ class AttributeFlaskApp(Flask):
|
|
|
86
86
|
except Exception as e:
|
|
87
87
|
print(e)
|
|
88
88
|
return "The request was valid, but the server encountered an error", 500
|
|
89
|
-
return (response_body, 200, {"Content-Type": "application/json"})
|
|
89
|
+
return (response_body, 200, {"Content-Type": "application/json; charset=utf-8"})
|
|
90
90
|
|
|
91
91
|
@bp.route("/", methods=["GET"], strict_slashes=False)
|
|
92
92
|
def capabilities():
|
|
@@ -6,7 +6,7 @@ import warnings
|
|
|
6
6
|
from pydantic import RootModel, field_validator
|
|
7
7
|
|
|
8
8
|
from labfreed.labfreed_infrastructure import LabFREED_BaseModel
|
|
9
|
-
from labfreed.pac_attributes.api_data_models.response import AttributeBase, AttributeGroup, BoolAttribute, BoolListAttribute, DateTimeAttribute, DateTimeListAttribute, NumericAttribute, NumericListAttribute, NumericValue, ObjectAttribute, ReferenceAttribute, ReferenceListAttribute, ResourceAttribute, ResourceListAttribute, TextAttribute, TextListAttribute
|
|
9
|
+
from labfreed.pac_attributes.api_data_models.response import AttributeBase, AttributeGroup, BoolAttribute, BoolListAttribute, DateTimeAttribute, DateTimeListAttribute, NumericAttribute, NumericListAttribute, NumericValue, ObjectAttribute,ObjectListAttribute, ReferenceAttribute, ReferenceListAttribute, ResourceAttribute, ResourceListAttribute, TextAttribute, TextListAttribute
|
|
10
10
|
from labfreed.pac_attributes.client.attribute_cache import CacheableAttributeGroup
|
|
11
11
|
from labfreed.pac_id.pac_id import PAC_ID
|
|
12
12
|
from labfreed.trex.pythonic.quantity import Quantity
|
|
@@ -141,7 +141,10 @@ class pyAttributes(RootModel[list[pyAttribute]]):
|
|
|
141
141
|
else: #this covers the last resort case of arbitrary objects. Must be json serializable.
|
|
142
142
|
try :
|
|
143
143
|
values = [json.loads(json.dumps(v)) for v in value_list]
|
|
144
|
-
|
|
144
|
+
if len(values) == 1:
|
|
145
|
+
return ObjectAttribute(value=values[0], **common_args)
|
|
146
|
+
else:
|
|
147
|
+
return ObjectListAttribute(value=values, **common_args)
|
|
145
148
|
except TypeError as e: # noqa: F841
|
|
146
149
|
raise ValueError(f'Invalid Type: {type(first_value)} cannot be converted to attribute. You may want to use ObjectAttribute, but would have to implement the conversion from your python type yourself.')
|
|
147
150
|
|
|
@@ -162,16 +165,16 @@ class pyAttributes(RootModel[list[pyAttribute]]):
|
|
|
162
165
|
case NumericAttribute() | NumericListAttribute():
|
|
163
166
|
values = [ Quantity.from_str_value(value=v.numerical_value, unit=v.unit) for v in value_list]
|
|
164
167
|
|
|
165
|
-
case BoolAttribute() |
|
|
168
|
+
case BoolAttribute() | BoolListAttribute():
|
|
166
169
|
values = value_list
|
|
167
170
|
|
|
168
171
|
case TextAttribute() | TextListAttribute():
|
|
169
172
|
values = value_list
|
|
170
173
|
|
|
171
|
-
case DateTimeAttribute() |
|
|
174
|
+
case DateTimeAttribute() | DateTimeListAttribute():
|
|
172
175
|
values = value_list
|
|
173
176
|
|
|
174
|
-
case ObjectAttribute() |
|
|
177
|
+
case ObjectAttribute() | ObjectListAttribute():
|
|
175
178
|
values = value_list
|
|
176
179
|
|
|
177
180
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_attributes/pythonic/py_dict_data_source.py
RENAMED
|
File without changes
|
|
File without changes
|
{labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_attributes/server/attribute_data_sources.py
RENAMED
|
File without changes
|
|
File without changes
|
{labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_attributes/server/translation_data_sources.py
RENAMED
|
File without changes
|
{labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/pac_attributes/well_knonw_attribute_keys.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/well_known_extensions/display_name_extension.py
RENAMED
|
File without changes
|
{labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/well_known_extensions/text_base36_extension.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{labfreed-1.0.0a17 → labfreed-1.0.0a18}/labfreed/well_known_keys/labfreed/well_known_keys.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|