clinvar-proto
Generates clinvar_proto — a typed Python package for parsing NCBI ClinVar VCV XML into protobuf messages — from
the ClinVar VCV XSD.
This repository is the generator, not the package. It holds the inputs (ClinVar_VCV_2.6.xsd,
clinvar_transforms.yaml) and drives xsd-former (the xsdformer
CLI) to emit the clinvar_proto source tree, which is then built into a wheel and published to PyPI. The generated tree
(generated/) and build outputs (dist/) are gitignored — only the inputs are version-controlled.
Sibling to pubmed-proto; same generate-on-demand model.
Consuming clinvar_proto
Depend on the published wheel, not this repo:
pip install clinvar_proto # or: uv add clinvar_proto
from lxml import etree
from clinvar_proto import xml_converter
tree = etree.parse('clinvar_release.xml')
archive_el = tree.getroot().find('VariationArchive')
proto = xml_converter.VariationArchiveType(archive_el) # XML -> protobuf
data = proto.SerializeToString() # protobuf wire bytes, for storage
The converters take any ElementTree-like element, so lxml is the consumer's choice, not a dependency of the wheel
(clinvar_proto needs only protobuf). Release files are large, so consumers normally stream them with
lxml.etree.iterparse on VariationArchive and convert one element at a time. Use lxml >= 6.1 if you do: earlier
releases resolve external entities by default in iterparse (CVE-2026-41066).
The package exposes two modules (both typed; ships py.typed):
| module | purpose |
|---|---|
clinvar_pb2 |
compiled protobuf messages (VariationArchiveType, …) |
xml_converter |
ClinVar XML → protobuf (per-message factory funcs) |
Developing the generator
Requires uv.
make generate # XSD + transforms -> generated/clinvar_proto/
make build # generate, then build the wheel into dist/
make clean # remove generated/ and dist/
uv run --group test pytest # record gate over real ClinVar records
Shaping the output is done in clinvar_transforms.yaml — inlining single- child wrappers, flattening list wrappers,
and attaching documentation comments to the generated messages and fields. See the
xsd-former docs for the transform reference.
Provenance & attribution
ClinVar_VCV_2.6.xsd is the NCBI ClinVar VCV XSD, version 2.6 (dated 2026-02-26):
https://ftp.ncbi.nlm.nih.gov/pub/clinvar/xsd_public/ClinVar_VCV_2.6.xsd
The vendored file is byte-identical to upstream (MD5 a7b65e5a166dc5f36a7eea9127d56f4e, matching NCBI's published
ClinVar_VCV_2.6.xsd.md5). NCBI ClinVar data and schemas are U.S. Government works and public domain in the United
States; the MIT LICENSE in this repo covers CPG's own files (transforms, generator wiring, tests), not the NCBI XSD.
Courtesy of the U.S. National Library of Medicine. NLM/NCBI does not endorse this package. The vendored XSD and the
ClinVar records under tests/records/ are pinned snapshots and do not necessarily reflect the most current data
available from NCBI — fetch from NCBI directly for current data.
The XSD is vendored deliberately, not fetched at build time: pinning the exact bytes keeps the generated schema
reproducible, and NCBI's XSD version is bumped in place under a new filename rather than being immutable per release.
When NCBI publishes a new version, re-vendor the file from https://ftp.ncbi.nlm.nih.gov/pub/clinvar/xsd_public/, point
the Makefile and tests at it, regenerate, and run the record gate.
Releasing
The published version is build.version in clinvar_transforms.yaml (what xsdformer stamps into the wheel). To
release:
- Bump
build.versioninclinvar_transforms.yaml. - Publish a GitHub Release tagged
vX.Y.Zmatching that version.
The release workflow generates, builds, and publishes to PyPI via Trusted Publishing (OIDC). It fails if the tag and
build.version disagree.
Metadata
Release files for clinvar-proto 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| clinvar_proto-0.2.0.tar.gz | 80.8 kB | With provenance | Details for clinvar_proto-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| clinvar_proto-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for clinvar_proto-0.2.0-py3-none-any.whl |
Total release size: 164.4 kB
Release files / clinvar_proto-0.2.0.tar.gz
| Download URL | clinvar_proto-0.2.0.tar.gz |
|---|---|
| Size | 80.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
44a687c079ec6f90ede5b82342f1e30d1e822a1d527c64d89358c99b8fbf1bf1
|
|
BLAKE2b-256 checksum How to use checksums |
c640dcccda2e59b3d3a37186a13799c1367d41efe65efe2dfc90423c641dafb2
|
| 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 Oct 22, 2026.
Transparency logRelease files / clinvar_proto-0.2.0-py3-none-any.whl
| Download URL | clinvar_proto-0.2.0-py3-none-any.whl |
|---|---|
| Size | 83.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c2040256e7baaac9fadd4a8450c06bc0bb9196fc54070216c7e06ed26879e447
|
|
BLAKE2b-256 checksum How to use checksums |
33892f2590fd7ddaf27950cd22d202feebaa01c7f57e5898d097afe45bc77525
|
| 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 Oct 22, 2026.
Transparency logSecurity for clinvar-proto 0.2.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
All 2 files in this release have been uploaded with provenance metadata.
Attestation for clinvar_proto-0.2.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 Oct 22, 2026.
Transparency logA 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.