Skip to main content

Tablassert

PyPI Downloads Python CI License Docs GitHub stars

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: study_size, method: column, encoding: D }

Wrap it in a graph config (graph.yaml) pointing at your fullmap entity-resolution database and carrying the required rig: metadata for the generated Resource Ingest Guide:

name: MY_KG
version: 1.0.0
tables:
  - ./table.yaml
fullmap: /path/to/fullmap
rig:
  source_info:
    infores_id: infores:my-kg
    terms_of_use_info:
      terms_of_use_url: https://example.org/terms
    data_access_locations:
      - My source downloads - https://example.org/downloads
    source_status: maintained_regular_updates
  ingest_info:
    utility: Gene-disease associations support Translator disease-mechanism queries.
    scope: Gene-disease associations extracted from tabular sources.
  provenance_info:
    contributions:
      - "Author Name - code author, data modeling"
  artifact_base_url: https://example.org/my-kg
  artifact_base_path: ./published/my-kg

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","has_supporting_studies":{"PMID:12345678":{"id":"PMID:12345678","name":"gene-disease.csv","study_size":450,"has_study_results":[{"id":"row:2"}]}}}

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 four-stage audit (exact → fuzzy → abbreviation → SapBERT embeddings) flags low-confidence mappings
  • KGX compliance: emits NCATS Translator-compatible node/edge NDJSON with Biolink categories and predicates
  • Autonomous agent: tablassert 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]"
aria2 bundled aria2c downloader for build-fullmap --aria2c (Linux/Windows wheels only) pip install "tablassert[aria2]"
qc four-stage QC audit (exact → fuzzy → abbreviation → SapBERT embeddings) pip install "tablassert[qc]"
agent autonomous agent (smolagents, litellm, article/table context) pip install "tablassert[agent]"
optimize GEPA prompt optimization for agent --optimize (dspy) pip install "tablassert[optimize]"
distill distillation dataset export (tablassert distill-export, HF datasets) pip install "tablassert[distill]"
log loguru-backed file/progress logging (rotation, enqueue) pip install "tablassert[log]"

QC is opt-in at build time (build-kg --qc). Reaching a feature whose extra is not installed never produces a bare ModuleNotFoundError: the failure names the missing package and the exact install command, and for build-kg --qc and tablassert agent it arrives before the run starts rather than partway through. Logging is the exception: without the log extra it degrades to a stdlib fallback instead of failing. 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 --extra log
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

Metadata

Release files for tablassert 18.1.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 tablassert 18.1.0
File Size Uploaded
tablassert-18.1.0.tar.gz 349.3 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for tablassert 18.1.0
File
tablassert-18.1.0-cp314-cp314-manylinux_2_34_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.34+ x86-64 Details
tablassert-18.1.0-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details
tablassert-18.1.0-cp313-cp313-manylinux_2_34_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.34+ x86-64 Details
tablassert-18.1.0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
tablassert-18.1.0-cp312-cp312-manylinux_2_34_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.34+ x86-64 Details
tablassert-18.1.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
tablassert-18.1.0-cp311-cp311-manylinux_2_34_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.34+ x86-64 Details
tablassert-18.1.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details

Total release size: 13.6 MB

Release files / tablassert-18.1.0.tar.gz

Download URL tablassert-18.1.0.tar.gz
Size 349.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c555772ab281a8d957579391b08e3708c299b527a9da865c28d0d70d83f41341
BLAKE2b-256 checksum
How to use checksums
e703488b1096c8afb7aae5dfdca08e0575ccbcd92a8aa755e6a0163a50a4a4fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 14, 2026.

Transparency log

Release files / tablassert-18.1.0-cp314-cp314-manylinux_2_34_x86_64.whl

Download URL tablassert-18.1.0-cp314-cp314-manylinux_2_34_x86_64.whl
Size 1.8 MB
Tags CPython 3.14 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
34e732cadf7029c1502ab3a3e0c0b513cc5404ff12ff6e55be40f32502de9fdb
BLAKE2b-256 checksum
How to use checksums
12a8485017593354646bc962d00d9d71deb6d3964c95ae7ccaf37d9be19866dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 14, 2026.

Transparency log

Release files / tablassert-18.1.0-cp314-cp314-macosx_11_0_arm64.whl

Download URL tablassert-18.1.0-cp314-cp314-macosx_11_0_arm64.whl
Size 1.5 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
dc8446e045a52bc40bbe73610ce1138b5754752454b73c8124b8e40274cfad1f
BLAKE2b-256 checksum
How to use checksums
db1a32139f834266b63d0312c47e3f8654914ebaaa2e365c4af2138a17fe40b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 14, 2026.

Transparency log

Release files / tablassert-18.1.0-cp313-cp313-manylinux_2_34_x86_64.whl

Download URL tablassert-18.1.0-cp313-cp313-manylinux_2_34_x86_64.whl
Size 1.8 MB
Tags CPython 3.13 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
559afd39a84d3d0600fcafc61608a2729654cca9159e9c80c100e9805b9a875f
BLAKE2b-256 checksum
How to use checksums
65ace837c17f6c3be6e318345deb97a2de8888bd1392873a86ea2bad0a9f97f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 14, 2026.

Transparency log

Release files / tablassert-18.1.0-cp313-cp313-macosx_11_0_arm64.whl

Download URL tablassert-18.1.0-cp313-cp313-macosx_11_0_arm64.whl
Size 1.5 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
31e6b730f7a7a6395b1b3bc742dd49eea045ef01bb75842d06419ecfade095f2
BLAKE2b-256 checksum
How to use checksums
4dabfb47a700aba719013846b08158d67a1e3343f506a9757f9e9b5e494f1d53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 14, 2026.

Transparency log

Release files / tablassert-18.1.0-cp312-cp312-manylinux_2_34_x86_64.whl

Download URL tablassert-18.1.0-cp312-cp312-manylinux_2_34_x86_64.whl
Size 1.8 MB
Tags CPython 3.12 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
5980bfc5c2e56aac104f46b82d6aff53b84a838a8504533567f4a63464e6a2f3
BLAKE2b-256 checksum
How to use checksums
d210c588846803c197bca8dc97e324eed7b8797bc9104d8b5d5c33933e21e0e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 14, 2026.

Transparency log

Release files / tablassert-18.1.0-cp312-cp312-macosx_11_0_arm64.whl

Download URL tablassert-18.1.0-cp312-cp312-macosx_11_0_arm64.whl
Size 1.5 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2453bf345b435f896e5eae6ad7b369840f55926709f577fe8ca2543331f48629
BLAKE2b-256 checksum
How to use checksums
5d30dff2cb5d6d3dc1847696946139cc3abfb2c91218e63aaa16fef6dfd28117
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 14, 2026.

Transparency log

Release files / tablassert-18.1.0-cp311-cp311-manylinux_2_34_x86_64.whl

Download URL tablassert-18.1.0-cp311-cp311-manylinux_2_34_x86_64.whl
Size 1.8 MB
Tags CPython 3.11 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
105647c66bda3c4b3cab29c952ba903acc1fd016aaf7df7456751f1299b02796
BLAKE2b-256 checksum
How to use checksums
3d573658460329bfaf25c9afd4bd8b23ade8b4d426f1b8950532c0a1d8b6bac0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 14, 2026.

Transparency log

Release files / tablassert-18.1.0-cp311-cp311-macosx_11_0_arm64.whl

Download URL tablassert-18.1.0-cp311-cp311-macosx_11_0_arm64.whl
Size 1.5 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0a693b201a08a52620b88b1814bd8a744280a89bf0fecea0e06e74dac266caa0
BLAKE2b-256 checksum
How to use checksums
680eaad388dc384106fa4789ee54527efc00a80b48970f8e6f73e82fab07efe3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 14, 2026.

Transparency log

Release history Release notifications | RSS feed

19.5.0

9 release files

19.4.0

9 release files

19.3.0

9 release files

19.2.0

9 release files

19.1.0

9 release files

19.0.1

9 release files

19.0.0

9 release files

This release

18.1.0 This release

9 release files

18.0.0

9 release files

16.0.0

9 release files

15.1.0

9 release files

15.0.0

9 release files

14.0.0

9 release files

13.0.0

9 release files

12.1.0

9 release files

12.0.0

9 release files

11.0.0

9 release files

10.1.0

9 release files

10.0.0

9 release files

9.1.0

9 release files

9.0.0

9 release files

8.2.1

9 release files

8.2.0

9 release files

8.1.0

9 release files

8.0.1

9 release files

8.0.0

9 release files

7.5.2

2 release files

7.5.1

2 release files

7.5.0

2 release files

7.4.14

2 release files

7.4.13

2 release files

7.4.12

2 release files

7.4.11

2 release files

7.4.10

2 release files

7.4.9

2 release files

7.4.8

2 release files

7.4.7

2 release files

7.4.6

2 release files

7.4.5

2 release files

7.4.4

2 release files

7.4.3

2 release files

7.4.2

2 release files

7.4.1

2 release files

7.4.0

2 release files

7.3.6

2 release files

7.3.5

2 release files

7.3.4

2 release files

7.3.3

2 release files

7.3.2

2 release files

7.3.1

2 release files

7.3.0

2 release files

7.2.2

2 release files

7.2.1

2 release files

7.2.0

2 release files

7.1.0

2 release files

7.0.2

2 release files

7.0.1

2 release files

7.0.0

2 release files

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