GA4GH Genomic Knowledge Standards Meta-schema

raw JSON →
0.3.2 verified Sat May 09 auth: no python

Tools for working with the GA4GH Genomic Knowledge Standards (GKS) meta-schema, including schema parsing, validation, and code generation. Current version: 0.3.2, requires Python >=3.12. Release cadence: irregular, with minor fixes and CI improvements.

pip install ga4gh-gks-metaschema
error ModuleNotFoundError: No module named 'ga4gh_gks_metaschema'
cause Using the PyPI package name (with hyphens) as the import path.
fix
Use 'import gks_metaschema' or 'from gks_metaschema import ...'.
error AttributeError: module 'gks_metaschema' has no attribute 'SchemaParser'
cause The class or function name might be outdated or not imported correctly.
fix
Check the documentation for the correct class name; common entry points are SchemaParser, MetaSchema, etc.
error pydantic.errors.PydanticUserError: A custom validator may not have type-checking...
cause Using an older version of pydantic that is incompatible with the metaschema parser.
fix
Update pydantic to >=2.0.0 or follow the library's pinned dependency.
gotcha The import path uses underscores (gks_metaschema), not hyphens (ga4gh-gks-metaschema). A common mistake is using the PyPI name directly in imports.
fix Use 'from gks_metaschema import ...'.
breaking Version 0.3.0 dropped Python 3.11 support; requires Python >=3.12.
fix Ensure your environment uses Python 3.12 or later.
deprecated The 'build_inheritance_dicts' function had a length check removed in version 0.3.2. Code relying on that check may behave differently.
fix Update to 0.3.2 and adjust any code that assumed the length check.

Basic usage: parse a GKS meta-schema YAML file into Python objects.

from gks_metaschema import SchemaParser

# Load a metaschema YAML file
parser = SchemaParser()
schema = parser.parse('path/to/schema.yaml')
print(schema)