labfreed 0.2.6a5__tar.gz → 0.2.7__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.
Potentially problematic release.
This version of labfreed might be problematic. Click here for more details.
- {labfreed-0.2.6a5 → labfreed-0.2.7}/CHANGELOG.md +7 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/PKG-INFO +29 -22
- {labfreed-0.2.6a5 → labfreed-0.2.7}/README.md +28 -21
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/__init__.py +1 -1
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/pac_id/pac_id.py +1 -1
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/pac_id/url_serializer.py +10 -6
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/pac_id_resolver/cit_v1.py +0 -3
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/pac_id_resolver/cit_v2.py +6 -1
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/pac_id_resolver/resolver.py +8 -5
- {labfreed-0.2.6a5 → labfreed-0.2.7}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/.github/workflows/pypi-publish.yml +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/.github/workflows/run-tests.yml +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/LICENSE +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/labfreed_infrastructure.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/pac_cat/__init__.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/pac_cat/category_base.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/pac_cat/pac_cat.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/pac_cat/predefined_categories.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/pac_id/__init__.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/pac_id/extension.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/pac_id/id_segment.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/pac_id/url_parser.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/pac_id_resolver/__init__.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/pac_id_resolver/cit_common.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/pac_id_resolver/services.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/qr/__init__.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/qr/generate_qr.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/trex/__init__.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/trex/python_convenience/__init__.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/trex/python_convenience/data_table.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/trex/python_convenience/pyTREX.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/trex/python_convenience/quantity.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/trex/table_segment.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/trex/trex.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/trex/trex_base_models.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/trex/value_segments.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/utilities/base36.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/well_known_extensions/__init__.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/well_known_extensions/default_extension_interpreters.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/well_known_extensions/display_name_extension.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/well_known_extensions/trex_extension.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/well_known_keys/gs1/__init__.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/well_known_keys/gs1/gs1.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/well_known_keys/gs1/gs1_ai_enum_sorted.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/well_known_keys/labfreed/well_known_keys.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/well_known_keys/unece/UneceUnits.json +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/well_known_keys/unece/__init__.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/well_known_keys/unece/unece_units.py +0 -0
- {labfreed-0.2.6a5 → labfreed-0.2.7}/pyproject.toml +0 -0
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
## Change Log
|
|
2
|
+
### v0.2.7
|
|
3
|
+
- Improved README. No functional changes
|
|
4
|
+
|
|
5
|
+
### v0.2.6
|
|
6
|
+
- PAC_ID.to_url() preserves the identifier as is by default but allows to force short or long notation.
|
|
7
|
+
- PAC-ID Resolver does not try to resolve PAC-CAT with CIT v1.
|
|
8
|
+
|
|
2
9
|
### v0.2.5
|
|
3
10
|
- resolvers checks service states by default
|
|
4
11
|
- improvements and bugfixes in conversion from python types to TREX
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: labfreed
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.7
|
|
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
|
|
@@ -38,7 +38,7 @@ Provides-Extra: dev
|
|
|
38
38
|
[](https://pypi.org/project/labfreed/)  [](https://github.com/retothuerer/LabFREED/actions/workflows/run-tests.yml) [](LICENSE)
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
This is a Python implementation of [LabFREED](https://labfreed.
|
|
41
|
+
This is a Python implementation of [LabFREED](https://labfreed.org/) building blocks.
|
|
42
42
|
|
|
43
43
|
## Supported Building Blocks
|
|
44
44
|
- PAC-ID
|
|
@@ -53,7 +53,7 @@ This is a Python implementation of [LabFREED](https://labfreed.wega-it.com) buil
|
|
|
53
53
|
- base36 <> str conversions
|
|
54
54
|
- PAC-ID Resolver
|
|
55
55
|
- support for CIT v1
|
|
56
|
-
- draft support for CIT
|
|
56
|
+
- draft support for CIT v2 (improved version)
|
|
57
57
|
- combined use of multiple cit in any combination of version
|
|
58
58
|
- Generation of QR codes (PAC-ID with extensions)
|
|
59
59
|
|
|
@@ -105,24 +105,24 @@ pac.print_validation_messages()
|
|
|
105
105
|
>> Validation Results
|
|
106
106
|
>> ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
107
107
|
>> │ **RECOMMENDATION** in id segment value bal500 │
|
|
108
|
-
>> │ Characters '
|
|
108
|
+
>> │ Characters 'a','l','b' should not be used., Characters SHOULD be limited to upper case letters (A-Z), numbers (0-9), '-' and '+' │
|
|
109
109
|
>> │ │
|
|
110
|
-
>> │ HTTPS://PAC.METTORIUS.COM/-MD
|
|
110
|
+
>> │ HTTPS://PAC.METTORIUS.COM/-MD/👉bal👈500/@1234 │
|
|
111
111
|
>> ├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
|
|
112
112
|
>> │ **RECOMMENDATION** in id segment value @1234 │
|
|
113
113
|
>> │ Characters '@' should not be used., Characters SHOULD be limited to upper case letters (A-Z), numbers (0-9), '-' and '+' │
|
|
114
114
|
>> │ │
|
|
115
|
-
>> │ HTTPS://PAC.METTORIUS.COM/-MD/
|
|
115
|
+
>> │ HTTPS://PAC.METTORIUS.COM/-MD/bal500/👉@👈1234 │
|
|
116
116
|
>> ├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
|
|
117
117
|
>> │ **RECOMMENDATION** in id segment value bal500 │
|
|
118
|
-
>> │ Characters '
|
|
118
|
+
>> │ Characters 'a','l','b' should not be used., Characters SHOULD be limited to upper case letters (A-Z), numbers (0-9), '-' and '+' │
|
|
119
119
|
>> │ │
|
|
120
|
-
>> │ HTTPS://PAC.METTORIUS.COM/-MD
|
|
120
|
+
>> │ HTTPS://PAC.METTORIUS.COM/-MD/👉bal👈500/@1234 │
|
|
121
121
|
>> ├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
|
|
122
122
|
>> │ **RECOMMENDATION** in id segment value @1234 │
|
|
123
123
|
>> │ Characters '@' should not be used., Characters SHOULD be limited to upper case letters (A-Z), numbers (0-9), '-' and '+' │
|
|
124
124
|
>> │ │
|
|
125
|
-
>> │ HTTPS://PAC.METTORIUS.COM/-MD/
|
|
125
|
+
>> │ HTTPS://PAC.METTORIUS.COM/-MD/bal500/👉@👈1234 │
|
|
126
126
|
>> └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
127
127
|
```
|
|
128
128
|
### Save as QR Code
|
|
@@ -152,8 +152,8 @@ if isinstance(pac, PAC_CAT):
|
|
|
152
152
|
```
|
|
153
153
|
```text
|
|
154
154
|
>> Categories in
|
|
155
|
-
>> HTTPS://PAC.METTORIUS.COM/-
|
|
156
|
-
>>
|
|
155
|
+
>> HTTPS://PAC.METTORIUS.COM/-DR/XQ90
|
|
156
|
+
>> 8756/-MD/bal500/@1234
|
|
157
157
|
>> ┌────────────────────┬───────────┐
|
|
158
158
|
>> │ Main Category │ │
|
|
159
159
|
>> │ key () │ -DR │
|
|
@@ -248,7 +248,7 @@ trex.print_validation_messages()
|
|
|
248
248
|
>> Validation Results
|
|
249
249
|
>> ┌────────────────────────────────────────────────────────────┐
|
|
250
250
|
>> │ **ERROR** in TREX table column Date │
|
|
251
|
-
>> │ Column header key contains invalid characters: '
|
|
251
|
+
>> │ Column header key contains invalid characters: 'a','t','e' │
|
|
252
252
|
>> │ │
|
|
253
253
|
>> │ STOP$T.D:20240505T1306 │
|
|
254
254
|
>> │ +TEMP$KEL:10.15 │
|
|
@@ -256,9 +256,9 @@ trex.print_validation_messages()
|
|
|
256
256
|
>> │ +COMMENT$T.A:FOO │
|
|
257
257
|
>> │ +COMMENT2$T.T:12G3 │
|
|
258
258
|
>> │ +TABLE$$DURATION$HUR:D👉ate👈$T.D:OK$T.B:COMMENT$T.A:: │
|
|
259
|
-
>> │ 1:
|
|
260
|
-
>> │ 1.1:
|
|
261
|
-
>> │ 1.3:
|
|
259
|
+
>> │ 1:20250513T080159.146:T:FOO:: │
|
|
260
|
+
>> │ 1.1:20250513T080159.146:T:BAR:: │
|
|
261
|
+
>> │ 1.3:20250513T080159.146:F:BLUBB │
|
|
262
262
|
>> └────────────────────────────────────────────────────────────┘
|
|
263
263
|
```
|
|
264
264
|
#### Combine PAC-ID and TREX and serialize
|
|
@@ -270,7 +270,7 @@ pac_str = pac.to_url()
|
|
|
270
270
|
print(pac_str)
|
|
271
271
|
```
|
|
272
272
|
```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:
|
|
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:20250513T080159.146:T:FOO::1.1:20250513T080159.146:T:BAR::1.3:20250513T080159.146:F:BLUBB
|
|
274
274
|
```
|
|
275
275
|
## PAC-ID Resolver
|
|
276
276
|
|
|
@@ -306,12 +306,12 @@ for sg in service_groups:
|
|
|
306
306
|
>> ┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
|
|
307
307
|
>> │ CAS Search │ https://pubchem.ncbi.nlm.nih.gov/#query=7732-18-5 │ ACTIVE │
|
|
308
308
|
>> └──────────────┴───────────────────────────────────────────────────┴───────────┘
|
|
309
|
-
>>
|
|
310
|
-
>>
|
|
311
|
-
>> ┃ Service Name ┃ URL
|
|
312
|
-
>>
|
|
313
|
-
>> │ Chemical Management │ https://chem-manager.com/METTORIUS.COM/-MS/
|
|
314
|
-
>>
|
|
309
|
+
>> Services from origin 'MY_COMPANY
|
|
310
|
+
>> ┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
|
|
311
|
+
>> ┃ Service Name ┃ URL ┃ Reachable ┃
|
|
312
|
+
>> ┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
|
|
313
|
+
>> │ Chemical Management │ https://chem-manager.com/METTORIUS.COM/-MS/X3511/CAS:7732-18-5 │ INACTIVE │
|
|
314
|
+
>> └─────────────────────┴────────────────────────────────────────────────────────────────┴───────────┘
|
|
315
315
|
>> Services from origin 'METTORIUS.COM
|
|
316
316
|
>> ┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
|
|
317
317
|
>> ┃ Service Name ┃ URL ┃ Reachable ┃
|
|
@@ -327,6 +327,13 @@ for sg in service_groups:
|
|
|
327
327
|
|
|
328
328
|
<!-- BEGIN CHANGELOG -->
|
|
329
329
|
## Change Log
|
|
330
|
+
### v0.2.7
|
|
331
|
+
- Improved README. No functional changes
|
|
332
|
+
|
|
333
|
+
### v0.2.6
|
|
334
|
+
- PAC_ID.to_url() preserves the identifier as is by default but allows to force short or long notation.
|
|
335
|
+
- PAC-ID Resolver does not try to resolve PAC-CAT with CIT v1.
|
|
336
|
+
|
|
330
337
|
### v0.2.5
|
|
331
338
|
- resolvers checks service states by default
|
|
332
339
|
- improvements and bugfixes in conversion from python types to TREX
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://pypi.org/project/labfreed/)  [](https://github.com/retothuerer/LabFREED/actions/workflows/run-tests.yml) [](LICENSE)
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
This is a Python implementation of [LabFREED](https://labfreed.
|
|
6
|
+
This is a Python implementation of [LabFREED](https://labfreed.org/) building blocks.
|
|
7
7
|
|
|
8
8
|
## Supported Building Blocks
|
|
9
9
|
- PAC-ID
|
|
@@ -18,7 +18,7 @@ This is a Python implementation of [LabFREED](https://labfreed.wega-it.com) buil
|
|
|
18
18
|
- base36 <> str conversions
|
|
19
19
|
- PAC-ID Resolver
|
|
20
20
|
- support for CIT v1
|
|
21
|
-
- draft support for CIT
|
|
21
|
+
- draft support for CIT v2 (improved version)
|
|
22
22
|
- combined use of multiple cit in any combination of version
|
|
23
23
|
- Generation of QR codes (PAC-ID with extensions)
|
|
24
24
|
|
|
@@ -70,24 +70,24 @@ pac.print_validation_messages()
|
|
|
70
70
|
>> Validation Results
|
|
71
71
|
>> ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
72
72
|
>> │ **RECOMMENDATION** in id segment value bal500 │
|
|
73
|
-
>> │ Characters '
|
|
73
|
+
>> │ Characters 'a','l','b' should not be used., Characters SHOULD be limited to upper case letters (A-Z), numbers (0-9), '-' and '+' │
|
|
74
74
|
>> │ │
|
|
75
|
-
>> │ HTTPS://PAC.METTORIUS.COM/-MD
|
|
75
|
+
>> │ HTTPS://PAC.METTORIUS.COM/-MD/👉bal👈500/@1234 │
|
|
76
76
|
>> ├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
|
|
77
77
|
>> │ **RECOMMENDATION** in id segment value @1234 │
|
|
78
78
|
>> │ Characters '@' should not be used., Characters SHOULD be limited to upper case letters (A-Z), numbers (0-9), '-' and '+' │
|
|
79
79
|
>> │ │
|
|
80
|
-
>> │ HTTPS://PAC.METTORIUS.COM/-MD/
|
|
80
|
+
>> │ HTTPS://PAC.METTORIUS.COM/-MD/bal500/👉@👈1234 │
|
|
81
81
|
>> ├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
|
|
82
82
|
>> │ **RECOMMENDATION** in id segment value bal500 │
|
|
83
|
-
>> │ Characters '
|
|
83
|
+
>> │ Characters 'a','l','b' should not be used., Characters SHOULD be limited to upper case letters (A-Z), numbers (0-9), '-' and '+' │
|
|
84
84
|
>> │ │
|
|
85
|
-
>> │ HTTPS://PAC.METTORIUS.COM/-MD
|
|
85
|
+
>> │ HTTPS://PAC.METTORIUS.COM/-MD/👉bal👈500/@1234 │
|
|
86
86
|
>> ├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
|
|
87
87
|
>> │ **RECOMMENDATION** in id segment value @1234 │
|
|
88
88
|
>> │ Characters '@' should not be used., Characters SHOULD be limited to upper case letters (A-Z), numbers (0-9), '-' and '+' │
|
|
89
89
|
>> │ │
|
|
90
|
-
>> │ HTTPS://PAC.METTORIUS.COM/-MD/
|
|
90
|
+
>> │ HTTPS://PAC.METTORIUS.COM/-MD/bal500/👉@👈1234 │
|
|
91
91
|
>> └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
92
92
|
```
|
|
93
93
|
### Save as QR Code
|
|
@@ -117,8 +117,8 @@ if isinstance(pac, PAC_CAT):
|
|
|
117
117
|
```
|
|
118
118
|
```text
|
|
119
119
|
>> Categories in
|
|
120
|
-
>> HTTPS://PAC.METTORIUS.COM/-
|
|
121
|
-
>>
|
|
120
|
+
>> HTTPS://PAC.METTORIUS.COM/-DR/XQ90
|
|
121
|
+
>> 8756/-MD/bal500/@1234
|
|
122
122
|
>> ┌────────────────────┬───────────┐
|
|
123
123
|
>> │ Main Category │ │
|
|
124
124
|
>> │ key () │ -DR │
|
|
@@ -213,7 +213,7 @@ trex.print_validation_messages()
|
|
|
213
213
|
>> Validation Results
|
|
214
214
|
>> ┌────────────────────────────────────────────────────────────┐
|
|
215
215
|
>> │ **ERROR** in TREX table column Date │
|
|
216
|
-
>> │ Column header key contains invalid characters: '
|
|
216
|
+
>> │ Column header key contains invalid characters: 'a','t','e' │
|
|
217
217
|
>> │ │
|
|
218
218
|
>> │ STOP$T.D:20240505T1306 │
|
|
219
219
|
>> │ +TEMP$KEL:10.15 │
|
|
@@ -221,9 +221,9 @@ trex.print_validation_messages()
|
|
|
221
221
|
>> │ +COMMENT$T.A:FOO │
|
|
222
222
|
>> │ +COMMENT2$T.T:12G3 │
|
|
223
223
|
>> │ +TABLE$$DURATION$HUR:D👉ate👈$T.D:OK$T.B:COMMENT$T.A:: │
|
|
224
|
-
>> │ 1:
|
|
225
|
-
>> │ 1.1:
|
|
226
|
-
>> │ 1.3:
|
|
224
|
+
>> │ 1:20250513T080159.146:T:FOO:: │
|
|
225
|
+
>> │ 1.1:20250513T080159.146:T:BAR:: │
|
|
226
|
+
>> │ 1.3:20250513T080159.146:F:BLUBB │
|
|
227
227
|
>> └────────────────────────────────────────────────────────────┘
|
|
228
228
|
```
|
|
229
229
|
#### Combine PAC-ID and TREX and serialize
|
|
@@ -235,7 +235,7 @@ pac_str = pac.to_url()
|
|
|
235
235
|
print(pac_str)
|
|
236
236
|
```
|
|
237
237
|
```text
|
|
238
|
-
>> 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:
|
|
238
|
+
>> 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:20250513T080159.146:T:FOO::1.1:20250513T080159.146:T:BAR::1.3:20250513T080159.146:F:BLUBB
|
|
239
239
|
```
|
|
240
240
|
## PAC-ID Resolver
|
|
241
241
|
|
|
@@ -271,12 +271,12 @@ for sg in service_groups:
|
|
|
271
271
|
>> ┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
|
|
272
272
|
>> │ CAS Search │ https://pubchem.ncbi.nlm.nih.gov/#query=7732-18-5 │ ACTIVE │
|
|
273
273
|
>> └──────────────┴───────────────────────────────────────────────────┴───────────┘
|
|
274
|
-
>>
|
|
275
|
-
>>
|
|
276
|
-
>> ┃ Service Name ┃ URL
|
|
277
|
-
>>
|
|
278
|
-
>> │ Chemical Management │ https://chem-manager.com/METTORIUS.COM/-MS/
|
|
279
|
-
>>
|
|
274
|
+
>> Services from origin 'MY_COMPANY
|
|
275
|
+
>> ┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
|
|
276
|
+
>> ┃ Service Name ┃ URL ┃ Reachable ┃
|
|
277
|
+
>> ┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
|
|
278
|
+
>> │ Chemical Management │ https://chem-manager.com/METTORIUS.COM/-MS/X3511/CAS:7732-18-5 │ INACTIVE │
|
|
279
|
+
>> └─────────────────────┴────────────────────────────────────────────────────────────────┴───────────┘
|
|
280
280
|
>> Services from origin 'METTORIUS.COM
|
|
281
281
|
>> ┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
|
|
282
282
|
>> ┃ Service Name ┃ URL ┃ Reachable ┃
|
|
@@ -292,6 +292,13 @@ for sg in service_groups:
|
|
|
292
292
|
|
|
293
293
|
<!-- BEGIN CHANGELOG -->
|
|
294
294
|
## Change Log
|
|
295
|
+
### v0.2.7
|
|
296
|
+
- Improved README. No functional changes
|
|
297
|
+
|
|
298
|
+
### v0.2.6
|
|
299
|
+
- PAC_ID.to_url() preserves the identifier as is by default but allows to force short or long notation.
|
|
300
|
+
- PAC-ID Resolver does not try to resolve PAC-CAT with CIT v1.
|
|
301
|
+
|
|
295
302
|
### v0.2.5
|
|
296
303
|
- resolvers checks service states by default
|
|
297
304
|
- improvements and bugfixes in conversion from python types to TREX
|
|
@@ -45,7 +45,7 @@ class PAC_ID(LabFREED_BaseModel):
|
|
|
45
45
|
from labfreed.pac_id.url_parser import PAC_Parser
|
|
46
46
|
return PAC_Parser.from_url(url, try_pac_cat=try_pac_cat, suppress_validation_errors=suppress_validation_errors, extension_interpreters=extension_interpreters)
|
|
47
47
|
|
|
48
|
-
def to_url(self, use_short_notation=
|
|
48
|
+
def to_url(self, use_short_notation:None|bool=None, uppercase_only=False) -> str:
|
|
49
49
|
from labfreed.pac_id.url_serializer import PACID_Serializer
|
|
50
50
|
return PACID_Serializer.to_url(self, use_short_notation=use_short_notation, uppercase_only=uppercase_only)
|
|
51
51
|
|
|
@@ -9,20 +9,23 @@ class PACID_Serializer():
|
|
|
9
9
|
'''Represents a PAC-ID including it's extensions'''
|
|
10
10
|
|
|
11
11
|
@classmethod
|
|
12
|
-
def to_url(cls, pac:PAC_ID, use_short_notation=
|
|
12
|
+
def to_url(cls, pac:PAC_ID, use_short_notation:bool|None=None, uppercase_only=False) -> str:
|
|
13
13
|
"""Serializes the PAC-ID including extensions.
|
|
14
14
|
|
|
15
15
|
Args:
|
|
16
|
-
use_short_notation (bool, optional):
|
|
16
|
+
use_short_notation (bool|None, optional): None (default): Preserves the identifier as is. Extensions use short form
|
|
17
|
+
True: forces short notation for categories and extensions
|
|
18
|
+
False: forces long notation for categories and extensions
|
|
17
19
|
uppercase_only (bool, optional): Forces all uppercase letters (results in smaller QR)..
|
|
18
20
|
|
|
19
21
|
Returns:
|
|
20
22
|
str: Something like this HTTPS://PAC.METTORIUS.COM/-MD/BAL500/1234*N$N/ABC*SUM$TREX/A$T.A:ABC
|
|
21
23
|
|
|
22
24
|
"""
|
|
23
|
-
extensions_str = cls._serialize_extensions(pac.extensions, use_short_notation=use_short_notation)
|
|
24
|
-
|
|
25
25
|
identifier_str = cls._serialize_identifier(pac, use_short_notation=use_short_notation)
|
|
26
|
+
|
|
27
|
+
use_short_notation_for_extensions = True if use_short_notation is None else use_short_notation
|
|
28
|
+
extensions_str = cls._serialize_extensions(pac.extensions, use_short_notation=use_short_notation_for_extensions)
|
|
26
29
|
out = f"HTTPS://PAC.{pac.issuer}{identifier_str}{extensions_str}"
|
|
27
30
|
|
|
28
31
|
if uppercase_only:
|
|
@@ -30,9 +33,10 @@ class PACID_Serializer():
|
|
|
30
33
|
return out
|
|
31
34
|
|
|
32
35
|
@classmethod
|
|
33
|
-
def _serialize_identifier(cls, pac:PAC_ID|PAC_CAT, use_short_notation=
|
|
36
|
+
def _serialize_identifier(cls, pac:PAC_ID|PAC_CAT, use_short_notation:None|bool=None):
|
|
34
37
|
''' Serializes the PAC-ID'''
|
|
35
|
-
|
|
38
|
+
|
|
39
|
+
if isinstance(pac, PAC_CAT) and use_short_notation is not None:
|
|
36
40
|
for c in pac.categories:
|
|
37
41
|
segments = [IDSegment(value=c.key)]
|
|
38
42
|
if isinstance(c, PredefinedCategory):
|
|
@@ -91,7 +91,6 @@ class CIT_v1(LabFREED_BaseModel):
|
|
|
91
91
|
|
|
92
92
|
cols = [c.strip() for c in line.split('\t')]
|
|
93
93
|
if len(cols) < 5:
|
|
94
|
-
logging.error(f'invalid line {line}')
|
|
95
94
|
msg = ValidationMessage(
|
|
96
95
|
level=ValidationMsgLevel.ERROR,
|
|
97
96
|
source='CIT line',
|
|
@@ -102,7 +101,6 @@ class CIT_v1(LabFREED_BaseModel):
|
|
|
102
101
|
errors.append(msg)
|
|
103
102
|
continue
|
|
104
103
|
if len(cols) > 5:
|
|
105
|
-
logging.error(f'invalid line {line}')
|
|
106
104
|
msg = ValidationMessage(
|
|
107
105
|
level=ValidationMsgLevel.ERROR,
|
|
108
106
|
source='CIT line',
|
|
@@ -123,7 +121,6 @@ class CIT_v1(LabFREED_BaseModel):
|
|
|
123
121
|
)
|
|
124
122
|
entries.append(entry)
|
|
125
123
|
except ValueError:
|
|
126
|
-
logging.error(f'invalid line {line}')
|
|
127
124
|
msg = ValidationMessage(
|
|
128
125
|
level=ValidationMsgLevel.ERROR,
|
|
129
126
|
source='CIT line',
|
|
@@ -130,7 +130,12 @@ class CIT_v2(LabFREED_BaseModel):
|
|
|
130
130
|
|
|
131
131
|
@classmethod
|
|
132
132
|
def from_yaml(cls, yml:str) -> Self:
|
|
133
|
-
|
|
133
|
+
try:
|
|
134
|
+
d = yaml.safe_load(yml)
|
|
135
|
+
except yaml.YAMLError as e:
|
|
136
|
+
# not a valid yaml
|
|
137
|
+
raise ValueError("This is not a valid yaml") from e
|
|
138
|
+
return cls.model_validate(d)
|
|
134
139
|
|
|
135
140
|
def __str__(self):
|
|
136
141
|
yml = yaml.dump(self.model_dump() )
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
from functools import lru_cache
|
|
1
2
|
import logging
|
|
3
|
+
import traceback
|
|
2
4
|
from typing import Self
|
|
3
5
|
import yaml
|
|
4
6
|
from requests import get
|
|
@@ -24,8 +26,7 @@ def load_cit(path):
|
|
|
24
26
|
|
|
25
27
|
def cit_from_str(s:str, origin:str='') -> CIT_v1|CIT_v2:
|
|
26
28
|
try:
|
|
27
|
-
|
|
28
|
-
cit2 = CIT_v2.from_yaml(cit_yml)
|
|
29
|
+
cit2 = CIT_v2.from_yaml(s)
|
|
29
30
|
cit_version = 'v2'
|
|
30
31
|
except Exception:
|
|
31
32
|
cit2 = None
|
|
@@ -38,6 +39,7 @@ def cit_from_str(s:str, origin:str='') -> CIT_v1|CIT_v2:
|
|
|
38
39
|
cit = cit2 or cit1 or None
|
|
39
40
|
return cit
|
|
40
41
|
|
|
42
|
+
@lru_cache
|
|
41
43
|
def _get_issuer_cit(issuer:str):
|
|
42
44
|
'''Gets the issuer's cit.'''
|
|
43
45
|
url = 'HTTPS://PAC.' + issuer + '/coupling-information-table'
|
|
@@ -64,15 +66,16 @@ class PAC_ID_Resolver():
|
|
|
64
66
|
self._cits = cits
|
|
65
67
|
|
|
66
68
|
|
|
67
|
-
def resolve(self, pac_url:PAC_ID|str, check_service_status=True) -> list[ServiceGroup]:
|
|
69
|
+
def resolve(self, pac_url:PAC_ID|str, check_service_status=True, use_issuer_cit=True) -> list[ServiceGroup]:
|
|
68
70
|
'''Resolve a PAC-ID'''
|
|
69
71
|
if isinstance(pac_url, str):
|
|
70
72
|
pac_id = PAC_CAT.from_url(pac_url)
|
|
71
73
|
pac_id_catless = PAC_ID.from_url(pac_url, try_pac_cat=False)
|
|
72
74
|
|
|
73
75
|
cits = self._cits.copy()
|
|
74
|
-
if
|
|
75
|
-
|
|
76
|
+
if use_issuer_cit:
|
|
77
|
+
if issuer_cit := _get_issuer_cit(pac_id.issuer):
|
|
78
|
+
cits.append(issuer_cit)
|
|
76
79
|
|
|
77
80
|
matches = []
|
|
78
81
|
for cit in cits:
|
|
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-0.2.6a5 → labfreed-0.2.7}/labfreed/well_known_extensions/default_extension_interpreters.py
RENAMED
|
File without changes
|
{labfreed-0.2.6a5 → labfreed-0.2.7}/labfreed/well_known_extensions/display_name_extension.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
|