bam-masterdata 0.0.0__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.
Files changed (35) hide show
  1. bam_masterdata/__init__.py +0 -0
  2. bam_masterdata/_version.py +16 -0
  3. bam_masterdata/cli/__init__.py +1 -0
  4. bam_masterdata/cli/cli.py +194 -0
  5. bam_masterdata/cli/entities_to_excel.py +99 -0
  6. bam_masterdata/cli/entities_to_json.py +67 -0
  7. bam_masterdata/cli/fill_masterdata.py +426 -0
  8. bam_masterdata/datamodel/__init__.py +0 -0
  9. bam_masterdata/datamodel/collection_types.py +317 -0
  10. bam_masterdata/datamodel/dataset_types.py +1497 -0
  11. bam_masterdata/datamodel/object_types.py +13560 -0
  12. bam_masterdata/datamodel/property_types.py +6515 -0
  13. bam_masterdata/datamodel/vocabulary_types.py +81811 -0
  14. bam_masterdata/logger.py +41 -0
  15. bam_masterdata/metadata/__init__.py +0 -0
  16. bam_masterdata/metadata/definitions.py +442 -0
  17. bam_masterdata/metadata/entities.py +181 -0
  18. bam_masterdata/openbis/__init__.py +1 -0
  19. bam_masterdata/openbis/get_entities.py +181 -0
  20. bam_masterdata/openbis/login.py +18 -0
  21. bam_masterdata/utils/__init__.py +6 -0
  22. bam_masterdata/utils/utils.py +115 -0
  23. bam_masterdata-0.0.0.dist-info/METADATA +176 -0
  24. bam_masterdata-0.0.0.dist-info/RECORD +35 -0
  25. bam_masterdata-0.0.0.dist-info/WHEEL +5 -0
  26. bam_masterdata-0.0.0.dist-info/entry_points.txt +2 -0
  27. bam_masterdata-0.0.0.dist-info/top_level.txt +2 -0
  28. tests/__init__.py +0 -0
  29. tests/cli/test_entities_to_excel.py +82 -0
  30. tests/cli/test_entities_to_json.py +42 -0
  31. tests/conftest.py +146 -0
  32. tests/metadata/test_definitions.py +288 -0
  33. tests/metadata/test_entities.py +54 -0
  34. tests/test_logger.py +37 -0
  35. tests/utils/test_utils.py +152 -0
@@ -0,0 +1,317 @@
1
+ from bam_masterdata.metadata.definitions import (
2
+ CollectionTypeDef,
3
+ PropertyTypeAssignment,
4
+ )
5
+ from bam_masterdata.metadata.entities import CollectionType
6
+
7
+
8
+ class Collection(CollectionType):
9
+ defs = CollectionTypeDef(
10
+ code="COLLECTION",
11
+ description="""""",
12
+ )
13
+
14
+ name = PropertyTypeAssignment(
15
+ code="$NAME",
16
+ data_type="VARCHAR",
17
+ property_label="Name",
18
+ description="""Name""",
19
+ mandatory=False,
20
+ show_in_edit_views=False,
21
+ section="General info",
22
+ )
23
+
24
+ default_object_type = PropertyTypeAssignment(
25
+ code="$DEFAULT_OBJECT_TYPE",
26
+ data_type="VARCHAR",
27
+ property_label="Default object type",
28
+ description="""Enter the code of the object type for which the collection is used""",
29
+ mandatory=False,
30
+ show_in_edit_views=False,
31
+ section="General info",
32
+ )
33
+
34
+ default_collection_view = PropertyTypeAssignment(
35
+ code="$DEFAULT_COLLECTION_VIEW",
36
+ data_type="CONTROLLEDVOCABULARY",
37
+ property_label="Default collection view",
38
+ description="""Default view for experiments of the type collection""",
39
+ mandatory=False,
40
+ show_in_edit_views=False,
41
+ section="General info",
42
+ )
43
+
44
+
45
+ class DefaultExperiment(CollectionType):
46
+ defs = CollectionTypeDef(
47
+ code="DEFAULT_EXPERIMENT",
48
+ description="""""",
49
+ validation_script="DEFAULT_EXPERIMENT.date_range_validation",
50
+ )
51
+
52
+ name = PropertyTypeAssignment(
53
+ code="$NAME",
54
+ data_type="VARCHAR",
55
+ property_label="Name",
56
+ description="""Name""",
57
+ mandatory=False,
58
+ show_in_edit_views=False,
59
+ section="General info",
60
+ )
61
+
62
+ default_object_type = PropertyTypeAssignment(
63
+ code="$DEFAULT_OBJECT_TYPE",
64
+ data_type="VARCHAR",
65
+ property_label="Default object type",
66
+ description="""Enter the code of the object type for which the collection is used""",
67
+ mandatory=False,
68
+ show_in_edit_views=False,
69
+ section="General info",
70
+ )
71
+
72
+ show_in_project_overview = PropertyTypeAssignment(
73
+ code="$SHOW_IN_PROJECT_OVERVIEW",
74
+ data_type="BOOLEAN",
75
+ property_label="Show in project overview",
76
+ description="""Show in project overview page""",
77
+ mandatory=False,
78
+ show_in_edit_views=False,
79
+ section="General info",
80
+ )
81
+
82
+ finished_flag = PropertyTypeAssignment(
83
+ code="FINISHED_FLAG",
84
+ data_type="BOOLEAN",
85
+ property_label="Experiment completed",
86
+ description="""Marks the experiment as finished//Markiert das Experiment als abgeschlossen""",
87
+ mandatory=False,
88
+ show_in_edit_views=False,
89
+ section="General info",
90
+ )
91
+
92
+ default_experiment_grant = PropertyTypeAssignment(
93
+ code="DEFAULT_EXPERIMENT.GRANT",
94
+ data_type="VARCHAR",
95
+ property_label="Grant",
96
+ description="""Grant""",
97
+ mandatory=False,
98
+ show_in_edit_views=False,
99
+ section="General info",
100
+ )
101
+
102
+ start_date = PropertyTypeAssignment(
103
+ code="START_DATE",
104
+ data_type="TIMESTAMP",
105
+ property_label="Start date",
106
+ description="""Start date//Startdatum""",
107
+ mandatory=False,
108
+ show_in_edit_views=False,
109
+ section="General info",
110
+ )
111
+
112
+ end_date = PropertyTypeAssignment(
113
+ code="END_DATE",
114
+ data_type="TIMESTAMP",
115
+ property_label="End date",
116
+ description="""End date//Enddatum""",
117
+ mandatory=False,
118
+ show_in_edit_views=False,
119
+ section="General info",
120
+ )
121
+
122
+ default_experiment_experimental_goals = PropertyTypeAssignment(
123
+ code="DEFAULT_EXPERIMENT.EXPERIMENTAL_GOALS",
124
+ data_type="MULTILINE_VARCHAR",
125
+ property_label="Goals",
126
+ description="""Goals of the experiment""",
127
+ mandatory=False,
128
+ show_in_edit_views=False,
129
+ section="Experimental details",
130
+ )
131
+
132
+ default_experiment_experimental_description = PropertyTypeAssignment(
133
+ code="DEFAULT_EXPERIMENT.EXPERIMENTAL_DESCRIPTION",
134
+ data_type="MULTILINE_VARCHAR",
135
+ property_label="Description",
136
+ description="""Description of the experiment""",
137
+ mandatory=False,
138
+ show_in_edit_views=False,
139
+ section="Experimental details",
140
+ )
141
+
142
+ default_experiment_experimental_results = PropertyTypeAssignment(
143
+ code="DEFAULT_EXPERIMENT.EXPERIMENTAL_RESULTS",
144
+ data_type="MULTILINE_VARCHAR",
145
+ property_label="Results",
146
+ description="""Summary of experimental results""",
147
+ mandatory=False,
148
+ show_in_edit_views=False,
149
+ section="Experimental details",
150
+ )
151
+
152
+ reference = PropertyTypeAssignment(
153
+ code="REFERENCE",
154
+ data_type="MULTILINE_VARCHAR",
155
+ property_label="References",
156
+ description="""Useful refences//Nützliche Referenzen""",
157
+ mandatory=False,
158
+ show_in_edit_views=False,
159
+ section="References",
160
+ )
161
+
162
+ publication = PropertyTypeAssignment(
163
+ code="PUBLICATION",
164
+ data_type="MULTILINE_VARCHAR",
165
+ property_label="Publication",
166
+ description="""Own publication where this entity is referenced//Eigene Publikation, in dem dieses Experiment beschrieben wird""",
167
+ mandatory=False,
168
+ show_in_edit_views=False,
169
+ section="References",
170
+ )
171
+
172
+ notes = PropertyTypeAssignment(
173
+ code="NOTES",
174
+ data_type="MULTILINE_VARCHAR",
175
+ property_label="Notes",
176
+ description="""Notes//Notizen""",
177
+ mandatory=False,
178
+ show_in_edit_views=False,
179
+ section="",
180
+ )
181
+
182
+ xmlcomments = PropertyTypeAssignment(
183
+ code="$XMLCOMMENTS",
184
+ data_type="XML",
185
+ property_label="Comments",
186
+ description="""Comments log""",
187
+ mandatory=False,
188
+ show_in_edit_views=False,
189
+ section="",
190
+ )
191
+
192
+
193
+ class MeasurementsCollection(CollectionType):
194
+ defs = CollectionTypeDef(
195
+ code="MEASUREMENTS_COLLECTION",
196
+ description="""Contains individual measurements, common metadata//Enthält individuelle Messungen, gemeinsame Metadaten""",
197
+ )
198
+
199
+ name = PropertyTypeAssignment(
200
+ code="$NAME",
201
+ data_type="VARCHAR",
202
+ property_label="Name",
203
+ description="""Name""",
204
+ mandatory=True,
205
+ show_in_edit_views=False,
206
+ section="General Information",
207
+ )
208
+
209
+ default_object_type = PropertyTypeAssignment(
210
+ code="$DEFAULT_OBJECT_TYPE",
211
+ data_type="VARCHAR",
212
+ property_label="Default object type",
213
+ description="""Enter the code of the object type for which the collection is used""",
214
+ mandatory=False,
215
+ show_in_edit_views=False,
216
+ section="General Information",
217
+ )
218
+
219
+ default_collection_view = PropertyTypeAssignment(
220
+ code="$DEFAULT_COLLECTION_VIEW",
221
+ data_type="CONTROLLEDVOCABULARY",
222
+ property_label="Default collection view",
223
+ description="""Default view for experiments of the type collection""",
224
+ mandatory=False,
225
+ show_in_edit_views=False,
226
+ section="General Information",
227
+ )
228
+
229
+ measurement_date = PropertyTypeAssignment(
230
+ code="MEASUREMENT_DATE",
231
+ data_type="DATE",
232
+ property_label="Measurement Date",
233
+ description="""Measurement Date//Messdatum""",
234
+ mandatory=True,
235
+ show_in_edit_views=False,
236
+ section="Experiment Details",
237
+ )
238
+
239
+ description = PropertyTypeAssignment(
240
+ code="DESCRIPTION",
241
+ data_type="MULTILINE_VARCHAR",
242
+ property_label="Description",
243
+ description="""Short description and/or purpose//Kurzbeschreibung und/oder Zweck""",
244
+ mandatory=False,
245
+ show_in_edit_views=False,
246
+ section="Experiment Details",
247
+ )
248
+
249
+ air_temperature_in_celsius = PropertyTypeAssignment(
250
+ code="AIR_TEMPERATURE_IN_CELSIUS",
251
+ data_type="REAL",
252
+ property_label="Air Temperature [°C]",
253
+ description="""Air Temperature in °C//Lufttemperatur in °C""",
254
+ mandatory=False,
255
+ show_in_edit_views=False,
256
+ section="Experiment Details",
257
+ )
258
+
259
+ bam_oe = PropertyTypeAssignment(
260
+ code="BAM_OE",
261
+ data_type="CONTROLLEDVOCABULARY",
262
+ property_label="BAM Organizational Entity",
263
+ description="""BAM Organizational Entity//BAM Organisationseinheit (OE)""",
264
+ mandatory=True,
265
+ show_in_edit_views=False,
266
+ section="BAM Information",
267
+ )
268
+
269
+ responsible_person = PropertyTypeAssignment(
270
+ code="RESPONSIBLE_PERSON",
271
+ data_type="OBJECT",
272
+ property_label="Responsible person",
273
+ description="""Responsible person//Verantwortliche Person""",
274
+ mandatory=False,
275
+ show_in_edit_views=False,
276
+ section="BAM Information",
277
+ )
278
+
279
+ co_responsible_person = PropertyTypeAssignment(
280
+ code="CO_RESPONSIBLE_PERSON",
281
+ data_type="OBJECT",
282
+ property_label="Co-responsible person",
283
+ description="""Co-responsible person//Weitere verantwortliche Person""",
284
+ mandatory=False,
285
+ show_in_edit_views=False,
286
+ section="BAM Information",
287
+ )
288
+
289
+ notes = PropertyTypeAssignment(
290
+ code="NOTES",
291
+ data_type="MULTILINE_VARCHAR",
292
+ property_label="Notes",
293
+ description="""Notes//Notizen""",
294
+ mandatory=False,
295
+ show_in_edit_views=False,
296
+ section="Additional Information",
297
+ )
298
+
299
+ xmlcomments = PropertyTypeAssignment(
300
+ code="$XMLCOMMENTS",
301
+ data_type="XML",
302
+ property_label="Comments",
303
+ description="""Comments log""",
304
+ mandatory=False,
305
+ show_in_edit_views=False,
306
+ section="Comments",
307
+ )
308
+
309
+ annotations_state = PropertyTypeAssignment(
310
+ code="$ANNOTATIONS_STATE",
311
+ data_type="XML",
312
+ property_label="Annotations State",
313
+ description="""Annotations State""",
314
+ mandatory=False,
315
+ show_in_edit_views=False,
316
+ section="Comments",
317
+ )