Skip to main content

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.3 installed.
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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gen3_metadata_templates-1.0.1.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gen3_metadata_templates-1.0.1-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

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

Hashes for gen3_metadata_templates-1.0.1.tar.gz
Algorithm Hash digest
SHA256 6bb6985f3de90bb4d724f8b3e7584043d5eb08c3e3a3a53f664b6561e1ab6bb5
MD5 26928c3419fb47b72762d4ea4bd58edf
BLAKE2b-256 0fe8ac6e31c8004fabaf9e2d7af64810a29b38b023de62b249576ccac1937311

See more details on using hashes here.

File details

Details for the file gen3_metadata_templates-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for gen3_metadata_templates-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d3f7d4613065068c8b6546991bd60993ae8160467f4a1f192d867410ab47ded0
MD5 60dbce938b6a7c4128d1c8d1beaa225d
BLAKE2b-256 ff139690e277588408f9dfca991ee1236fdc8da66b8191e58b1eef03c925eba5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page