labfreed 0.2.8a0__py3-none-any.whl → 0.2.10__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 labfreed might be problematic. Click here for more details.
- labfreed/__init__.py +1 -1
- labfreed/pac_id/url_serializer.py +2 -1
- labfreed/well_known_keys/labfreed/well_known_keys.py +2 -1
- {labfreed-0.2.8a0.dist-info → labfreed-0.2.10.dist-info}/METADATA +23 -9
- {labfreed-0.2.8a0.dist-info → labfreed-0.2.10.dist-info}/RECORD +7 -7
- {labfreed-0.2.8a0.dist-info → labfreed-0.2.10.dist-info}/WHEEL +0 -0
- {labfreed-0.2.8a0.dist-info → labfreed-0.2.10.dist-info}/licenses/LICENSE +0 -0
labfreed/__init__.py
CHANGED
|
@@ -37,8 +37,9 @@ class PACID_Serializer():
|
|
|
37
37
|
''' Serializes the PAC-ID'''
|
|
38
38
|
|
|
39
39
|
if isinstance(pac, PAC_CAT) and use_short_notation is not None:
|
|
40
|
+
segments = []
|
|
40
41
|
for c in pac.categories:
|
|
41
|
-
segments
|
|
42
|
+
segments.append(IDSegment(value=c.key))
|
|
42
43
|
if isinstance(c, PredefinedCategory):
|
|
43
44
|
segments += c._get_segments(use_short_notation=use_short_notation)
|
|
44
45
|
else:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: labfreed
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.10
|
|
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
|
|
@@ -23,6 +23,7 @@ Requires-Dist: typer>=0.15.2
|
|
|
23
23
|
Requires-Dist: PyYAML>=6.0.2
|
|
24
24
|
Requires-Dist: jsonpath-ng>=1.7.0
|
|
25
25
|
Requires-Dist: requests>=2.32.3
|
|
26
|
+
Requires-Dist: requests_cache>=1.2.1
|
|
26
27
|
Requires-Dist: pytest>=8.3.5 ; extra == "dev"
|
|
27
28
|
Requires-Dist: pdoc>=15.0.1 ; extra == "dev"
|
|
28
29
|
Requires-Dist: flit>=3.12.0 ; extra == "dev"
|
|
@@ -105,7 +106,7 @@ pac.print_validation_messages()
|
|
|
105
106
|
>> Validation Results
|
|
106
107
|
>> ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
107
108
|
>> │ **RECOMMENDATION** in id segment value bal500 │
|
|
108
|
-
>> │ Characters '
|
|
109
|
+
>> │ Characters 'l','a','b' should not be used., Characters SHOULD be limited to upper case letters (A-Z), numbers (0-9), '-' and '+' │
|
|
109
110
|
>> │ │
|
|
110
111
|
>> │ HTTPS://PAC.METTORIUS.COM/-MD/👉bal👈500/@1234 │
|
|
111
112
|
>> ├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
|
|
@@ -115,7 +116,7 @@ pac.print_validation_messages()
|
|
|
115
116
|
>> │ HTTPS://PAC.METTORIUS.COM/-MD/bal500/👉@👈1234 │
|
|
116
117
|
>> ├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
|
|
117
118
|
>> │ **RECOMMENDATION** in id segment value bal500 │
|
|
118
|
-
>> │ Characters '
|
|
119
|
+
>> │ Characters 'l','a','b' should not be used., Characters SHOULD be limited to upper case letters (A-Z), numbers (0-9), '-' and '+' │
|
|
119
120
|
>> │ │
|
|
120
121
|
>> │ HTTPS://PAC.METTORIUS.COM/-MD/👉bal👈500/@1234 │
|
|
121
122
|
>> ├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
|
|
@@ -248,7 +249,7 @@ trex.print_validation_messages()
|
|
|
248
249
|
>> Validation Results
|
|
249
250
|
>> ┌────────────────────────────────────────────────────────────┐
|
|
250
251
|
>> │ **ERROR** in TREX table column Date │
|
|
251
|
-
>> │ Column header key contains invalid characters: '
|
|
252
|
+
>> │ Column header key contains invalid characters: 'e','t','a' │
|
|
252
253
|
>> │ │
|
|
253
254
|
>> │ STOP$T.D:20240505T1306 │
|
|
254
255
|
>> │ +TEMP$KEL:10.15 │
|
|
@@ -256,9 +257,9 @@ trex.print_validation_messages()
|
|
|
256
257
|
>> │ +COMMENT$T.A:FOO │
|
|
257
258
|
>> │ +COMMENT2$T.T:12G3 │
|
|
258
259
|
>> │ +TABLE$$DURATION$HUR:D👉ate👈$T.D:OK$T.B:COMMENT$T.A:: │
|
|
259
|
-
>> │ 1:
|
|
260
|
-
>> │ 1.1:
|
|
261
|
-
>> │ 1.3:
|
|
260
|
+
>> │ 1:20250522T163256.043:T:FOO:: │
|
|
261
|
+
>> │ 1.1:20250522T163256.043:T:BAR:: │
|
|
262
|
+
>> │ 1.3:20250522T163256.043:F:BLUBB │
|
|
262
263
|
>> └────────────────────────────────────────────────────────────┘
|
|
263
264
|
```
|
|
264
265
|
#### Combine PAC-ID and TREX and serialize
|
|
@@ -270,12 +271,14 @@ pac_str = pac.to_url()
|
|
|
270
271
|
print(pac_str)
|
|
271
272
|
```
|
|
272
273
|
```text
|
|
273
|
-
>> HTTPS://PAC.METTORIUS.COM/21:1234*MYTREX$TREX/STOP$T.D:20240505T1306+TEMP$KEL:10.15+OK$T.B:F+COMMENT$T.A:FOO+COMMENT2$T.T:12G3+TABLE$$DURATION$HUR:Date$T.D:OK$T.B:COMMENT$T.A::1:
|
|
274
|
+
>> HTTPS://PAC.METTORIUS.COM/21:1234*MYTREX$TREX/STOP$T.D:20240505T1306+TEMP$KEL:10.15+OK$T.B:F+COMMENT$T.A:FOO+COMMENT2$T.T:12G3+TABLE$$DURATION$HUR:Date$T.D:OK$T.B:COMMENT$T.A::1:20250522T163256.043:T:FOO::1.1:20250522T163256.043:T:BAR::1.3:20250522T163256.043:F:BLUBB
|
|
274
275
|
```
|
|
275
276
|
## PAC-ID Resolver
|
|
276
277
|
|
|
277
278
|
```python
|
|
278
279
|
from labfreed import PAC_ID_Resolver, load_cit
|
|
280
|
+
import requests_cache
|
|
281
|
+
|
|
279
282
|
# Get a CIT
|
|
280
283
|
dir = os.path.join(os.getcwd(), 'examples')
|
|
281
284
|
p = os.path.join(dir, 'cit_mine.yaml')
|
|
@@ -294,8 +297,10 @@ cit2.origin = 'MY_COMPANY'
|
|
|
294
297
|
```python
|
|
295
298
|
# resolve a pac id
|
|
296
299
|
pac_str = 'HTTPS://PAC.METTORIUS.COM/-MS/X3511/CAS:7732-18-5'
|
|
297
|
-
service_groups = PAC_ID_Resolver(cits=[cit, cit2]).resolve(pac_str)
|
|
300
|
+
service_groups = PAC_ID_Resolver(cits=[cit, cit2]).resolve(pac_str, check_service_status=False)
|
|
301
|
+
cached_session = requests_cache.CachedSession(backend='memory', expire_after=60)
|
|
298
302
|
for sg in service_groups:
|
|
303
|
+
sg.update_states(cached_session)
|
|
299
304
|
sg.print()
|
|
300
305
|
|
|
301
306
|
```
|
|
@@ -327,6 +332,15 @@ for sg in service_groups:
|
|
|
327
332
|
|
|
328
333
|
<!-- BEGIN CHANGELOG -->
|
|
329
334
|
## Change Log
|
|
335
|
+
### v0.2.10
|
|
336
|
+
- bugfix:added missing well known segment key '20'
|
|
337
|
+
-
|
|
338
|
+
### v0.2.9
|
|
339
|
+
- bugfix in serialization of PAC-CAT with multiple categories
|
|
340
|
+
|
|
341
|
+
### v0.2.8
|
|
342
|
+
- option to pass cache to resolver for speedier check of service availability
|
|
343
|
+
|
|
330
344
|
### v0.2.7
|
|
331
345
|
- Improved README. No functional changes
|
|
332
346
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
labfreed/__init__.py,sha256
|
|
1
|
+
labfreed/__init__.py,sha256=-zBkNhlIqm6L5C6u3P3bVtYQvY0jGZl-_NDa2i9sDFc,337
|
|
2
2
|
labfreed/labfreed_infrastructure.py,sha256=EPDSCaGxWakAoPpHyc6ltf-pOuKyS5829lj_EG6wa74,10072
|
|
3
3
|
labfreed/pac_cat/__init__.py,sha256=KNPtQzBD1XVohvG_ucOs7RJj-oi6biUTGB1k-T2o6pk,568
|
|
4
4
|
labfreed/pac_cat/category_base.py,sha256=lFQNiTUukyhWdaSCAI7CZxLtj6kNtnBCE4UsePwsGqE,1801
|
|
@@ -9,7 +9,7 @@ labfreed/pac_id/extension.py,sha256=zuHI8e51otPbpO1r1xDFh32uXTT8L5pCJn74B-aOUpI,
|
|
|
9
9
|
labfreed/pac_id/id_segment.py,sha256=r5JU1SJuRXhZJJxy5T3xjrb598wIDTLpivSJhIUAzjQ,4526
|
|
10
10
|
labfreed/pac_id/pac_id.py,sha256=PyOa5y2IVLEcmj7ZkFuURC1lrP3BU0Yj8pzAllhtatw,5309
|
|
11
11
|
labfreed/pac_id/url_parser.py,sha256=TAQHxFf7Li8GA517mfOivmnJAJgh782oaSDzmOOkyTE,5942
|
|
12
|
-
labfreed/pac_id/url_serializer.py,sha256=
|
|
12
|
+
labfreed/pac_id/url_serializer.py,sha256=Thh41ejth2xv5OcvLDlhVMAzKvu4bDX563cQbJHMxFc,3301
|
|
13
13
|
labfreed/pac_id_resolver/__init__.py,sha256=RNBlrDOSR42gmSNH9wJVhK_xwEX45cvTKVgWW2bjh7Q,113
|
|
14
14
|
labfreed/pac_id_resolver/cit_common.py,sha256=xEkSSumj_IYgnXn3yKvoTBbgExnIfPY7E-RHU-7pcX8,2905
|
|
15
15
|
labfreed/pac_id_resolver/cit_v1.py,sha256=W7UCO0Gm0w09FSo_USFB1-V2tl3iErDxoe2OHh4fkvc,9383
|
|
@@ -35,11 +35,11 @@ labfreed/well_known_extensions/trex_extension.py,sha256=tffklaambkFPExcIDRAG9GJ7
|
|
|
35
35
|
labfreed/well_known_keys/gs1/__init__.py,sha256=LOFycgqS6OuV8t22TmtHy-ZI2iuXc3jJfVFwRFVDM3I,103
|
|
36
36
|
labfreed/well_known_keys/gs1/gs1.py,sha256=LIyy-W89m9L0gVxOu-lpBotsHN6CHvmdE3Vu2VwxUQA,79
|
|
37
37
|
labfreed/well_known_keys/gs1/gs1_ai_enum_sorted.py,sha256=D8hE6vm-GedS7W2uC52oYrvAKa4zM-7X11JeT_k23oM,1252
|
|
38
|
-
labfreed/well_known_keys/labfreed/well_known_keys.py,sha256=
|
|
38
|
+
labfreed/well_known_keys/labfreed/well_known_keys.py,sha256=486jbhlXADcQKDHvEFqpCdAVHgTV4WWc0SbBhCKp4i0,358
|
|
39
39
|
labfreed/well_known_keys/unece/UneceUnits.json,sha256=kwfQSp_nTuWbADfBBgqTWrvPl6XtM5SedEVLbMJrM7M,898953
|
|
40
40
|
labfreed/well_known_keys/unece/__init__.py,sha256=MSP9lmjg9_D9iqG9Yq2_ajYfQSNS9wIT7FXA1c--59M,122
|
|
41
41
|
labfreed/well_known_keys/unece/unece_units.py,sha256=gNDQk6KGl-nGMf9Ycq_fQ8P2xxKITgLkcQWPd4H49gI,1630
|
|
42
|
-
labfreed-0.2.
|
|
43
|
-
labfreed-0.2.
|
|
44
|
-
labfreed-0.2.
|
|
45
|
-
labfreed-0.2.
|
|
42
|
+
labfreed-0.2.10.dist-info/licenses/LICENSE,sha256=gHFOv9FRKHxO8cInP3YXyPoJnuNeqrvcHjaE_wPSsQ8,1100
|
|
43
|
+
labfreed-0.2.10.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
44
|
+
labfreed-0.2.10.dist-info/METADATA,sha256=NH1egNe4JefDtkw3FEfRAxX4BuRsU6EsDg3kxoc-mqs,19234
|
|
45
|
+
labfreed-0.2.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|