GHGA Data Steward Kit - A utils package for GHGA data stewards.
Project description
GHGA Data Steward Kit
Utilities for data stewards interacting with GHGA infrastructure.
Installation:
This package can be installed using pip:
pip install ghga-datasteward-kit
Usage:
An overview of all commands is provided using:
ghga-datasteward-kit --help
The following paragraphs provide additional help for using the different commands:
s3-upload
This command facilitates encrypting files using Crypt4GH and uploading the encrypted content to a (remote) S3-compatible object storage. This process consists of multiple steps:
- Generate a unique file id
- Create unencrypted file checksum
- Encrypt file
- Extract file secret and remove Crypt4GH envelope
- Upload encrypted file content
- Download encrypted file content, decrypt and verify checksum
- Write file/upload information to output file
The user needs to provide a config yaml containing information as described here.
In addition to these general configuration options, each invocation of this script needs 2 additional parameters passed to the command line:
- The path to the file on the local file system
- A human readable alias for the file (choose a unique one)
An output file is written to the specified output directory under <alias>.json. If such a file already exists, an error is thrown.
The resulting file is owner read-only and contains the following information:
- The file alias
- A unique identifier for the file
- The local file path
- A SHA256 checksum over the unencrypted content
- MD5 checksums over all encrypted file parts
- SHA256 checksums over all encrypted file parts
- The file encryption/decryption secret
Attention: Keep this output file in a safe, private location. If this file is lost, the uploaded file content becomes inaccessible.
generate-catalog-accessions
A command for generating accessions for the metadata catalog. Accessions wiil be stored in a text file.
Development
For setting up the development environment, we rely on the devcontainer feature of vscode in combination with Docker Compose.
To use it, you have to have Docker Compose as well as vscode with its "Remote - Containers" extension (ms-vscode-remote.remote-containers
) installed.
Then open this repository in vscode and run the command
Remote-Containers: Reopen in Container
from the vscode "Command Palette".
This will give you a full-fledged, pre-configured development environment including:
- infrastructural dependencies (databases, etc.)
- all relevant vscode extensions pre-installed
- pre-configured linting and auto-formating
- a pre-configured debugger
- automatic license-header insertion
If you prefer not to use vscode, you could get a similar setup (without the editor specific features) by running the following commands:
# Execute in the repo's root dir:
cd ./.devcontainer
# build and run the environment with docker-compose
docker-compose up
# attach to the main container:
# (you can open multiple shell sessions like this)
docker exec -it devcontainer_app_1 /bin/bash
License
This repository is free to use and modify according to the Apache 2.0 License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ghga_datasteward_kit-0.4.2.tar.gz
.
File metadata
- Download URL: ghga_datasteward_kit-0.4.2.tar.gz
- Upload date:
- Size: 25.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcece2bb065ffdc63f593d4484788ff53d5b940d89606c4ce0bb5055d009d8e5 |
|
MD5 | ba03ce235fae53608a8846c8ac5d62d9 |
|
BLAKE2b-256 | 4d5806c3960faeb65e96a421ba6c60a5e195d72ef752ce7173e87f146fda0a82 |
File details
Details for the file ghga_datasteward_kit-0.4.2-py3-none-any.whl
.
File metadata
- Download URL: ghga_datasteward_kit-0.4.2-py3-none-any.whl
- Upload date:
- Size: 36.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04b4ea3e0018f65c9bbab4cf96eb563ad8d412227536bcea0dc8a26717f42b58 |
|
MD5 | 3414b6e4ffd71991e9cf9b60ce07fb7a |
|
BLAKE2b-256 | ce131c2aab50bdfe01a14d3f3555b48e8c576dbf40526c4ae258944466311d2b |