Skip to main content

Tablassert

PyPI Python CI License Docs

Extract knowledge assertions from tabular data into NCATS Translator-compliant KGX NDJSON — declaratively, with entity resolution built in and optional quality control.

Tablassert turns biomedical spreadsheets (Excel, CSV, TSV) into knowledge graphs ready for NCATS Translator. Declare how your columns map to subject–predicate–object statements in YAML; Tablassert resolves free text to standard CURIEs, attaches provenance and statistical annotations, and emits KGX-compliant nodes and edges.

Full Documentation — installation guides, tutorial, configuration reference, and API docs.

Quick Start

pip install tablassert

Given a CSV of gene–disease associations with p-values and sample sizes, declare the mapping in a table config (table.yaml):

template:
  source:
    kind: text
    local: ./gene-disease.csv
    url: https://example.com/data.csv
    row_slice: [1, auto]
    delimiter: ","
  statement:
    subject: { method: column, encoding: A, prioritize: [Gene] }
    predicate: associated_with
    object: { method: column, encoding: B, prioritize: [Disease] }
  provenance: { repo: PMID, publication: "12345678" }
  annotations:
    - { annotation: p_value, method: column, encoding: C }
    - { annotation: supporting_study_size, method: column, encoding: D }

Wrap it in a graph config (graph.yaml) pointing at your fullmap entity-resolution database:

name: MY_KG
version: 1.0.0
description: Gene–disease associations extracted from tabular sources.
tables:
  - ./table.yaml
fullmap: /path/to/fullmap

Build the knowledge graph:

tablassert build-kg graph.yaml

Output is one JSON object per line — nodes with Biolink categories, edges with annotations:

{"id":"HGNC:11998","name":"TP53","category":["biolink:Gene"],"taxon":"NCBITaxon:9606"}
{"id":"MONDO:0008903","name":"lung cancer","category":["biolink:Disease"]}
{"subject":"HGNC:11998","predicate":"biolink:associated_with","object":"MONDO:0008903","p_value":"1.0000e-03","supporting_study_size":"450"}

See the Tutorial for the full walkthrough.

Key Features

  • Declarative YAML configuration — define data transformations without writing code
  • Built-in entity resolution — map free text to genes, diseases, and chemicals with standard CURIEs, taxonomic filtering, and provenance, backed by an embedded redb database
  • Optional quality control — a three-stage audit (exact → fuzzy → BioBERT embeddings) flags low-confidence mappings
  • KGX compliance — emits NCATS Translator-compatible node/edge NDJSON with Biolink categories and predicates
  • Autonomous agenttablassert agent derives, builds, and refines configs for whole papers
  • Performance & reproducibility — lazy Polars pipelines and a deterministic UV-based development environment

Installation

pip install tablassert

Or with uv: uv tool install tablassert. The base install builds knowledge graphs from CSV/TSV/Excel sources; optional extras add runtime and pipeline capabilities:

Extra Adds Install
rt CPU-compatible Polars runtime pip install "tablassert[rt]"
qc three-stage QC audit (exact → fuzzy → BioBERT embeddings) pip install "tablassert[qc]"
agent autonomous agent (smolagents, litellm, PDF context) pip install "tablassert[agent]"
optimize GEPA prompt optimization for agent --optimize (dspy) pip install "tablassert[optimize]"

QC is opt-in at build time (build-kg --qc). See the Installation guide for the full matrix and the CLI Reference for every flag.

Entity Resolution API

from pathlib import Path
from tablassert.lib import resolve_many

results = resolve_many(
    col="gene",
    entities=["TP53", "BRCA1"],
    fullmap=Path("/path/to/fullmap"),
    taxon="9606",
)
# [{"original_gene": "TP53", "gene": "HGNC:11998", "gene_name": "TP53", ...}, ...]

Point resolve_many() at a fullmap database to resolve any iterable of entity strings to CURIEs — no LazyFrame setup or NLP preprocessing required. See the Batch Resolution API for the full reference.

Documentation

Developing

uv sync --group dev --extra qc
uv run maturin develop --manifest-path rust/Cargo.toml
make check

See CONTRIBUTING.md for the full development loop, quality gates, and pull request guidelines.

Citation

If you use Tablassert, please cite it as described in CITATION.cff. The approach is described in:

Skye Lane Goetz, Alex K. Glen, and Gwênlyn Glusman. “MicrobiomeKG: bridging microbiome research and host health through knowledge graphs.” Frontiers in Systems Biology 5 (2025). doi:10.3389/fsysb.2025.1544432

License

Apache License 2.0

Contributors

Download files

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

Source Distribution

tablassert-8.2.0.tar.gz (212.9 kB view details)

Uploaded Source

Built Distributions

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

tablassert-8.2.0-cp314-cp314-manylinux_2_34_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

tablassert-8.2.0-cp314-cp314-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

tablassert-8.2.0-cp313-cp313-manylinux_2_34_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

tablassert-8.2.0-cp313-cp313-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

tablassert-8.2.0-cp312-cp312-manylinux_2_34_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

tablassert-8.2.0-cp312-cp312-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

tablassert-8.2.0-cp311-cp311-manylinux_2_34_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

tablassert-8.2.0-cp311-cp311-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file tablassert-8.2.0.tar.gz.

File metadata

  • Download URL: tablassert-8.2.0.tar.gz
  • Upload date:
  • Size: 212.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for tablassert-8.2.0.tar.gz
Algorithm Hash digest
SHA256 bf39fdfc14aaadb1965f1fa8eefa467513d07f2e34ef9e5de6d1dfa5e73f1aff
MD5 3c1dc169b56a483d65732dc481bc2f0a
BLAKE2b-256 071335fcd5f753713c5bfcbf19c785f8aa9a920a8eb6f0f2e573eba086f22efd

See more details on using hashes here.

Provenance

The following attestation bundles were made for tablassert-8.2.0.tar.gz:

Publisher: pipy.yml on SkyeAv/Tablassert

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tablassert-8.2.0-cp314-cp314-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for tablassert-8.2.0-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 a059db2f27367e18fe9e71611eb6fe27a8e64d619a8413f1925359041b2614ff
MD5 2962ec9223872bf126f0c6981ed996cd
BLAKE2b-256 f3c4fb9e2f732c2215d481d724c01fac15daa3aafa9df1adbc2001c904e4c54c

See more details on using hashes here.

Provenance

The following attestation bundles were made for tablassert-8.2.0-cp314-cp314-manylinux_2_34_x86_64.whl:

Publisher: pipy.yml on SkyeAv/Tablassert

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tablassert-8.2.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tablassert-8.2.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e590a80b4598704afa40dd5addaf096fdb63bc64e4130089f1d0851b73af551b
MD5 1073479213ea0ee1fe2eb12c4e771dd5
BLAKE2b-256 b4cdc47d2f702778c04fcb8eb692e9d39fc6b1edb41bd0594ea18de2a862403b

See more details on using hashes here.

Provenance

The following attestation bundles were made for tablassert-8.2.0-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: pipy.yml on SkyeAv/Tablassert

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tablassert-8.2.0-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for tablassert-8.2.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 9e2141d6aeed0ce44177c4c87fc74182cf547bb59541461c8808c4c0ada09149
MD5 4a47ee0f0683c2df20d91f3a4a430e8f
BLAKE2b-256 b40a04cf9772a0cba524a603f9f0a819f523e40680e33f829a57c5c6e92c3c3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for tablassert-8.2.0-cp313-cp313-manylinux_2_34_x86_64.whl:

Publisher: pipy.yml on SkyeAv/Tablassert

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tablassert-8.2.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tablassert-8.2.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 37a294685c975596456aa8937d5bfabd7912a29906905de9166c7e2987f2ed97
MD5 19eb31f2afa866d8d0cadd3ec30685be
BLAKE2b-256 405a1a4d96197ff0f6add0ac958d252a459e8b643c142855192922db7b44f87a

See more details on using hashes here.

Provenance

The following attestation bundles were made for tablassert-8.2.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: pipy.yml on SkyeAv/Tablassert

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tablassert-8.2.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for tablassert-8.2.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 a9739d8193904e15aa246ba9618c9f7318d06f22fb5bfb240fe14fd2d1e2dc6e
MD5 781f258ab7ee51825697843facc1d685
BLAKE2b-256 cff74492701b1c7aa91fe57a0ef6e8e380252afcdaeed51b4ca6512f57a49925

See more details on using hashes here.

Provenance

The following attestation bundles were made for tablassert-8.2.0-cp312-cp312-manylinux_2_34_x86_64.whl:

Publisher: pipy.yml on SkyeAv/Tablassert

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tablassert-8.2.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tablassert-8.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 660888209f7b7e8f9cea1790435773f1fb1989ccdc7879c2bf573534f939b021
MD5 6978f1ac4f4a53aa03c41daec9afccec
BLAKE2b-256 3f51410f28c231ee745d4297c442abca238d5b568c214172b011d52f1f2d13fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for tablassert-8.2.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: pipy.yml on SkyeAv/Tablassert

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tablassert-8.2.0-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for tablassert-8.2.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 a27e301872e4a8d1e0ce95802e56fe1418c2ace261da58f317a01f36c96839b9
MD5 c77d9733b39d5ccc1b0e2cdc9cb77a67
BLAKE2b-256 0d4b7af113666f20e8745554d044f13b9a670ab5b48aae28a5d97ad4eb4e79eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for tablassert-8.2.0-cp311-cp311-manylinux_2_34_x86_64.whl:

Publisher: pipy.yml on SkyeAv/Tablassert

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tablassert-8.2.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tablassert-8.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 15a85716b2289061afff664d201b76f3c8cf47e630858d80f7df444a8bfd0537
MD5 f3e104a5f67e85c6bcca7ba2c1558662
BLAKE2b-256 66bdeb82416f21f7968b7c3589039f5f6ccfdbf7614db86823974e9a8c1c1647

See more details on using hashes here.

Provenance

The following attestation bundles were made for tablassert-8.2.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: pipy.yml on SkyeAv/Tablassert

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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