grz-cli 0.6.0__tar.gz → 0.7.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.
- grz_cli-0.7.0/.gitignore +195 -0
- grz_cli-0.7.0/CHANGELOG.md +8 -0
- grz_cli-0.6.0/README.md → grz_cli-0.7.0/PKG-INFO +34 -51
- grz_cli-0.6.0/src/grz_cli.egg-info/PKG-INFO → grz_cli-0.7.0/README.md +3 -88
- grz_cli-0.7.0/pyproject.toml +58 -0
- grz_cli-0.7.0/src/grz_cli/__init__.py +1 -0
- {grz_cli-0.6.0 → grz_cli-0.7.0}/src/grz_cli/cli.py +2 -21
- {grz_cli-0.6.0 → grz_cli-0.7.0}/src/grz_cli/commands/encrypt.py +13 -9
- {grz_cli-0.6.0 → grz_cli-0.7.0}/src/grz_cli/commands/submit.py +1 -1
- {grz_cli-0.6.0 → grz_cli-0.7.0}/src/grz_cli/commands/upload.py +6 -6
- {grz_cli-0.6.0 → grz_cli-0.7.0}/src/grz_cli/commands/validate.py +2 -3
- grz_cli-0.7.0/src/grz_cli/models/config.py +57 -0
- grz_cli-0.6.0/PKG-INFO +0 -283
- grz_cli-0.6.0/pyproject.toml +0 -209
- grz_cli-0.6.0/setup.cfg +0 -4
- grz_cli-0.6.0/src/grz_cli/__init__.py +0 -1
- grz_cli-0.6.0/src/grz_cli/commands/archive.py +0 -43
- grz_cli-0.6.0/src/grz_cli/commands/clean.py +0 -77
- grz_cli-0.6.0/src/grz_cli/commands/common.py +0 -79
- grz_cli-0.6.0/src/grz_cli/commands/consent.py +0 -115
- grz_cli-0.6.0/src/grz_cli/commands/decrypt.py +0 -45
- grz_cli-0.6.0/src/grz_cli/commands/download.py +0 -46
- grz_cli-0.6.0/src/grz_cli/commands/list_submissions.py +0 -50
- grz_cli-0.6.0/src/grz_cli/commands/pruefbericht.py +0 -181
- grz_cli-0.6.0/src/grz_cli/models/config.py +0 -170
- grz_cli-0.6.0/src/grz_cli/progress/__init__.py +0 -21
- grz_cli-0.6.0/src/grz_cli/progress/progress_logging.py +0 -193
- grz_cli-0.6.0/src/grz_cli/progress/states.py +0 -53
- grz_cli-0.6.0/src/grz_cli/transfer.py +0 -64
- grz_cli-0.6.0/src/grz_cli/utils/__init__.py +0 -1
- grz_cli-0.6.0/src/grz_cli/utils/checksums.py +0 -43
- grz_cli-0.6.0/src/grz_cli/utils/config.py +0 -18
- grz_cli-0.6.0/src/grz_cli/utils/crypt.py +0 -143
- grz_cli-0.6.0/src/grz_cli/utils/io.py +0 -111
- grz_cli-0.6.0/src/grz_cli/utils/paths.py +0 -26
- grz_cli-0.6.0/src/grz_cli/validation/__init__.py +0 -1
- grz_cli-0.6.0/src/grz_cli/validation/bam.py +0 -39
- grz_cli-0.6.0/src/grz_cli/validation/fastq.py +0 -164
- grz_cli-0.6.0/src/grz_cli/workers/__init__.py +0 -1
- grz_cli-0.6.0/src/grz_cli/workers/download.py +0 -240
- grz_cli-0.6.0/src/grz_cli/workers/submission.py +0 -697
- grz_cli-0.6.0/src/grz_cli/workers/upload.py +0 -249
- grz_cli-0.6.0/src/grz_cli/workers/worker.py +0 -225
- grz_cli-0.6.0/src/grz_cli.egg-info/SOURCES.txt +0 -58
- grz_cli-0.6.0/src/grz_cli.egg-info/dependency_links.txt +0 -1
- grz_cli-0.6.0/src/grz_cli.egg-info/entry_points.txt +0 -2
- grz_cli-0.6.0/src/grz_cli.egg-info/requires.txt +0 -23
- grz_cli-0.6.0/src/grz_cli.egg-info/top_level.txt +0 -2
- grz_cli-0.6.0/tests/test_bam_validation.py +0 -15
- grz_cli-0.6.0/tests/test_cli.py +0 -271
- grz_cli-0.6.0/tests/test_download.py +0 -72
- grz_cli-0.6.0/tests/test_fastq_validation.py +0 -47
- grz_cli-0.6.0/tests/test_file_operations.py +0 -76
- grz_cli-0.6.0/tests/test_file_progress_logging.py +0 -193
- grz_cli-0.6.0/tests/test_parser.py +0 -55
- grz_cli-0.6.0/tests/test_read_multiple_json.py +0 -114
- grz_cli-0.6.0/tests/test_upload.py +0 -118
- {grz_cli-0.6.0 → grz_cli-0.7.0}/LICENSE +0 -0
- {grz_cli-0.6.0 → grz_cli-0.7.0}/MANIFEST.in +0 -0
- {grz_cli-0.6.0 → grz_cli-0.7.0}/src/__init__.py +0 -0
- {grz_cli-0.6.0 → grz_cli-0.7.0}/src/grz_cli/commands/__init__.py +0 -0
- {grz_cli-0.6.0 → grz_cli-0.7.0}/src/grz_cli/constants.py +0 -0
- {grz_cli-0.6.0 → grz_cli-0.7.0}/src/grz_cli/logging_setup.py +0 -0
- {grz_cli-0.6.0 → grz_cli-0.7.0}/src/grz_cli/models/__init__.py +0 -0
- {grz_cli-0.6.0 → grz_cli-0.7.0}/src/grz_cli/py.typed +0 -0
grz_cli-0.7.0/.gitignore
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py,cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
#uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
#poetry.toml
|
|
110
|
+
|
|
111
|
+
# pdm
|
|
112
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
+
#pdm.lock
|
|
114
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
115
|
+
# in version control.
|
|
116
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
|
117
|
+
.pdm.toml
|
|
118
|
+
.pdm-python
|
|
119
|
+
.pdm-build/
|
|
120
|
+
|
|
121
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
122
|
+
__pypackages__/
|
|
123
|
+
|
|
124
|
+
# Celery stuff
|
|
125
|
+
celerybeat-schedule
|
|
126
|
+
celerybeat.pid
|
|
127
|
+
|
|
128
|
+
# SageMath parsed files
|
|
129
|
+
*.sage.py
|
|
130
|
+
|
|
131
|
+
# Environments
|
|
132
|
+
.env
|
|
133
|
+
.venv
|
|
134
|
+
env/
|
|
135
|
+
venv/
|
|
136
|
+
ENV/
|
|
137
|
+
env.bak/
|
|
138
|
+
venv.bak/
|
|
139
|
+
|
|
140
|
+
# Spyder project settings
|
|
141
|
+
.spyderproject
|
|
142
|
+
.spyproject
|
|
143
|
+
|
|
144
|
+
# Rope project settings
|
|
145
|
+
.ropeproject
|
|
146
|
+
|
|
147
|
+
# mkdocs documentation
|
|
148
|
+
/site
|
|
149
|
+
|
|
150
|
+
# mypy
|
|
151
|
+
.mypy_cache/
|
|
152
|
+
.dmypy.json
|
|
153
|
+
dmypy.json
|
|
154
|
+
|
|
155
|
+
# Pyre type checker
|
|
156
|
+
.pyre/
|
|
157
|
+
|
|
158
|
+
# pytype static type analyzer
|
|
159
|
+
.pytype/
|
|
160
|
+
|
|
161
|
+
# Cython debug symbols
|
|
162
|
+
cython_debug/
|
|
163
|
+
|
|
164
|
+
# PyCharm
|
|
165
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
166
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
167
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
168
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
169
|
+
#.idea/
|
|
170
|
+
|
|
171
|
+
# Abstra
|
|
172
|
+
# Abstra is an AI-powered process automation framework.
|
|
173
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
174
|
+
# Learn more at https://abstra.io/docs
|
|
175
|
+
.abstra/
|
|
176
|
+
|
|
177
|
+
# Visual Studio Code
|
|
178
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
179
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
180
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
181
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
182
|
+
# .vscode/
|
|
183
|
+
|
|
184
|
+
# Ruff stuff:
|
|
185
|
+
.ruff_cache/
|
|
186
|
+
|
|
187
|
+
# PyPI configuration file
|
|
188
|
+
.pypirc
|
|
189
|
+
|
|
190
|
+
# Cursor
|
|
191
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
192
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
193
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
194
|
+
.cursorignore
|
|
195
|
+
.cursorindexingignore
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.7.0](https://github.com/BfArM-MVH/grz-tools/compare/grz-cli-v0.6.1...grz-cli-v0.7.0) (2025-06-11)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* migrate to monorepo configuration ([36c7360](https://github.com/BfArM-MVH/grz-tools/commit/36c736044ce09473cc664b4471117465c5cab9a3))
|
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: grz-cli
|
|
3
|
+
Version: 0.7.0
|
|
4
|
+
Summary: Tool for validation, encryption and upload of MV submissions to GDCs.
|
|
5
|
+
Project-URL: Homepage, https://github.com/BfArM-MVH/grz-tools
|
|
6
|
+
Project-URL: Repository, https://github.com/BfArM-MVH/grz-tools
|
|
7
|
+
Project-URL: Documentation, https://github.com/BfArM-MVH/grz-tools/tree/main/packages/grz-cli
|
|
8
|
+
Project-URL: Issues, https://github.com/BfArM-MVH/grz-tools/issues
|
|
9
|
+
Author-email: Koray Kirli <koraykirli@gmail.com>, Mathias Lesche <mathias.lesche@tu-dresden.de>, "Florian R. Hölzlwimmer" <git.ich@frhoelzlwimmer.de>, Till Hartmann <till.hartmann@bih-charite.de>, Thomas Sell <thomas.sell@bih-charite.de>, Travis Wrightsman <travis.wrightsman@uni-tuebingen.de>
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: GDC,GRZ,S3
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Requires-Python: >=3.12
|
|
16
|
+
Requires-Dist: boto3<2,>=1.36
|
|
17
|
+
Requires-Dist: click<9,>=8.1.7
|
|
18
|
+
Requires-Dist: crypt4gh<2,>=1.7
|
|
19
|
+
Requires-Dist: grz-common
|
|
20
|
+
Requires-Dist: grz-pydantic-models>=1.3.0
|
|
21
|
+
Requires-Dist: jsonschema<5,>=4.23.0
|
|
22
|
+
Requires-Dist: platformdirs<5,>=4.3.6
|
|
23
|
+
Requires-Dist: pydantic-settings<2.10,>=2.9.0
|
|
24
|
+
Requires-Dist: pydantic<2.10,>=2.9.2
|
|
25
|
+
Requires-Dist: pysam==0.23.*
|
|
26
|
+
Requires-Dist: pyyaml<7,>=6.0.2
|
|
27
|
+
Requires-Dist: requests<3,>=2.32.3
|
|
28
|
+
Requires-Dist: rich==13.*
|
|
29
|
+
Requires-Dist: tqdm<5,>=4.66.5
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
|
|
1
32
|
# GRZ CLI
|
|
2
33
|
|
|
3
34
|
A command-line tool for validating, encrypting, uploading and downloading submissions to/from a GDC/GRZ (Genomrechenzentrum).
|
|
@@ -8,10 +39,9 @@ A command-line tool for validating, encrypting, uploading and downloading submis
|
|
|
8
39
|
- [Features](#features)
|
|
9
40
|
- [Installation](#installation)
|
|
10
41
|
- [Requirements](#requirements)
|
|
11
|
-
- [End-user setup](#end-user)
|
|
42
|
+
- [End-user setup](#end-user-setup)
|
|
12
43
|
- [Installation via `conda` (recommended)](#installation-via-conda-recommended)
|
|
13
44
|
- [Installation via `pip` (not recommended)](#installation-via-pip-not-recommended)
|
|
14
|
-
- [Development setup](#development-setup)
|
|
15
45
|
- [Usage](#usage)
|
|
16
46
|
- [Configuration](#configuration)
|
|
17
47
|
- [Exemplary submission procedure](#exemplary-submission-procedure)
|
|
@@ -110,18 +140,6 @@ pip upgrade grz-cli
|
|
|
110
140
|
Docker images are available via biocontainers at [https://biocontainers.pro/tools/grz-cli](https://biocontainers.pro/tools/grz-cli).
|
|
111
141
|
|
|
112
142
|
|
|
113
|
-
### Development setup
|
|
114
|
-
For development purposes, you can clone the repository and install the package in editable mode:
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
git clone https://codebase.helmholtz.cloud/grz-mv-genomseq/grz-cli
|
|
118
|
-
# create conda environment and activate it
|
|
119
|
-
conda env create -f grz-cli/environment-dev.yaml -n grz-tools-dev
|
|
120
|
-
conda activate grz-tools-dev
|
|
121
|
-
# install the grz-cli tool
|
|
122
|
-
pip install -e grz-cli/
|
|
123
|
-
```
|
|
124
|
-
|
|
125
143
|
## Usage
|
|
126
144
|
|
|
127
145
|
### Configuration
|
|
@@ -165,8 +183,6 @@ Example usage:
|
|
|
165
183
|
grz_cli validate --submission-dir foo
|
|
166
184
|
```
|
|
167
185
|
|
|
168
|
-
Option is for the usage at a hospital (Leistungserbringer) and GDC/GRZ.
|
|
169
|
-
|
|
170
186
|
### encrypt
|
|
171
187
|
|
|
172
188
|
If a working directory is not provided, then the current directory is used automatically. The log-files are going to be stored in the sub-folder of the working directory.
|
|
@@ -179,21 +195,6 @@ Files are stored in a folder named `encrypted_files` as a sub-folder of the work
|
|
|
179
195
|
grz-cli encrypt --submission-dir foo
|
|
180
196
|
```
|
|
181
197
|
|
|
182
|
-
Option is for the usage at a hospital (Leistungserbringer). Please approach your GDC/GRZ for a valid config file.
|
|
183
|
-
|
|
184
|
-
### decrypt
|
|
185
|
-
|
|
186
|
-
Decrypt a submission using the GRZ private key.
|
|
187
|
-
|
|
188
|
-
- `-s, --submission-dir`: Path to the submission directory containing both 'metadata/' and 'encrypted_files/' directories [**Required**]
|
|
189
|
-
- `-c,--config-file`: Path to config file [_optional_]
|
|
190
|
-
|
|
191
|
-
```bash
|
|
192
|
-
grz-cli decrypt --submission-dir foo
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
Option is for the usage at a GDC/GRZ.
|
|
196
|
-
|
|
197
198
|
### upload
|
|
198
199
|
|
|
199
200
|
Upload the submission into a S3 structure of a GRZ.
|
|
@@ -207,24 +208,6 @@ Example usage:
|
|
|
207
208
|
grz-cli upload --submission-dir foo
|
|
208
209
|
```
|
|
209
210
|
|
|
210
|
-
Option is for the usage at a hospital (Leistungserbringer). Please approach your GDC/GRZ for a valid config file.
|
|
211
|
-
|
|
212
|
-
### download
|
|
213
|
-
|
|
214
|
-
Download a submission from a GRZ
|
|
215
|
-
|
|
216
|
-
- `-s, --submission-id`: S3 submission prefix [**Required**]
|
|
217
|
-
- `-o, --output-dir`: Path to the target submission output directory [**Required**]
|
|
218
|
-
- `-c, --config-file`: Path to config file [_optional_]
|
|
219
|
-
|
|
220
|
-
Example usage:
|
|
221
|
-
|
|
222
|
-
```bash
|
|
223
|
-
grz-cli download --submission-id foo --output-dir bar
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
Option is for the usage at a GDC/GRZ.
|
|
227
|
-
|
|
228
211
|
## Testing
|
|
229
212
|
|
|
230
213
|
Please note that binary files used for testing are managed with [Git LFS](https://git-lfs.com), which will be needed to clone them locally with the git repository.
|
|
@@ -238,9 +221,9 @@ Alternatively, install `uv` and `tox` and run `uv run tox`.
|
|
|
238
221
|
|
|
239
222
|
## License
|
|
240
223
|
|
|
241
|
-
This project is licensed under the MIT License
|
|
224
|
+
This project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.
|
|
242
225
|
|
|
243
226
|
## Acknowledgements
|
|
244
227
|
|
|
245
|
-
Parts of `
|
|
228
|
+
Parts of `crypt4gh` code is used in modified form
|
|
246
229
|
|
|
@@ -1,40 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: grz-cli
|
|
3
|
-
Version: 0.6.0
|
|
4
|
-
Summary: Tool for validation, encryption and upload of MV submissions to GDCs.
|
|
5
|
-
Author-email: Koray Kirli <koraykirli@gmail.com>, Mathias Lesche <mathias.lesche@tu-dresden.de>, "Florian R. Hölzlwimmer" <git.ich@frhoelzlwimmer.de>, Till Hartmann <till.hartmann@bih-charite.de>, Thomas Sell <thomas.sell@bih-charite.de>
|
|
6
|
-
License-Expression: MIT
|
|
7
|
-
Project-URL: Homepage, https://codebase.helmholtz.cloud/grz-mv-genomseq/grz-cli
|
|
8
|
-
Keywords: GRZ,GDC,S3
|
|
9
|
-
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Classifier: Operating System :: OS Independent
|
|
11
|
-
Requires-Python: >=3.12
|
|
12
|
-
Description-Content-Type: text/markdown
|
|
13
|
-
License-File: LICENSE
|
|
14
|
-
Requires-Dist: boto3<2,>=1.36
|
|
15
|
-
Requires-Dist: click<9,>=8.1.7
|
|
16
|
-
Requires-Dist: crypt4gh<2,>=1.7
|
|
17
|
-
Requires-Dist: jsonschema<5,>=4.23.0
|
|
18
|
-
Requires-Dist: pyyaml<7,>=6.0.2
|
|
19
|
-
Requires-Dist: tqdm<5,>=4.66.5
|
|
20
|
-
Requires-Dist: pydantic<2.10,>=2.9.2
|
|
21
|
-
Requires-Dist: pydantic-settings<2.10,>=2.9.0
|
|
22
|
-
Requires-Dist: platformdirs<5,>=4.3.6
|
|
23
|
-
Requires-Dist: grz-pydantic-models>=1.3.0
|
|
24
|
-
Requires-Dist: pysam==0.23.*
|
|
25
|
-
Requires-Dist: rich==13.*
|
|
26
|
-
Requires-Dist: requests<3,>=2.32.3
|
|
27
|
-
Provides-Extra: test
|
|
28
|
-
Requires-Dist: pytest<9,>=8.3.3; extra == "test"
|
|
29
|
-
Requires-Dist: pytest-cov<6,>=5.0.0; extra == "test"
|
|
30
|
-
Requires-Dist: pytest-mock<4,>=3.14.0; extra == "test"
|
|
31
|
-
Requires-Dist: moto[s3]<6,>=5.0.16; extra == "test"
|
|
32
|
-
Requires-Dist: pytest-sugar<2,>=1.0.0; extra == "test"
|
|
33
|
-
Requires-Dist: ruff<1,>=0.9.6; extra == "test"
|
|
34
|
-
Requires-Dist: numpy<3,>=2.1.2; extra == "test"
|
|
35
|
-
Requires-Dist: responses==0.25.*; extra == "test"
|
|
36
|
-
Dynamic: license-file
|
|
37
|
-
|
|
38
1
|
# GRZ CLI
|
|
39
2
|
|
|
40
3
|
A command-line tool for validating, encrypting, uploading and downloading submissions to/from a GDC/GRZ (Genomrechenzentrum).
|
|
@@ -45,10 +8,9 @@ A command-line tool for validating, encrypting, uploading and downloading submis
|
|
|
45
8
|
- [Features](#features)
|
|
46
9
|
- [Installation](#installation)
|
|
47
10
|
- [Requirements](#requirements)
|
|
48
|
-
- [End-user setup](#end-user)
|
|
11
|
+
- [End-user setup](#end-user-setup)
|
|
49
12
|
- [Installation via `conda` (recommended)](#installation-via-conda-recommended)
|
|
50
13
|
- [Installation via `pip` (not recommended)](#installation-via-pip-not-recommended)
|
|
51
|
-
- [Development setup](#development-setup)
|
|
52
14
|
- [Usage](#usage)
|
|
53
15
|
- [Configuration](#configuration)
|
|
54
16
|
- [Exemplary submission procedure](#exemplary-submission-procedure)
|
|
@@ -147,18 +109,6 @@ pip upgrade grz-cli
|
|
|
147
109
|
Docker images are available via biocontainers at [https://biocontainers.pro/tools/grz-cli](https://biocontainers.pro/tools/grz-cli).
|
|
148
110
|
|
|
149
111
|
|
|
150
|
-
### Development setup
|
|
151
|
-
For development purposes, you can clone the repository and install the package in editable mode:
|
|
152
|
-
|
|
153
|
-
```bash
|
|
154
|
-
git clone https://codebase.helmholtz.cloud/grz-mv-genomseq/grz-cli
|
|
155
|
-
# create conda environment and activate it
|
|
156
|
-
conda env create -f grz-cli/environment-dev.yaml -n grz-tools-dev
|
|
157
|
-
conda activate grz-tools-dev
|
|
158
|
-
# install the grz-cli tool
|
|
159
|
-
pip install -e grz-cli/
|
|
160
|
-
```
|
|
161
|
-
|
|
162
112
|
## Usage
|
|
163
113
|
|
|
164
114
|
### Configuration
|
|
@@ -202,8 +152,6 @@ Example usage:
|
|
|
202
152
|
grz_cli validate --submission-dir foo
|
|
203
153
|
```
|
|
204
154
|
|
|
205
|
-
Option is for the usage at a hospital (Leistungserbringer) and GDC/GRZ.
|
|
206
|
-
|
|
207
155
|
### encrypt
|
|
208
156
|
|
|
209
157
|
If a working directory is not provided, then the current directory is used automatically. The log-files are going to be stored in the sub-folder of the working directory.
|
|
@@ -216,21 +164,6 @@ Files are stored in a folder named `encrypted_files` as a sub-folder of the work
|
|
|
216
164
|
grz-cli encrypt --submission-dir foo
|
|
217
165
|
```
|
|
218
166
|
|
|
219
|
-
Option is for the usage at a hospital (Leistungserbringer). Please approach your GDC/GRZ for a valid config file.
|
|
220
|
-
|
|
221
|
-
### decrypt
|
|
222
|
-
|
|
223
|
-
Decrypt a submission using the GRZ private key.
|
|
224
|
-
|
|
225
|
-
- `-s, --submission-dir`: Path to the submission directory containing both 'metadata/' and 'encrypted_files/' directories [**Required**]
|
|
226
|
-
- `-c,--config-file`: Path to config file [_optional_]
|
|
227
|
-
|
|
228
|
-
```bash
|
|
229
|
-
grz-cli decrypt --submission-dir foo
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
Option is for the usage at a GDC/GRZ.
|
|
233
|
-
|
|
234
167
|
### upload
|
|
235
168
|
|
|
236
169
|
Upload the submission into a S3 structure of a GRZ.
|
|
@@ -244,24 +177,6 @@ Example usage:
|
|
|
244
177
|
grz-cli upload --submission-dir foo
|
|
245
178
|
```
|
|
246
179
|
|
|
247
|
-
Option is for the usage at a hospital (Leistungserbringer). Please approach your GDC/GRZ for a valid config file.
|
|
248
|
-
|
|
249
|
-
### download
|
|
250
|
-
|
|
251
|
-
Download a submission from a GRZ
|
|
252
|
-
|
|
253
|
-
- `-s, --submission-id`: S3 submission prefix [**Required**]
|
|
254
|
-
- `-o, --output-dir`: Path to the target submission output directory [**Required**]
|
|
255
|
-
- `-c, --config-file`: Path to config file [_optional_]
|
|
256
|
-
|
|
257
|
-
Example usage:
|
|
258
|
-
|
|
259
|
-
```bash
|
|
260
|
-
grz-cli download --submission-id foo --output-dir bar
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
Option is for the usage at a GDC/GRZ.
|
|
264
|
-
|
|
265
180
|
## Testing
|
|
266
181
|
|
|
267
182
|
Please note that binary files used for testing are managed with [Git LFS](https://git-lfs.com), which will be needed to clone them locally with the git repository.
|
|
@@ -275,9 +190,9 @@ Alternatively, install `uv` and `tox` and run `uv run tox`.
|
|
|
275
190
|
|
|
276
191
|
## License
|
|
277
192
|
|
|
278
|
-
This project is licensed under the MIT License
|
|
193
|
+
This project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.
|
|
279
194
|
|
|
280
195
|
## Acknowledgements
|
|
281
196
|
|
|
282
|
-
Parts of `
|
|
197
|
+
Parts of `crypt4gh` code is used in modified form
|
|
283
198
|
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "grz-cli"
|
|
3
|
+
description = "Tool for validation, encryption and upload of MV submissions to GDCs."
|
|
4
|
+
readme = "README.md"
|
|
5
|
+
license = "MIT"
|
|
6
|
+
authors = [
|
|
7
|
+
{ name = "Koray Kirli", email = "koraykirli@gmail.com" },
|
|
8
|
+
{ name = "Mathias Lesche", email = "mathias.lesche@tu-dresden.de" },
|
|
9
|
+
{ name = "Florian R. Hölzlwimmer", email = "git.ich@frhoelzlwimmer.de" },
|
|
10
|
+
{ name = "Till Hartmann", email = "till.hartmann@bih-charite.de" },
|
|
11
|
+
{ name = "Thomas Sell", email = "thomas.sell@bih-charite.de" },
|
|
12
|
+
{ name = "Travis Wrightsman", email = "travis.wrightsman@uni-tuebingen.de" }
|
|
13
|
+
]
|
|
14
|
+
dynamic = ["version"]
|
|
15
|
+
dependencies = [
|
|
16
|
+
"boto3 >=1.36,<2",
|
|
17
|
+
"click >=8.1.7,<9",
|
|
18
|
+
"crypt4gh >=1.7,<2",
|
|
19
|
+
"jsonschema >=4.23.0,<5",
|
|
20
|
+
"pyyaml >=6.0.2,<7",
|
|
21
|
+
"tqdm >=4.66.5,<5",
|
|
22
|
+
"pydantic >=2.9.2,<2.10",
|
|
23
|
+
"pydantic-settings >=2.9.0,<2.10",
|
|
24
|
+
"platformdirs >=4.3.6,<5",
|
|
25
|
+
"grz-pydantic-models >=1.3.0",
|
|
26
|
+
"pysam ==0.23.*",
|
|
27
|
+
"rich ==13.*",
|
|
28
|
+
"requests >=2.32.3,<3",
|
|
29
|
+
"grz-common",
|
|
30
|
+
]
|
|
31
|
+
classifiers = [
|
|
32
|
+
"Programming Language :: Python :: 3",
|
|
33
|
+
"Operating System :: OS Independent"
|
|
34
|
+
]
|
|
35
|
+
requires-python = ">=3.12"
|
|
36
|
+
keywords = ["GRZ", "GDC", "S3"]
|
|
37
|
+
|
|
38
|
+
[tool.uv.sources]
|
|
39
|
+
grz-common = { workspace = true }
|
|
40
|
+
|
|
41
|
+
[project.urls]
|
|
42
|
+
Homepage = "https://github.com/BfArM-MVH/grz-tools"
|
|
43
|
+
Repository = "https://github.com/BfArM-MVH/grz-tools"
|
|
44
|
+
Documentation = "https://github.com/BfArM-MVH/grz-tools/tree/main/packages/grz-cli"
|
|
45
|
+
Issues = "https://github.com/BfArM-MVH/grz-tools/issues"
|
|
46
|
+
|
|
47
|
+
[project.scripts]
|
|
48
|
+
grz-cli = "grz_cli.cli:main"
|
|
49
|
+
|
|
50
|
+
[build-system]
|
|
51
|
+
requires = ["hatchling"]
|
|
52
|
+
build-backend = "hatchling.build"
|
|
53
|
+
|
|
54
|
+
[tool.hatch.version]
|
|
55
|
+
path = "src/grz_cli/__init__.py"
|
|
56
|
+
|
|
57
|
+
[tool.hatch.build.targets.wheel]
|
|
58
|
+
packages = ["src/grz_cli"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.7.0"
|
|
@@ -4,20 +4,12 @@ CLI module for handling command-line interface operations.
|
|
|
4
4
|
|
|
5
5
|
import logging
|
|
6
6
|
import logging.config
|
|
7
|
-
import os
|
|
8
7
|
from importlib.metadata import version
|
|
9
8
|
|
|
10
9
|
import click
|
|
11
10
|
import grz_pydantic_models.submission.metadata
|
|
12
11
|
|
|
13
|
-
from .commands.archive import archive
|
|
14
|
-
from .commands.clean import clean
|
|
15
|
-
from .commands.consent import consent
|
|
16
|
-
from .commands.decrypt import decrypt
|
|
17
|
-
from .commands.download import download
|
|
18
12
|
from .commands.encrypt import encrypt
|
|
19
|
-
from .commands.list_submissions import list_submissions
|
|
20
|
-
from .commands.pruefbericht import pruefbericht
|
|
21
13
|
from .commands.submit import submit
|
|
22
14
|
from .commands.upload import upload
|
|
23
15
|
from .commands.validate import validate
|
|
@@ -37,7 +29,7 @@ class OrderedGroup(click.Group):
|
|
|
37
29
|
return list(self.commands.keys())
|
|
38
30
|
|
|
39
31
|
|
|
40
|
-
def build_cli(
|
|
32
|
+
def build_cli():
|
|
41
33
|
"""
|
|
42
34
|
Factory for building the CLI application.
|
|
43
35
|
"""
|
|
@@ -87,15 +79,6 @@ def build_cli(grz_mode=False):
|
|
|
87
79
|
cli.add_command(upload)
|
|
88
80
|
cli.add_command(submit)
|
|
89
81
|
|
|
90
|
-
if grz_mode:
|
|
91
|
-
cli.add_command(list_submissions, name="list")
|
|
92
|
-
cli.add_command(download)
|
|
93
|
-
cli.add_command(decrypt)
|
|
94
|
-
cli.add_command(archive)
|
|
95
|
-
cli.add_command(clean)
|
|
96
|
-
cli.add_command(consent)
|
|
97
|
-
cli.add_command(pruefbericht)
|
|
98
|
-
|
|
99
82
|
return cli
|
|
100
83
|
|
|
101
84
|
|
|
@@ -103,9 +86,7 @@ def main():
|
|
|
103
86
|
"""
|
|
104
87
|
Main entry point for the CLI application.
|
|
105
88
|
"""
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
cli = build_cli(grz_mode=grz_mode)
|
|
89
|
+
cli = build_cli()
|
|
109
90
|
cli()
|
|
110
91
|
|
|
111
92
|
|
|
@@ -6,10 +6,10 @@ from pathlib import Path
|
|
|
6
6
|
from tempfile import NamedTemporaryFile
|
|
7
7
|
|
|
8
8
|
import click
|
|
9
|
+
from grz_common.cli import config_file, force, submission_dir
|
|
10
|
+
from grz_common.workers.worker import Worker
|
|
9
11
|
|
|
10
|
-
from ..
|
|
11
|
-
from ..workers.worker import Worker
|
|
12
|
-
from .common import config_file, force, submission_dir
|
|
12
|
+
from ..models.config import EncryptConfig
|
|
13
13
|
|
|
14
14
|
log = logging.getLogger(__name__)
|
|
15
15
|
|
|
@@ -25,9 +25,9 @@ def encrypt(submission_dir, config_file, force):
|
|
|
25
25
|
Encryption is done with the recipient's public key.
|
|
26
26
|
Sub-folders 'encrypted_files' and 'logs' are created within the submission directory.
|
|
27
27
|
"""
|
|
28
|
-
config =
|
|
28
|
+
config = EncryptConfig.from_path(config_file)
|
|
29
29
|
|
|
30
|
-
submitter_privkey_path = config.submitter_private_key_path
|
|
30
|
+
submitter_privkey_path = config.keys.submitter_private_key_path
|
|
31
31
|
if submitter_privkey_path == "":
|
|
32
32
|
submitter_privkey_path = None
|
|
33
33
|
|
|
@@ -41,15 +41,19 @@ def encrypt(submission_dir, config_file, force):
|
|
|
41
41
|
log_dir=submission_dir / "logs",
|
|
42
42
|
encrypted_files_dir=submission_dir / "encrypted_files",
|
|
43
43
|
)
|
|
44
|
-
if config.grz_public_key:
|
|
44
|
+
if pubkey := config.keys.grz_public_key:
|
|
45
45
|
with NamedTemporaryFile("w") as f:
|
|
46
|
-
f.write(
|
|
46
|
+
f.write(pubkey)
|
|
47
47
|
f.flush()
|
|
48
48
|
worker_inst.encrypt(f.name, submitter_private_key_path=submitter_privkey_path, force=force)
|
|
49
49
|
else:
|
|
50
50
|
# This case cannot occur here, but an explicit check is needed for type-checking.
|
|
51
|
-
if config.grz_public_key_path is None:
|
|
51
|
+
if config.keys.grz_public_key_path is None:
|
|
52
52
|
sys.exit("GRZ public key path is required for encryption.")
|
|
53
|
-
worker_inst.encrypt(
|
|
53
|
+
worker_inst.encrypt(
|
|
54
|
+
config.keys.grz_public_key_path,
|
|
55
|
+
submitter_private_key_path=submitter_privkey_path,
|
|
56
|
+
force=force,
|
|
57
|
+
)
|
|
54
58
|
|
|
55
59
|
log.info("Encryption successful!")
|
|
@@ -4,13 +4,13 @@ import logging
|
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
|
|
6
6
|
import click
|
|
7
|
-
|
|
8
|
-
from ..workers.worker import Worker
|
|
7
|
+
from grz_common.workers.worker import Worker
|
|
9
8
|
|
|
10
9
|
log = logging.getLogger(__name__)
|
|
11
10
|
|
|
12
|
-
from
|
|
13
|
-
|
|
11
|
+
from grz_common.cli import config_file, submission_dir, threads
|
|
12
|
+
|
|
13
|
+
from ..models.config import UploadConfig
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
@click.command()
|
|
@@ -25,7 +25,7 @@ def upload(
|
|
|
25
25
|
"""
|
|
26
26
|
Upload a submission to a GRZ/GDC.
|
|
27
27
|
"""
|
|
28
|
-
config =
|
|
28
|
+
config = UploadConfig.from_path(config_file)
|
|
29
29
|
|
|
30
30
|
log.info("Starting upload...")
|
|
31
31
|
|
|
@@ -39,6 +39,6 @@ def upload(
|
|
|
39
39
|
threads=threads,
|
|
40
40
|
)
|
|
41
41
|
# output the generated submission ID
|
|
42
|
-
print(worker_inst.upload(config))
|
|
42
|
+
print(worker_inst.upload(config.s3))
|
|
43
43
|
|
|
44
44
|
log.info("Upload finished!")
|