labfreed 1.0.0b26__py3-none-any.whl → 1.0.0b27__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.
labfreed/__init__.py CHANGED
@@ -2,7 +2,7 @@
2
2
  Python implementation of LabFREED building blocks
3
3
  '''
4
4
 
5
- __version__ = "1.0.0b26"
5
+ __version__ = "1.0.0b27"
6
6
 
7
7
  from labfreed.pac_id import * # noqa: F403
8
8
  from labfreed.pac_cat import * # noqa: F403
@@ -33,8 +33,12 @@ class AttributeRequestData(LabFREED_BaseModel):
33
33
  if restrict_to_attribute_groups:
34
34
  restrict_to_attribute_groups = restrict_to_attribute_groups.split(',')
35
35
 
36
- fwd_lkp = params.get(ATTR_GROUPS_FWD_LKP,'true')
37
- do_forward_lookup = fwd_lkp.lower() not in ['false', 'no', '0', 'n', 'off']
36
+ fwd_lkp = params.get(ATTR_GROUPS_FWD_LKP, True)
37
+ if fwd_lkp is True:
38
+ do_forward_lookup = True
39
+ else:
40
+ do_fwd_lookup = fwd_lkp.lower() not in ['false', 'no', '0', 'n', 'off']
41
+
38
42
  lang_hdr = headers.get('Accept-Language')
39
43
  language_preferences: LanguageAccept = parse_accept_header(lang_hdr, LanguageAccept)
40
44
  out = cls(pac_id=pac_id,
@@ -91,7 +95,7 @@ class AttributeRequestData(LabFREED_BaseModel):
91
95
  def language_preference_http_header(self) -> dict[str, str]:
92
96
  if not self.language_preferences:
93
97
  return {}
94
- headers={'Accept-Language': LanguageAccept(lq).to_header()}
98
+ headers={'Accept-Language': LanguageAccept(self.language_preferences).to_header()}
95
99
  return headers
96
100
 
97
101
  def request_params(self) -> dict[str, Any]:
@@ -5,6 +5,7 @@ import logging
5
5
  from typing import Literal
6
6
  from enum import Enum
7
7
  import warnings
8
+ from deprecated import deprecated
8
9
  from pydantic import RootModel, field_validator, model_validator
9
10
 
10
11
  from labfreed.labfreed_infrastructure import LabFREED_BaseModel
@@ -44,6 +45,11 @@ class pyAttribute(LabFREED_BaseModel):
44
45
  '''helper function to more conveniently iterate over value elements, even if it's scalar'''
45
46
  return self.values if isinstance(self.values, list) else [self.values]
46
47
 
48
+ @property
49
+ @deprecated
50
+ def value(self):
51
+ return self.values
52
+
47
53
  @model_validator(mode='before')
48
54
  def value_to_values(cls, d:dict):
49
55
  value =d.pop('value', None)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: labfreed
3
- Version: 1.0.0b26
3
+ Version: 1.0.0b27
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
@@ -1,4 +1,4 @@
1
- labfreed/__init__.py,sha256=K7LpEGI6O9AnTM4dJgUI30LchIO5KnqPUh3gpWhhY4Q,339
1
+ labfreed/__init__.py,sha256=wFLmJ74sb_9wXtv5G1UqFkSXksLBSIF4PKga4CpynAA,339
2
2
  labfreed/labfreed_infrastructure.py,sha256=ss1PyJl-7Es-lEcxptmdYI9kDAHmh7HB_tAGkPC6UVs,10173
3
3
  labfreed/labfreed_extended/app/app_infrastructure.py,sha256=1867Nq40c8Q4bFyRv48vTIFDXoPeZTfYij9PSog6fkE,4427
4
4
  labfreed/labfreed_extended/app/formatted_print.py,sha256=DcwWP0ix1e_wYNIdceIp6cETkJdG2DqpU8Gs3aZAL40,1930
@@ -36,14 +36,14 @@ labfreed/labfreed_extended/pac_issuer_lib/templates/pac_info/card.jinja.html,sha
36
36
  labfreed/labfreed_extended/pac_issuer_lib/templates/pac_info/pac_info.jinja.html,sha256=xK0yM_ovRE8QS6N7hiXhGv-ya8C-s19YWhhMqJKYxFM,1518
37
37
  labfreed/pac_attributes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
38
  labfreed/pac_attributes/well_knonw_attribute_keys.py,sha256=Z_QcQdbIil_EMpFqQcBnivEGMDauyoCMW8r62-EN2KM,547
39
- labfreed/pac_attributes/api_data_models/request.py,sha256=64BCChFKXA8Z91r5IxAtcVZ6XiCKcw9RQErok2b91cc,4045
39
+ labfreed/pac_attributes/api_data_models/request.py,sha256=T8SBBrKuYI7kzg4TQTibBgVNxUnd0KKU4FG7x6U7uNA,4152
40
40
  labfreed/pac_attributes/api_data_models/response.py,sha256=Hglfcvb7gC7uZrLsGfPewC290vp4qq4WsuM9S3UHQFI,8188
41
41
  labfreed/pac_attributes/api_data_models/server_capabilities_response.py,sha256=ypDm4f8xZZl036fp8PuIe6lJHNW5Zg1fItgUlnV75V0,178
42
42
  labfreed/pac_attributes/client/client.py,sha256=5d-G-1tHOx2PXW7KP366tWr4k4F1ykGHX9e-bauF6_w,7149
43
43
  labfreed/pac_attributes/client/client_attribute_group.py,sha256=lZXbMU_Yp7Q1iKc5WRqS6pzEz_mtwZaQ5fYZqJA6784,375
44
44
  labfreed/pac_attributes/pythonic/attribute_server_factory.py,sha256=8OeWuHpJSW1mA0gWKLWPBZvq0n3VEfVOPQSmXNnp5dw,7673
45
45
  labfreed/pac_attributes/pythonic/excel_attribute_data_source.py,sha256=IBBGpHgt-HiZeB6dsLcjtqUPP2JdViLz2QMIDMjzmME,8467
46
- labfreed/pac_attributes/pythonic/py_attributes.py,sha256=VkkgKupJcM-kf0I5qRc5AiLSfi0vwnNgQv6neNtdRR8,7394
46
+ labfreed/pac_attributes/pythonic/py_attributes.py,sha256=fIVjBOWgUJJubpWOe6B9wkoBOiuvg0WZdCM-e205Dlg,7517
47
47
  labfreed/pac_attributes/pythonic/py_dict_data_source.py,sha256=nAz6GA7Xx_0IORPPpt_Wl3sFJa1Q5Fnq5vdf1uQiJF8,531
48
48
  labfreed/pac_attributes/server/__init__.py,sha256=JvQ2kpQx62OUwP18bGhOWYU9an_nQW59Y8Lh7HyfVxY,301
49
49
  labfreed/pac_attributes/server/attribute_data_sources.py,sha256=92BiQ2QC00PSXeeb6XI0KNcD7ZF7bdOSZZcOrOwPr_o,2406
@@ -90,7 +90,7 @@ labfreed/well_known_keys/labfreed/well_known_keys.py,sha256=p-hXwEEIs7p2SKn9DQeL
90
90
  labfreed/well_known_keys/unece/UneceUnits.json,sha256=kwfQSp_nTuWbADfBBgqTWrvPl6XtM5SedEVLbMJrM7M,898953
91
91
  labfreed/well_known_keys/unece/__init__.py,sha256=MSP9lmjg9_D9iqG9Yq2_ajYfQSNS9wIT7FXA1c--59M,122
92
92
  labfreed/well_known_keys/unece/unece_units.py,sha256=J20d64H69qKDE3XlGdJoXIIh0G-d0jKoiIDsg9an5pk,1655
93
- labfreed-1.0.0b26.dist-info/licenses/LICENSE,sha256=gHFOv9FRKHxO8cInP3YXyPoJnuNeqrvcHjaE_wPSsQ8,1100
94
- labfreed-1.0.0b26.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
95
- labfreed-1.0.0b26.dist-info/METADATA,sha256=K8z2-hmoKb-cimYESItpZrexeEKNvSkvQkReD_W5wD8,19858
96
- labfreed-1.0.0b26.dist-info/RECORD,,
93
+ labfreed-1.0.0b27.dist-info/licenses/LICENSE,sha256=gHFOv9FRKHxO8cInP3YXyPoJnuNeqrvcHjaE_wPSsQ8,1100
94
+ labfreed-1.0.0b27.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
95
+ labfreed-1.0.0b27.dist-info/METADATA,sha256=kucH3QaUo8-y4i1g5gzH8JL-4EglbUB1HGl-hAoQ2ek,19858
96
+ labfreed-1.0.0b27.dist-info/RECORD,,