Create Gen3 Metadata Submission Templates from a Gen3 JSON Schema
Project description
gen3-metadata-templates
Tool to create metadata submission templates from a gen3 json schema.
installation
pip install gen3_metadata_templates
Usage
First lets create a ResolveSchema object, which contains methods and attributes for working with a resolved gen3 schema.
from gen3_metadata_templates.templates import *
from gen3_validator.resolve_schema import ResolveSchema
resolver = ResolveSchema("path/to/gen3_schema.json")
resolver.resolve_schema()
We then parse the ResolveSchema object to generate an Excel template.
generate_xlsx_template(resolver=resolver, target_node="unaligned_reads_file", output_filename="unaligned_reads_file.xlsx")
# some columns are excluded by default, but you can return all by using
generate_xlsx_template(resolver=resolver, target_node="unaligned_reads_file", output_filename="unaligned_reads_file.xlsx", exclude_columns= [])
You can also generate a template for a specific node. By default, some columns are excluded. Note: If the node is "program" or "project", it will be excluded and the function will return None. The function returns a pandas DataFrame.
df = make_node_template_pd(resolver, node="unaligned_reads_file")
# Alternatively you can not exclude any columns
df = make_node_template_pd(
resolver,
node="unaligned_reads_file",
exclude_columns=[],
excluded_nodes=[]
)
print(df)
Dev Installation
- Make sure you have Poetry
version 2.1.3installed.
git clone https://github.com/AustralianBioCommons/gen3-metadata-templates.git
cd gen3-metadata-templates
pip install poetry
poetry install
eval $(poetry env activate)
poetry run pytest -vv
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gen3_metadata_templates-1.0.1.tar.gz.
File metadata
- Download URL: gen3_metadata_templates-1.0.1.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.9.23 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bb6985f3de90bb4d724f8b3e7584043d5eb08c3e3a3a53f664b6561e1ab6bb5
|
|
| MD5 |
26928c3419fb47b72762d4ea4bd58edf
|
|
| BLAKE2b-256 |
0fe8ac6e31c8004fabaf9e2d7af64810a29b38b023de62b249576ccac1937311
|
File details
Details for the file gen3_metadata_templates-1.0.1-py3-none-any.whl.
File metadata
- Download URL: gen3_metadata_templates-1.0.1-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.9.23 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3f7d4613065068c8b6546991bd60993ae8160467f4a1f192d867410ab47ded0
|
|
| MD5 |
60dbce938b6a7c4128d1c8d1beaa225d
|
|
| BLAKE2b-256 |
ff139690e277588408f9dfca991ee1236fdc8da66b8191e58b1eef03c925eba5
|