Skip to main content

gkm-bundle-parquet

Builds queryable Parquet tables from a GKM JSON bundle, rebuilds the bundle from them, and validates bundles against their JSON Schema. It works with any bundle built on the GA4GH GKM classes (VRS, Cat-VRS, VA-Spec), given that bundle's JSON Schema: the tables are generated from the schema, and a column set is needed only for a narrower projection. It names no producer and has no default bundle. The tests run on real bundles of two producers: ClinVar-GKM and CIViC, which differ in layout, version and root values.

The JSON bundles are the public record. Parquet is a derived convenience: a quick way to explore and query the bundle content with current database tools such as DuckDB, Polars, pandas and Spark. Every Parquet value can be recomputed from the bundle it came from (ADR 0001).

Status: 2.0.0 is the latest release, and the first under the name gkm-bundle-parquet. It removes what 1.1.0, the last clinvar-gkm-parquet release, deprecated: the ClinVar-GKM default bundle, its release model and its fixed table specs (ADR 0008, ADR 0009). See Migrating from 1.x.

Versioning

This tool is versioned independently of any bundle schema, because they release on different cadences (ADR 0002). Every release states the table spec it writes, with its version, and the bundles it reads. From 2.0.0 that is one spec, sections, compiled for any bundle from its schema and, optionally, a column set (a pairing; ADR 0006, format). With the schema alone the tool builds the schema's default column set, which it generates by a fixed, versioned policy (the policy version, 2.0; ADR 0007, generate). A column set must compile to that default or declare itself a named projection. A pairing that doesn't load or compile is refused with the reason. The tool lists no producer's schema_versions: the producer publishes its schema, and says which of its versions it reads.

Tool version Reads Table specs written
1.0.0 any bundle with its pairing; ClinVar-GKM by default (snapshot: 1.1.0); baseline, clinvar-gkm: ClinVar-GKM 1.1.0 sections 1.0 (default; draft), baseline 1.0 (draft), clinvar-gkm 1.0 (draft)
1.0.1 as 1.0.0 as 1.0.0
1.1.0 as 1.0.0; the default bundle, baseline and clinvar-gkm deprecated as 1.0.0
2.0.0 any bundle with its schema (required) and, optionally, a column set that is the default or a named projection; no default bundle. verify and rebuild: sections sets of 1.x and 2.0.0, key-value prefix gkm_bundle_parquet. or clinvar_gkm_parquet. sections 2.0 (generated default, policy 2.0; no key_order or ordinal; a record-identical round trip), key-value prefix gkm_bundle_parquet.

sections: one table per bundle collection (20 in ClinVar-GKM 1.1.0), keyed by id, compiled from a bundle schema and, optionally, a column set, with every record property its own typed column (named as the property; STRUCTs at any depth; pointers as bare ids; extensions in value_<kind> slots by the JSON kind of their value) and no data column. What the schema can't settle is kept as JSON text, and generate lists where. A property, value type or record shape the spec doesn't cover stops the build. It is lossless (ADR 0005): a table also has id_present where the record's class allows an id but doesn't require it; a pointer with several target sections, an IRI, a string-or-object and an integer-or-Range have derived parts (<prop>_section, <prop>_json, <prop>_min/_max; format); and root values that aren't collections go in a root_values table. There is no ordinal: rows are in key order (ADR 0008 decision 1.1). Pointers whose targets the schema declares (a pattern of ^#/<section>/) are listed as foreign keys. The build checks every row. rebuild writes back a bundle whose records are identical to the source's: the same canonical form (RFC 8785 with arrays sorted), whatever the source's layout, key order or array order (docs/round-trip.md). This is new in 2.0.0; 1.x rebuilt a line-layout bundle's text byte for byte and any other layout JSON-equal.

version --json gives the same for scripts: tool_version; the spec it writes (table_spec), its version (table_spec_version) and the default policy's (policy_version); what it reads (schema_version_rule); the key-value prefix it writes (kv_prefix) and the prefixes verify and rebuild read (kv_prefixes_read); the DuckDB version (duckdb_version); and validate's engines (validate_engines). For 2.0.0 (schema_version_rule abridged):

{
  "tool_version": "2.0.0",
  "table_spec": "sections",
  "table_spec_version": "2.0",
  "policy_version": "2.0",
  "schema_version_rule": "Reads any bundle given its schema (--bundle-schema, required): ...",
  "kv_prefix": "gkm_bundle_parquet.",
  "kv_prefixes_read": ["gkm_bundle_parquet.", "clinvar_gkm_parquet."],
  "duckdb_version": "1.5.4",
  "validate_engines": {
    "rs": {"library": "jsonschema-rs", "version": "0.61.1", "default": true},
    "python": {"library": "ga4gh.gkm", "version": "0.4.0", "default": false, "extra": "reference"}
  }
}

An engine's version is null when it isn't installed (the python engine without the reference extra).

Each Parquet file records, in its key-value metadata (prefix gkm_bundle_parquet.; 1.x wrote clinvar_gkm_parquet.), the tool version, the spec's name and version, the policy version, whether the column set is the default or a projection (and its name), the table's foreign keys, the sha256 of the schema set, the column set and the compiled spec, the source bundle's sha256, for a lossless build its section's records sha256 and, for a selective build, the selection (design plan §7.2). A set also holds its compiled spec (table-spec.json), so verify and rebuild need neither the schema nor the column set. They also read sets built by 1.x with sections, under either key-value prefix.

Install

uvx gkm-bundle-parquet@2.0.0 version --json   # run a pinned release with no install
pipx install gkm-bundle-parquet==2.0.0        # or install it

Python 3.10 or later. DuckDB is pinned exactly, because the output bytes depend on it, so an isolated environment (uvx or pipx) avoids a clash with your own DuckDB.

validate --engine python, the reference validator, needs the reference extra (the GA4GH GKM Toolkit, ga4gh.gkm 0.4.0, Python 3.11 or later), whose GA4GH dependencies are pre-releases: uv tool install --prerelease=allow 'gkm-bundle-parquet[reference]' or pip install --pre 'gkm-bundle-parquet[reference]'. The default engine needs nothing extra.

Usage

Every command that reads a bundle takes one bundle (--full, a path or URL) and its schema, --bundle-schema (a schema file, a URL, or a schema-set directory; see Schema sources). With no --column-set the tool builds the schema's generated default, and --version-property names the root property holding the bundle's version, if any; a --column-set (the default written out, or a named projection) says it instead. --sha256 gives the bundle's expected sha256; without it, a <file>.sha256 sidecar is used when there is one. Which release a file is, and which file to read, is the producer's business. The examples use ClinVar-GKM's 1.1.0 schema and CIViC's, only as examples: any producer's bundle and schema work the same way.

P="--bundle-schema https://w3id.org/clingen/schema/clinvar-gkm/1.1.0/clinvar-gkm-bundle.schema.json \
   --version-property schema_version"

# The schema's default column set, written out, with a report of what the policy settled (docs/generate.md)
gkm-bundle-parquet generate $P -o clinvar-gkm.columns.yaml
# Whether a column set is the default (exit 0) or how it differs (exit 1)
gkm-bundle-parquet generate --check --bundle-schema clinvar-gkm-1.1.0/schema-set --column-set my.columns.yaml

# One table per bundle collection, a typed column per record property
gkm-bundle-parquet build --full clinvar-gkm_2026-1018.json.gz $P --out out/

# A bundle by URL, with its expected sha256
gkm-bundle-parquet build --full https://example.org/bundle.json.gz --sha256 <hex> $P --out out/

# A selection: one submitter and every record that points to it (its SCVs)
gkm-bundle-parquet build --full clinvar-gkm_2026-1018.json.gz $P --out omim/ \
    --driver submitter --where "name = 'OMIM'" --follow in --max-depth 1

# The same selection's mini-bundle only (byte-identical to the one the build used)
gkm-bundle-parquet select --full clinvar-gkm_2026-1018.json.gz $P --out omim.json.gz \
    --driver submitter --where "name = 'OMIM'" --follow in --max-depth 1

# A CIViC bundle: no version, pretty-printed, empty collections and root values
gkm-bundle-parquet build --full civic-assertion-bundle.json --bundle-schema civic/schema-set --out civic/
# The same with a named projection: the column set narrows the default and says `projection: <name>`
gkm-bundle-parquet build --full civic-assertion-bundle.json \
    --bundle-schema civic/schema-set --column-set civic/civic.columns.yaml --out civic-projection/

# The columns a pairing gives, with no build
gkm-bundle-parquet compile-spec $P > sections.yaml

# Back from Parquet to the bundle: a full build rebuilds the bundle's records (no schema needed)
gkm-bundle-parquet rebuild out/ -o clinvar-gkm_2026-1018.json.gz

# Validate every record against the bundle's JSON Schema set (the default engine, jsonschema-rs; docs/validate.md)
gkm-bundle-parquet validate clinvar-gkm-delta_2026-1031.json.gz --bundle-schema clinvar-gkm-1.1.0/schema-set \
    --version-property schema_version --failures bad.jsonl
# The same with the GKM Toolkit's validator, the reference the default is checked against (much slower)
gkm-bundle-parquet validate clinvar-gkm-delta_2026-1031.json.gz --bundle-schema clinvar-gkm-1.1.0/schema-set \
    --version-property schema_version --engine python

# Checks: the directory on its own; a full build against its bundle; a selection against its mini-bundle;
# the round trip (the rebuilt records against the recorded records sha256s and, with --full, the bundle's own)
gkm-bundle-parquet verify out/
gkm-bundle-parquet verify out/ --bundle-recompute --full clinvar-gkm_2026-1018.json.gz $P
gkm-bundle-parquet verify omim/ --bundle-recompute --full omim.json.gz
gkm-bundle-parquet verify out/ --roundtrip --full clinvar-gkm_2026-1018.json.gz

build, select, compile-spec, generate and validate without --bundle-schema stop with exit 2 and say so, and so does a column set that neither compiles to the default nor declares a projection (its differences are listed). verify needs no schema; given --bundle-schema (and a --column-set, if the build had one), it also checks that they compile to the spec that wrote the files (the three hashes every file records), and exits 1 if they don't.

--memory-limit (build, select, rebuild, verify) sets DuckDB's memory limit, e.g. 12GB. Without it, the limit is half the memory the process may use: the machine's physical memory, or its cgroup limit when that is lower (a container). DuckDB's own default, 80% of physical memory, bounds only its buffers and left too little for the rest of the process on a 32 GB machine. The limit doesn't change the files: a build that spills to --work-dir writes the same bytes.

validate checks each record alone, as a one-section bundle, so key patterns are checked too, as ClinVar-GKM's validator does. --version-property names the root property holding the bundle's version, which then goes into every record's one-section bundle; there is no default name (ADR 0009). Without it, a version at the root is validated as a root value. The root's own required (CIViC's lists every root property) is checked once, on the names the whole bundle holds, not on each record (docs/validate.md). It exits 1 if any record fails, naming its section, key and instance paths, or if the bundle lacks a name that required lists, and 2 on anything that isn't a verdict on a record (an unreadable bundle, an unknown section, a missing version, a schema set that doesn't load). Its two engines give the same verdicts on every record of the ClinVar-GKM 2026-10-31 delta and a sample of the 2026-10-31 full, with the published 1.1.0 schemas and ClinVar-GKM's narrowed ones, and on the two CIViC bundles; docs/validate.md has the evidence, the known differences and the timings.

From 2.0.0, rebuild writes the line layout, gzip when the output name ends in .gz. The text need not be the source's (keys come in column order, spacing is the tool's, and array order is not promised); the records are, and that is checked: each record's canonical form is hashed, and the records sha256s are compared with each file's section_records_sha256 and the manifest's records_sha256 (docs/round-trip.md defines them). A set built by tool 1.x recorded text sha256s instead: it rebuilds unchecked, and verify --roundtrip needs --full <bundle> for it. rebuild refuses anything it can't reproduce: a selection, a build with --tables (or, by 1.x, with deltas), a missing table or manifest, a repeated key, a 1.x set's missing ordinal, a pointer outside its targets (ADR 0005).

Selection options (build and select): --driver <table>, --where (a DuckDB boolean expression over that table as the spec builds it), --ids k1,k2 and --ids-file (added to the --where keys; with neither, every row of the driver table), --follow out|in|both (default out), --max-depth N and --sections a,b,c. A selection reads the bundle's root by the pairing: its version property, if it has one, and its sections, so a bundle with no version, empty collections, root values (kept in the mini-bundle) or another JSON layout (read whole) works too. See ADR 0004 and the design plan §4.5 and §10.

Schema sources

--bundle-schema takes the bundle's root schema in one of three forms:

  • A URL, such as the producer's published w3id $id (https://w3id.org/clingen/schema/clinvar-gkm/1.1.0/clinvar-gkm-bundle.schema.json for ClinVar-GKM 1.1.0). The root and every schema its $refs reach are fetched once and cached ($XDG_CACHE_HOME/gkm-bundle-parquet/, else ~/.cache/gkm-bundle-parquet/).
  • A local file: the root schema. The schemas its $refs reach are fetched and cached the same way.
  • A schema-set directory: the root and every schema it reaches, one file each, with a MANIFEST.json, read with no network. In a source tree, scripts/vendor-schemas.py <file or URL> <dir> writes one from a published schema, and scripts/vendor-git-schemas.py <clone> <commit> <root path> <dir> from a commit of a local git clone, for a schema that isn't published yet.

From a $ref only https://w3id.org/ URLs are followed (and JSON pointers within a file); the root itself can be anywhere. Whatever the form, a set is known by the $id its root declares, not by where it was read from, and by schema_set_sha256 (over each $id and its bytes), which every Parquet file and the manifest record. A column set pairs with that $id. To pin the schema a build used, keep that sha256, or vendor the set into a directory.

A w3id URL resolves only once its producer has tagged that version. w3id sends a producer's versioned $id to the file at the producer's git tag for that version. So a version that isn't tagged yet doesn't resolve (HTTP 404), even when its files are on the producer's default branch: ClinVar-GKM's …/clinvar-gkm/1.2.0/clinvar-gkm-bundle.schema.json resolves once ClinVar-GKM tags 1.2.0 (404 on 2026-11-18). Until then, vendor the set from a clone with vendor-git-schemas.py, or pass a file.

What w3id serves is what the tag holds. ClinVar-GKM's 1.1.0 tag carries the root $id https://w3id.org/clingen/schema/clinvar-gkm/1.1.0/json/ClinvarGkmBundle, which ClinVar-GKM corrected to …/1.1.0/clinvar-gkm-bundle.schema.json after tagging. So the set the 1.1.0 URL serves (set sha256 0340922…) differs in that one line from a 1.1.0 set vendored later (741a29f…, this repository's test fixture), and the two record different schema_set_sha256s. The generated default works from either, since it pairs with whatever $id the root declares. A column set naming the corrected $id is refused with the served set, and the refusal names both $ids (it says it pairs with schema …, but the schema's $id is …): pass the set the column set was written for. ClinVar-GKM's main already declares the 1.2.0 root $id as its own URL, so from its 1.2.0 tag the URL and the $id agree.

Migrating from 1.x

2.0.0 removes what 1.1.0 deprecated. The values of a sections build with a pairing don't change. What does: the key-value prefix (gkm_bundle_parquet. for clinvar_gkm_parquet.; verify and rebuild read both), the tool_version entry, the manifest's builder and, where 1.1.0 read a release from an option or a published file name, the source_release entry, now always empty; and, with the record-identical round trip (docs/round-trip.md), the table spec version (sections 2.0), the column order of the tables a column set's key_order named (now schema order, as every other table), and the recorded sha256s (section_records_sha256 and records_sha256 for the text sha256s). The changelog has the manifest fields and the migration command by command.

1.x 2.0.0
clinvar-gkm-parquet (package clinvar_gkm_parquet) gkm-bundle-parquet (package gkm_bundle_parquet), the same commands
--release, --index, --delta, --manifest, --full-source-release resolve the release yourself and pass one bundle with --full, plus --sha256 or a <file>.sha256 sidecar
build, select, compile-spec or validate without --bundle-schema (the built-in ClinVar-GKM default) give the bundle's schema with --bundle-schema (and --version-property schema_version for ClinVar-GKM); the tables are the schema's generated default
a column set you wrote generate --check it: a set that isn't the default needs projection: <name>
the ordinal column (the record's position) gone: rows are in key order, and the round trip doesn't depend on order
compile-spec <schema_version> compile-spec --bundle-schema <schema> --column-set <column set>
--spec sections, --spec clinvar-gkm, --spec baseline, a tables.yaml as --spec no --spec: the sections spec compiled from the pairing, and a column set for other tables
verify --spec nothing: verify reads the spec the build wrote beside its manifest
verify --against (the oracle comparison) verify --bundle-recompute and verify --roundtrip
validate with the version property schema_version by default --version-property schema_version
key_order (and sorted_columns) in a column set delete it: key order doesn't count, and a column set with it is refused
a byte-identical rebuilt text, checked by source_text_sha256 and section_text_sha256 record-identical records, checked by records_sha256 and section_records_sha256

verify and rebuild still read sections sets built by 1.x. Such a set records no records sha256, so rebuild writes it back unchecked and verify --roundtrip needs --full <bundle> for it; build it again to record one. Sets built by 1.x with baseline, clinvar-gkm, a custom spec or from deltas are refused: check them with the 1.x tool that wrote them.

Design records

Contributing

Work on a branch and open a pull request against main. Project conventions are in CLAUDE.md and .claude/rules/.

License

CC0 1.0 Universal: dedicated to the public domain.

Metadata

Release files for gkm-bundle-parquet 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gkm-bundle-parquet 2.0.0
File Size Uploaded Provenance Actions
gkm_bundle_parquet-2.0.0.tar.gz 519.1 kB With provenance Details for gkm_bundle_parquet-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gkm-bundle-parquet 2.0.0
File Interpreter ABI Platform Actions
gkm_bundle_parquet-2.0.0-py3-none-any.whl Python 3 none any Details for gkm_bundle_parquet-2.0.0-py3-none-any.whl

Total release size: 678.7 kB

Release files / gkm_bundle_parquet-2.0.0.tar.gz

Download URL gkm_bundle_parquet-2.0.0.tar.gz
Size 519.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a7a4634df48c07673d15c3f6da23edaf75c665ac7a3d5011ec5163ed4c643f33
BLAKE2b-256 checksum
How to use checksums
4c8e550ff39e0ce6b0c91bd35dd995351503deca717714f4290212b484bb6de1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / gkm_bundle_parquet-2.0.0-py3-none-any.whl

Download URL gkm_bundle_parquet-2.0.0-py3-none-any.whl
Size 159.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f31e0eb134f75c0c85815d6b0b0478777b93aadf730490059a7307a3d08593b8
BLAKE2b-256 checksum
How to use checksums
76116fb37b7b30befd9e8a11a797823f10206ab6450bf581bdda30a4a93eb3ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Security for gkm-bundle-parquet 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for gkm_bundle_parquet-2.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page