ghga-transpiler 2.3.2__tar.gz → 2.4.1__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.
Files changed (31) hide show
  1. {ghga_transpiler-2.3.2/src/ghga_transpiler.egg-info → ghga_transpiler-2.4.1}/PKG-INFO +1 -1
  2. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/pyproject.toml +1 -1
  3. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/src/ghga_transpiler/configs/2.0.yaml +18 -0
  4. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/src/ghga_transpiler/configs/2.1.yaml +18 -0
  5. ghga_transpiler-2.4.1/src/ghga_transpiler/configs/2.2.yaml +192 -0
  6. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/src/ghga_transpiler/transformations.py +20 -0
  7. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1/src/ghga_transpiler.egg-info}/PKG-INFO +1 -1
  8. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/src/ghga_transpiler.egg-info/SOURCES.txt +1 -0
  9. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/LICENSE +0 -0
  10. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/README.md +0 -0
  11. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/setup.cfg +0 -0
  12. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/src/ghga_transpiler/__init__.py +0 -0
  13. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/src/ghga_transpiler/__main__.py +0 -0
  14. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/src/ghga_transpiler/cli.py +0 -0
  15. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/src/ghga_transpiler/config/__init__.py +0 -0
  16. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/src/ghga_transpiler/config/config.py +0 -0
  17. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/src/ghga_transpiler/config/exceptions.py +0 -0
  18. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/src/ghga_transpiler/configs/0.10.yaml +0 -0
  19. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/src/ghga_transpiler/configs/1.0.yaml +0 -0
  20. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/src/ghga_transpiler/configs/1.1.yaml +0 -0
  21. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/src/ghga_transpiler/configs/__init__.py +0 -0
  22. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/src/ghga_transpiler/core.py +0 -0
  23. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/src/ghga_transpiler/io.py +0 -0
  24. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/src/ghga_transpiler.egg-info/dependency_links.txt +0 -0
  25. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/src/ghga_transpiler.egg-info/entry_points.txt +0 -0
  26. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/src/ghga_transpiler.egg-info/requires.txt +0 -0
  27. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/src/ghga_transpiler.egg-info/top_level.txt +0 -0
  28. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/tests/test_convert_workbook.py +0 -0
  29. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/tests/test_create_config.py +0 -0
  30. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/tests/test_io.py +0 -0
  31. {ghga_transpiler-2.3.2 → ghga_transpiler-2.4.1}/tests/test_process_workbook.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ghga_transpiler
3
- Version: 2.3.2
3
+ Version: 2.4.1
4
4
  Summary: GHGA-Transpiler - excel to JSON converter
5
5
  Author-email: "German Human Genome Phenome Archive (GHGA)" <contact@ghga.de>
6
6
  License: Apache 2.0
@@ -21,7 +21,7 @@ classifiers = [
21
21
  "Intended Audience :: Developers",
22
22
  ]
23
23
  name = "ghga_transpiler"
24
- version = "2.3.2"
24
+ version = "2.4.1"
25
25
  description = "GHGA-Transpiler - excel to JSON converter"
26
26
  dependencies = [
27
27
  "typer >= 0.12",
@@ -28,6 +28,9 @@ worksheets:
28
28
  - settings:
29
29
  end_column: 7
30
30
  name: analysis_method_supporting_files
31
+ transformations:
32
+ included_in_submission:
33
+ !!python/name:ghga_transpiler.transformations.to_boolean
31
34
  sheet_name: AnalysisMethodSupportingFile
32
35
  - settings:
33
36
  end_column: 7
@@ -64,6 +67,9 @@ worksheets:
64
67
  - settings:
65
68
  end_column: 7
66
69
  name: individual_supporting_files
70
+ transformations:
71
+ included_in_submission:
72
+ !!python/name:ghga_transpiler.transformations.to_boolean
67
73
  sheet_name: IndividualSupportingFile
68
74
  - settings:
69
75
  end_column: 21
@@ -119,10 +125,15 @@ worksheets:
119
125
  !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
120
126
  attributes:
121
127
  !!python/object/apply:ghga_transpiler.transformations.to_attributes []
128
+ sequencing_read_length:
129
+ !!python/name:ghga_transpiler.transformations.to_string
122
130
  sheet_name: ExperimentMethod
123
131
  - settings:
124
132
  end_column: 7
125
133
  name: experiment_method_supporting_files
134
+ transformations:
135
+ included_in_submission:
136
+ !!python/name:ghga_transpiler.transformations.to_boolean
126
137
  sheet_name: ExperimentMethodSupportingFile
127
138
  - settings:
128
139
  end_column: 8
@@ -136,10 +147,17 @@ worksheets:
136
147
  !!python/object/apply:ghga_transpiler.transformations.to_list []
137
148
  format:
138
149
  !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
150
+ sequencing_lane_id:
151
+ !!python/name:ghga_transpiler.transformations.to_string
152
+ included_in_submission:
153
+ !!python/name:ghga_transpiler.transformations.to_boolean
139
154
  sheet_name: ResearchDataFile
140
155
  - settings:
141
156
  end_column: 7
142
157
  name: process_data_files
158
+ transformations:
159
+ included_in_submission:
160
+ !!python/name:ghga_transpiler.transformations.to_boolean
143
161
  sheet_name: ProcessDataFile
144
162
  - settings:
145
163
  end_column: 7
@@ -30,6 +30,9 @@ worksheets:
30
30
  - settings:
31
31
  end_column: 7
32
32
  name: analysis_method_supporting_files
33
+ transformations:
34
+ included_in_submission:
35
+ !!python/name:ghga_transpiler.transformations.to_boolean
33
36
  sheet_name: AnalysisMethodSupportingFile
34
37
  - settings:
35
38
  end_column: 7
@@ -66,6 +69,9 @@ worksheets:
66
69
  - settings:
67
70
  end_column: 7
68
71
  name: individual_supporting_files
72
+ transformations:
73
+ included_in_submission:
74
+ !!python/name:ghga_transpiler.transformations.to_boolean
69
75
  sheet_name: IndividualSupportingFile
70
76
  - settings:
71
77
  end_column: 21
@@ -121,10 +127,15 @@ worksheets:
121
127
  !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
122
128
  attributes:
123
129
  !!python/object/apply:ghga_transpiler.transformations.to_attributes []
130
+ sequencing_read_length:
131
+ !!python/name:ghga_transpiler.transformations.to_string
124
132
  sheet_name: ExperimentMethod
125
133
  - settings:
126
134
  end_column: 7
127
135
  name: experiment_method_supporting_files
136
+ transformations:
137
+ included_in_submission:
138
+ !!python/name:ghga_transpiler.transformations.to_boolean
128
139
  sheet_name: ExperimentMethodSupportingFile
129
140
  - settings:
130
141
  end_column: 8
@@ -138,10 +149,17 @@ worksheets:
138
149
  !!python/object/apply:ghga_transpiler.transformations.to_list []
139
150
  format:
140
151
  !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
152
+ sequencing_lane_id:
153
+ !!python/name:ghga_transpiler.transformations.to_string
154
+ included_in_submission:
155
+ !!python/name:ghga_transpiler.transformations.to_boolean
141
156
  sheet_name: ResearchDataFile
142
157
  - settings:
143
158
  end_column: 7
144
159
  name: process_data_files
160
+ transformations:
161
+ included_in_submission:
162
+ !!python/name:ghga_transpiler.transformations.to_boolean
145
163
  sheet_name: ProcessDataFile
146
164
  - settings:
147
165
  end_column: 7
@@ -0,0 +1,192 @@
1
+ ghga_metadata_version: 2.2.0
2
+ default_settings:
3
+ header_row: 1
4
+ start_row: 7
5
+ start_column: 1
6
+ transformations:
7
+ attributes:
8
+ !!python/object/apply:ghga_transpiler.transformations.to_attributes []
9
+ format:
10
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
11
+ worksheets:
12
+ - settings:
13
+ end_column: 7
14
+ name: analyses
15
+ transformations:
16
+ research_data_files:
17
+ !!python/object/apply:ghga_transpiler.transformations.to_list []
18
+ sheet_name: Analysis
19
+ - settings:
20
+ end_column: 17
21
+ name: analysis_methods
22
+ transformations:
23
+ reference_type:
24
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
25
+ parameters:
26
+ !!python/object/apply:ghga_transpiler.transformations.to_attributes []
27
+ software_versions:
28
+ !!python/object/apply:ghga_transpiler.transformations.to_attributes []
29
+ attributes:
30
+ !!python/object/apply:ghga_transpiler.transformations.to_attributes []
31
+ sheet_name: AnalysisMethod
32
+ - settings:
33
+ end_column: 7
34
+ name: analysis_method_supporting_files
35
+ transformations:
36
+ included_in_submission:
37
+ !!python/name:ghga_transpiler.transformations.to_boolean
38
+ sheet_name: AnalysisMethodSupportingFile
39
+ - settings:
40
+ end_column: 7
41
+ name: studies
42
+ transformations:
43
+ affiliations:
44
+ !!python/object/apply:ghga_transpiler.transformations.to_list []
45
+ attributes:
46
+ !!python/object/apply:ghga_transpiler.transformations.to_attributes []
47
+ types:
48
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case_list []
49
+ attributes:
50
+ !!python/object/apply:ghga_transpiler.transformations.to_attributes []
51
+ sheet_name: Study
52
+ - settings:
53
+ end_column: 10
54
+ name: individuals
55
+ transformations:
56
+ phenotypic_features_terms:
57
+ !!python/object/apply:ghga_transpiler.transformations.to_list []
58
+ phenotypic_features_ids:
59
+ !!python/object/apply:ghga_transpiler.transformations.to_list []
60
+ diagnosis_ids:
61
+ !!python/object/apply:ghga_transpiler.transformations.to_list []
62
+ diagnosis_terms:
63
+ !!python/object/apply:ghga_transpiler.transformations.to_list []
64
+ sex:
65
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
66
+ ancestry_terms:
67
+ !!python/object/apply:ghga_transpiler.transformations.to_list []
68
+ ancestry_ids:
69
+ !!python/object/apply:ghga_transpiler.transformations.to_list []
70
+ sheet_name: Individual
71
+ - settings:
72
+ end_column: 7
73
+ name: individual_supporting_files
74
+ transformations:
75
+ included_in_submission:
76
+ !!python/name:ghga_transpiler.transformations.to_boolean
77
+ sheet_name: IndividualSupportingFile
78
+ - settings:
79
+ end_column: 21
80
+ name: samples
81
+ transformations:
82
+ type:
83
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
84
+ storage:
85
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
86
+ disease_or_healthy:
87
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
88
+ case_control_status:
89
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
90
+ xref: !!python/object/apply:ghga_transpiler.transformations.to_list []
91
+ biospecimen_age_at_sampling:
92
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
93
+ biospecimen_vital_status_at_sampling:
94
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
95
+ biospecimen_isolation:
96
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
97
+ biospecimen_storage:
98
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
99
+ attributes:
100
+ !!python/object/apply:ghga_transpiler.transformations.to_attributes []
101
+ sheet_name: Sample
102
+ - settings:
103
+ end_column: 23
104
+ name: experiment_methods
105
+ transformations:
106
+ library_type:
107
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
108
+ library_selection_methods:
109
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case_list []
110
+ library_preparation_kit_retail_name:
111
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
112
+ primer:
113
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
114
+ end_bias:
115
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
116
+ target_regions:
117
+ !!python/object/apply:ghga_transpiler.transformations.to_list []
118
+ rnaseq_strandedness:
119
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
120
+ instrument_model:
121
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
122
+ sequencing_layout:
123
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
124
+ flow_cell_type:
125
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
126
+ sample_barcode_read:
127
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
128
+ sequencing_layout:
129
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
130
+ attributes:
131
+ !!python/object/apply:ghga_transpiler.transformations.to_attributes []
132
+ sequencing_read_length:
133
+ !!python/name:ghga_transpiler.transformations.to_string
134
+ sheet_name: ExperimentMethod
135
+ - settings:
136
+ end_column: 7
137
+ name: experiment_method_supporting_files
138
+ transformations:
139
+ included_in_submission:
140
+ !!python/name:ghga_transpiler.transformations.to_boolean
141
+ sheet_name: ExperimentMethodSupportingFile
142
+ - settings:
143
+ end_column: 8
144
+ name: experiments
145
+ sheet_name: Experiment
146
+ - settings:
147
+ end_column: 9
148
+ name: research_data_files
149
+ transformations:
150
+ experiments:
151
+ !!python/object/apply:ghga_transpiler.transformations.to_list []
152
+ format:
153
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
154
+ sequencing_lane_id:
155
+ !!python/name:ghga_transpiler.transformations.to_string
156
+ included_in_submission:
157
+ !!python/name:ghga_transpiler.transformations.to_boolean
158
+ sheet_name: ResearchDataFile
159
+ - settings:
160
+ end_column: 7
161
+ name: process_data_files
162
+ transformations:
163
+ included_in_submission:
164
+ !!python/name:ghga_transpiler.transformations.to_boolean
165
+ sheet_name: ProcessDataFile
166
+ - settings:
167
+ end_column: 7
168
+ name: datasets
169
+ transformations:
170
+ types: !!python/object/apply:ghga_transpiler.transformations.to_list []
171
+ sheet_name: Dataset
172
+ - settings:
173
+ end_column: 11
174
+ name: data_access_policies
175
+ transformations:
176
+ data_use_modifier_terms:
177
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case_list []
178
+ data_use_permission_term:
179
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
180
+ data_use_modifier_ids:
181
+ !!python/object/apply:ghga_transpiler.transformations.to_list []
182
+ sheet_name: DataAccessPolicy
183
+ - settings:
184
+ end_column: 4
185
+ name: data_access_committees
186
+ sheet_name: DataAccessCommittee
187
+ - settings:
188
+ end_column: 9
189
+ name: publications
190
+ transformations:
191
+ xref: !!python/object/apply:ghga_transpiler.transformations.to_list []
192
+ sheet_name: Publication
@@ -20,6 +20,11 @@
20
20
  from collections.abc import Callable
21
21
 
22
22
 
23
+ def to_string(value: int | str) -> str:
24
+ """Converts a value to string"""
25
+ return str(value)
26
+
27
+
23
28
  def split_by_semicolon(value: str) -> list[str]:
24
29
  """Splits a string by semicolon"""
25
30
  return [elem.strip() for elem in value.split(";")]
@@ -64,3 +69,18 @@ def snake_case_list(value: str) -> list[str]:
64
69
  def to_snake_case_list() -> Callable:
65
70
  """Returns a function that converts a semicolon separated string into a list of snake-cased strings"""
66
71
  return snake_case_list
72
+
73
+
74
+ def to_boolean(value: bool | str) -> bool:
75
+ """Converts common string boolean values to bool.
76
+
77
+ Accepts: true/false in any casing (e.g., "true", "False", "TRUE").
78
+ """
79
+ if isinstance(value, bool):
80
+ return value
81
+ normalized = value.strip().casefold()
82
+ if normalized == "true":
83
+ return True
84
+ if normalized == "false":
85
+ return False
86
+ raise ValueError(f"Invalid boolean string: {value!r}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ghga_transpiler
3
- Version: 2.3.2
3
+ Version: 2.4.1
4
4
  Summary: GHGA-Transpiler - excel to JSON converter
5
5
  Author-email: "German Human Genome Phenome Archive (GHGA)" <contact@ghga.de>
6
6
  License: Apache 2.0
@@ -21,6 +21,7 @@ src/ghga_transpiler/configs/1.0.yaml
21
21
  src/ghga_transpiler/configs/1.1.yaml
22
22
  src/ghga_transpiler/configs/2.0.yaml
23
23
  src/ghga_transpiler/configs/2.1.yaml
24
+ src/ghga_transpiler/configs/2.2.yaml
24
25
  src/ghga_transpiler/configs/__init__.py
25
26
  tests/test_convert_workbook.py
26
27
  tests/test_create_config.py
File without changes