ghga-transpiler 2.1.4__tar.gz → 2.2.0__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 (30) hide show
  1. {ghga_transpiler-2.1.4/src/ghga_transpiler.egg-info → ghga_transpiler-2.2.0}/PKG-INFO +6 -3
  2. {ghga_transpiler-2.1.4 → ghga_transpiler-2.2.0}/pyproject.toml +6 -4
  3. {ghga_transpiler-2.1.4 → ghga_transpiler-2.2.0}/src/ghga_transpiler/__init__.py +1 -1
  4. {ghga_transpiler-2.1.4 → ghga_transpiler-2.2.0}/src/ghga_transpiler/cli.py +1 -1
  5. {ghga_transpiler-2.1.4 → ghga_transpiler-2.2.0}/src/ghga_transpiler/config/config.py +2 -0
  6. ghga_transpiler-2.2.0/src/ghga_transpiler/configs/2.0.yaml +162 -0
  7. {ghga_transpiler-2.1.4 → ghga_transpiler-2.2.0}/src/ghga_transpiler/core.py +3 -1
  8. {ghga_transpiler-2.1.4 → ghga_transpiler-2.2.0}/src/ghga_transpiler/io.py +2 -0
  9. {ghga_transpiler-2.1.4 → ghga_transpiler-2.2.0}/src/ghga_transpiler/transformations.py +1 -1
  10. {ghga_transpiler-2.1.4 → ghga_transpiler-2.2.0/src/ghga_transpiler.egg-info}/PKG-INFO +6 -3
  11. {ghga_transpiler-2.1.4 → ghga_transpiler-2.2.0}/src/ghga_transpiler.egg-info/SOURCES.txt +1 -0
  12. ghga_transpiler-2.2.0/src/ghga_transpiler.egg-info/requires.txt +13 -0
  13. ghga_transpiler-2.1.4/src/ghga_transpiler.egg-info/requires.txt +0 -6
  14. {ghga_transpiler-2.1.4 → ghga_transpiler-2.2.0}/LICENSE +0 -0
  15. {ghga_transpiler-2.1.4 → ghga_transpiler-2.2.0}/README.md +0 -0
  16. {ghga_transpiler-2.1.4 → ghga_transpiler-2.2.0}/setup.cfg +0 -0
  17. {ghga_transpiler-2.1.4 → ghga_transpiler-2.2.0}/src/ghga_transpiler/__main__.py +0 -0
  18. {ghga_transpiler-2.1.4 → ghga_transpiler-2.2.0}/src/ghga_transpiler/config/__init__.py +0 -0
  19. {ghga_transpiler-2.1.4 → ghga_transpiler-2.2.0}/src/ghga_transpiler/config/exceptions.py +0 -0
  20. {ghga_transpiler-2.1.4 → ghga_transpiler-2.2.0}/src/ghga_transpiler/configs/0.10.yaml +0 -0
  21. {ghga_transpiler-2.1.4 → ghga_transpiler-2.2.0}/src/ghga_transpiler/configs/1.0.yaml +0 -0
  22. {ghga_transpiler-2.1.4 → ghga_transpiler-2.2.0}/src/ghga_transpiler/configs/1.1.yaml +0 -0
  23. {ghga_transpiler-2.1.4 → ghga_transpiler-2.2.0}/src/ghga_transpiler/configs/__init__.py +0 -0
  24. {ghga_transpiler-2.1.4 → ghga_transpiler-2.2.0}/src/ghga_transpiler.egg-info/dependency_links.txt +0 -0
  25. {ghga_transpiler-2.1.4 → ghga_transpiler-2.2.0}/src/ghga_transpiler.egg-info/entry_points.txt +0 -0
  26. {ghga_transpiler-2.1.4 → ghga_transpiler-2.2.0}/src/ghga_transpiler.egg-info/top_level.txt +0 -0
  27. {ghga_transpiler-2.1.4 → ghga_transpiler-2.2.0}/tests/test_convert_workbook.py +0 -0
  28. {ghga_transpiler-2.1.4 → ghga_transpiler-2.2.0}/tests/test_create_config.py +0 -0
  29. {ghga_transpiler-2.1.4 → ghga_transpiler-2.2.0}/tests/test_io.py +0 -0
  30. {ghga_transpiler-2.1.4 → ghga_transpiler-2.2.0}/tests/test_process_workbook.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ghga_transpiler
3
- Version: 2.1.4
3
+ Version: 2.2.0
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
@@ -13,15 +13,18 @@ Classifier: License :: OSI Approved :: Apache Software License
13
13
  Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
14
14
  Classifier: Topic :: Software Development :: Libraries
15
15
  Classifier: Intended Audience :: Developers
16
- Requires-Python: >=3.12
16
+ Requires-Python: >=3.9
17
17
  Description-Content-Type: text/markdown
18
18
  License-File: LICENSE
19
19
  Requires-Dist: typer>=0.12
20
20
  Requires-Dist: openpyxl==3.*,>=3.1.2
21
21
  Requires-Dist: defusedxml==0.*,>=0.7
22
- Requires-Dist: pydantic<3,>=2
22
+ Requires-Dist: pydantic<3,>=2.6
23
23
  Requires-Dist: PyYAML~=6.0
24
24
  Requires-Dist: semver==3.*
25
+ Requires-Dist: exceptiongroup>=1.0.0; python_version < "3.11"
26
+ Requires-Dist: tomli>=2.0.0; python_version < "3.11"
27
+ Requires-Dist: eval-type-backport==0.2.0; python_version < "3.10"
25
28
 
26
29
 
27
30
  [![tests](https://github.com/ghga-de/ghga-transpiler/actions/workflows/tests.yaml/badge.svg)](https://github.com/ghga-de/ghga-transpiler/actions/workflows/unit_and_int_tests.yaml)
@@ -9,7 +9,7 @@ readme = "README.md"
9
9
  authors = [
10
10
  { name = "German Human Genome Phenome Archive (GHGA)", email = "contact@ghga.de" },
11
11
  ]
12
- requires-python = ">=3.12"
12
+ requires-python = ">=3.9"
13
13
  classifiers = [
14
14
  "Development Status :: 1 - Planning",
15
15
  "Operating System :: POSIX :: Linux",
@@ -21,15 +21,18 @@ classifiers = [
21
21
  "Intended Audience :: Developers",
22
22
  ]
23
23
  name = "ghga_transpiler"
24
- version = "2.1.4"
24
+ version = "2.2.0"
25
25
  description = "GHGA-Transpiler - excel to JSON converter"
26
26
  dependencies = [
27
27
  "typer >= 0.12",
28
28
  "openpyxl >= 3.1.2, == 3.*",
29
29
  "defusedxml >= 0.7, == 0.*",
30
- "pydantic >=2, <3",
30
+ "pydantic >=2.6, <3",
31
31
  "PyYAML ~= 6.0",
32
32
  "semver == 3.*",
33
+ "exceptiongroup>=1.0.0; python_version < \"3.11\"",
34
+ "tomli>= 2.0.0; python_version < \"3.11\"",
35
+ "eval-type-backport==0.2.0; python_version < \"3.10\"",
33
36
  ]
34
37
 
35
38
  [project.license]
@@ -66,7 +69,6 @@ src = [
66
69
  "examples",
67
70
  "scripts",
68
71
  ]
69
- target-version = "py312"
70
72
 
71
73
  [tool.ruff.lint]
72
74
  fixable = [
@@ -18,7 +18,7 @@
18
18
 
19
19
  from openpyxl.xml import DEFUSEDXML
20
20
 
21
- __version__ = "2.1.4"
21
+ __version__ = "2.2.0"
22
22
 
23
23
  if not DEFUSEDXML:
24
24
  raise RuntimeError(
@@ -45,7 +45,7 @@ def transpile(
45
45
  dir_okay=False,
46
46
  readable=True,
47
47
  ),
48
- output_file: Optional[Path] = typer.Argument( # noqa: UP007 (typer issue #461)
48
+ output_file: Optional[Path] = typer.Argument(
49
49
  None, help="The path to output file (JSON).", dir_okay=False
50
50
  ),
51
51
  force: bool = typer.Option(
@@ -17,6 +17,8 @@
17
17
 
18
18
  """Module to process config file"""
19
19
 
20
+ from __future__ import annotations
21
+
20
22
  from collections import Counter
21
23
  from collections.abc import Callable
22
24
  from importlib import resources
@@ -0,0 +1,162 @@
1
+ ghga_metadata_version: 2.0.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: 11
21
+ name: analysis_methods
22
+ transformations:
23
+ parameters:
24
+ !!python/object/apply:ghga_transpiler.transformations.to_attributes []
25
+ software_versions:
26
+ !!python/object/apply:ghga_transpiler.transformations.to_attributes []
27
+ sheet_name: AnalysisMethod
28
+ - settings:
29
+ end_column: 7
30
+ name: analysis_method_supporting_files
31
+ sheet_name: AnalysisMethodSupportingFile
32
+ - settings:
33
+ end_column: 7
34
+ name: studies
35
+ transformations:
36
+ affiliations:
37
+ !!python/object/apply:ghga_transpiler.transformations.to_list []
38
+ attributes:
39
+ !!python/object/apply:ghga_transpiler.transformations.to_attributes []
40
+ types:
41
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case_list []
42
+ sheet_name: Study
43
+ - settings:
44
+ end_column: 10
45
+ name: individuals
46
+ transformations:
47
+ phenotypic_features_terms:
48
+ !!python/object/apply:ghga_transpiler.transformations.to_list []
49
+ phenotypic_features_ids:
50
+ !!python/object/apply:ghga_transpiler.transformations.to_list []
51
+ diagnosis_ids:
52
+ !!python/object/apply:ghga_transpiler.transformations.to_list []
53
+ diagnosis_terms:
54
+ !!python/object/apply:ghga_transpiler.transformations.to_list []
55
+ sex:
56
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
57
+ ancestry_terms:
58
+ !!python/object/apply:ghga_transpiler.transformations.to_list []
59
+ ancestry_ids:
60
+ !!python/object/apply:ghga_transpiler.transformations.to_list []
61
+ sheet_name: Individual
62
+ - settings:
63
+ end_column: 7
64
+ name: individual_supporting_files
65
+ sheet_name: IndividualSupportingFile
66
+ - settings:
67
+ end_column: 21
68
+ name: samples
69
+ transformations:
70
+ type:
71
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
72
+ storage:
73
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
74
+ disease_or_healthy:
75
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
76
+ case_control_status:
77
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
78
+ xref: !!python/object/apply:ghga_transpiler.transformations.to_list []
79
+ biospecimen_age_at_sampling:
80
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
81
+ biospecimen_vital_status_at_sampling:
82
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
83
+ biospecimen_isolation:
84
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
85
+ biospecimen_storage:
86
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
87
+ sheet_name: Sample
88
+ - settings:
89
+ end_column: 23
90
+ name: experiment_methods
91
+ transformations:
92
+ library_type:
93
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
94
+ library_selection_methods:
95
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case_list []
96
+ library_preparation_kit_retail_name:
97
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
98
+ primer:
99
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
100
+ end_bias:
101
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
102
+ target_regions:
103
+ !!python/object/apply:ghga_transpiler.transformations.to_list []
104
+ rnaseq_strandedness:
105
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
106
+ instrument_model:
107
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
108
+ sequencing_layout:
109
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
110
+ flow_cell_type:
111
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
112
+ sample_barcode_read:
113
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
114
+ sequencing_layout:
115
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
116
+ sheet_name: ExperimentMethod
117
+ - settings:
118
+ end_column: 7
119
+ name: experiment_method_supporting_files
120
+ sheet_name: ExperimentMethodSupportingFile
121
+ - settings:
122
+ end_column: 8
123
+ name: experiments
124
+ sheet_name: Experiment
125
+ - settings:
126
+ end_column: 9
127
+ name: research_data_files
128
+ transformations:
129
+ experiments:
130
+ !!python/object/apply:ghga_transpiler.transformations.to_list []
131
+ sheet_name: ResearchDataFile
132
+ - settings:
133
+ end_column: 7
134
+ name: process_data_files
135
+ sheet_name: ProcessDataFile
136
+ - settings:
137
+ end_column: 7
138
+ name: datasets
139
+ transformations:
140
+ types: !!python/object/apply:ghga_transpiler.transformations.to_list []
141
+ sheet_name: Dataset
142
+ - settings:
143
+ end_column: 11
144
+ name: data_access_policies
145
+ transformations:
146
+ data_use_modifier_terms:
147
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case_list []
148
+ data_use_permission_term:
149
+ !!python/object/apply:ghga_transpiler.transformations.to_snake_case []
150
+ data_use_modifier_ids:
151
+ !!python/object/apply:ghga_transpiler.transformations.to_list []
152
+ sheet_name: DataAccessPolicy
153
+ - settings:
154
+ end_column: 4
155
+ name: data_access_committees
156
+ sheet_name: DataAccessCommittee
157
+ - settings:
158
+ end_column: 9
159
+ name: publications
160
+ transformations:
161
+ xref: !!python/object/apply:ghga_transpiler.transformations.to_list []
162
+ sheet_name: Publication
@@ -17,6 +17,8 @@
17
17
 
18
18
  """This module contains functionalities for processing excel sheets into json object."""
19
19
 
20
+ from __future__ import annotations
21
+
20
22
  from collections.abc import Callable
21
23
  from importlib import resources
22
24
 
@@ -97,7 +99,7 @@ def convert_rows(header, rows) -> list[dict]:
97
99
  return [
98
100
  {
99
101
  key: value
100
- for key, value in zip(header, row, strict=False)
102
+ for key, value in zip(header, row)
101
103
  if value is not None and value != ""
102
104
  }
103
105
  for row in rows
@@ -17,6 +17,8 @@
17
17
 
18
18
  """IO related functionality"""
19
19
 
20
+ from __future__ import annotations
21
+
20
22
  import json
21
23
  import sys
22
24
  from importlib import resources
@@ -36,7 +36,7 @@ def to_attributes() -> Callable:
36
36
  def split_one(value: str) -> dict:
37
37
  """Returns a dictionary with key, value as keys, splitted string as values"""
38
38
  splitted = (elem.strip() for elem in value.split("="))
39
- return dict(zip(("key", "value"), splitted, strict=False))
39
+ return dict(zip(("key", "value"), splitted))
40
40
 
41
41
  def split_mult(value: str) -> list[dict]:
42
42
  """Converts string to attributes"""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ghga_transpiler
3
- Version: 2.1.4
3
+ Version: 2.2.0
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
@@ -13,15 +13,18 @@ Classifier: License :: OSI Approved :: Apache Software License
13
13
  Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
14
14
  Classifier: Topic :: Software Development :: Libraries
15
15
  Classifier: Intended Audience :: Developers
16
- Requires-Python: >=3.12
16
+ Requires-Python: >=3.9
17
17
  Description-Content-Type: text/markdown
18
18
  License-File: LICENSE
19
19
  Requires-Dist: typer>=0.12
20
20
  Requires-Dist: openpyxl==3.*,>=3.1.2
21
21
  Requires-Dist: defusedxml==0.*,>=0.7
22
- Requires-Dist: pydantic<3,>=2
22
+ Requires-Dist: pydantic<3,>=2.6
23
23
  Requires-Dist: PyYAML~=6.0
24
24
  Requires-Dist: semver==3.*
25
+ Requires-Dist: exceptiongroup>=1.0.0; python_version < "3.11"
26
+ Requires-Dist: tomli>=2.0.0; python_version < "3.11"
27
+ Requires-Dist: eval-type-backport==0.2.0; python_version < "3.10"
25
28
 
26
29
 
27
30
  [![tests](https://github.com/ghga-de/ghga-transpiler/actions/workflows/tests.yaml/badge.svg)](https://github.com/ghga-de/ghga-transpiler/actions/workflows/unit_and_int_tests.yaml)
@@ -19,6 +19,7 @@ src/ghga_transpiler/config/exceptions.py
19
19
  src/ghga_transpiler/configs/0.10.yaml
20
20
  src/ghga_transpiler/configs/1.0.yaml
21
21
  src/ghga_transpiler/configs/1.1.yaml
22
+ src/ghga_transpiler/configs/2.0.yaml
22
23
  src/ghga_transpiler/configs/__init__.py
23
24
  tests/test_convert_workbook.py
24
25
  tests/test_create_config.py
@@ -0,0 +1,13 @@
1
+ typer>=0.12
2
+ openpyxl==3.*,>=3.1.2
3
+ defusedxml==0.*,>=0.7
4
+ pydantic<3,>=2.6
5
+ PyYAML~=6.0
6
+ semver==3.*
7
+
8
+ [:python_version < "3.10"]
9
+ eval-type-backport==0.2.0
10
+
11
+ [:python_version < "3.11"]
12
+ exceptiongroup>=1.0.0
13
+ tomli>=2.0.0
@@ -1,6 +0,0 @@
1
- typer>=0.12
2
- openpyxl==3.*,>=3.1.2
3
- defusedxml==0.*,>=0.7
4
- pydantic<3,>=2
5
- PyYAML~=6.0
6
- semver==3.*
File without changes