lx-data-models
lx-dtypes is the reusable data-model package for Lux Group medical research
projects. It provides typed Pydantic contracts, versioned clinical terminology,
report-template validation, FHIR interoperability, and optional Django host
integration.
Highlights
- Strict, reusable contracts for knowledge-base, ledger, reporting, and host integration boundaries.
- Version-aware YAML knowledge bases and deterministic loaders.
- Report-template graph, structure, coverage, and runtime validation.
- FHIR clinical and terminology conversion contracts.
- Typed package data with Pyright, pytest, and documentation checks in CI.
The package is currently in alpha. Public imports are kept stable where
possible, but releases before 1.0 may contain documented breaking changes.
Installation
lx-dtypes supports Python 3.12.
python -m pip install lx-dtypes
Quick start
Load a knowledge-base module shipped with the package:
from lx_dtypes import load_knowledge_base
knowledge_base = load_knowledge_base("report_template_examples")
print(knowledge_base.config.knowledge_base_identity)
print(sorted(knowledge_base.report_template))
Registry-backed deployments should supply the exact module version. See the knowledge-base authoring guide and graph API guide for the complete workflow.
Provision the packaged catalog before starting a registry-backed host:
export LX_DTYPES_KB_REGISTRY=/var/lib/my-host/terminology/registry.json
lx-dtypes-kb-registry bootstrap
This boundary is strict: invalid registry state or an unloadable packaged identity exits nonzero and must block host startup.
Documentation
Start with the documentation index. Key guides include:
- Package boundaries
- Data-model concept map
- Knowledge-base authoring
- Reproduce versioned classifications
- Report-template infrastructure
- FHIR to LXDM mapping
- Django host integration
Build the documentation locally with:
python -m pip install -e ".[docs]"
make -C docs html
Development
git clone https://github.com/wg-lux/lx-data-models.git
cd lx-data-models
uv sync --extra dev
uv run pyright
uv run pytest -q
uv run make -C docs html
Knowledge-base fixtures and tests must not contain patient data, credentials,
or machine-local paths. Generated output belongs in temp/generated_exports/
or a test-local temporary directory.
See CONTRIBUTING.md for the full contributor and release workflow, CHANGELOG.md for release notes, and SECURITY.md for responsible vulnerability reporting.
License and citation
Distributed under the MIT License. If you use lx-dtypes in
published work, cite the project using CITATION.cff.
Metadata
Release files for lx-dtypes 0.2.36
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lx_dtypes-0.2.36.tar.gz | 2.7 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lx_dtypes-0.2.36-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.6 MB
Release files / lx_dtypes-0.2.36.tar.gz
| Download URL | lx_dtypes-0.2.36.tar.gz |
|---|---|
| Size | 2.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f55e8ca1623921bd205bc152ae6cc9c00721db475cabe9026163b7bb351a357b
|
|
BLAKE2b-256 checksum How to use checksums |
b18f93ebb740c4ce743c7cb1fbb5fbc61a3fd9b9754e5bdada15450e170a31d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / lx_dtypes-0.2.36-py3-none-any.whl
| Download URL | lx_dtypes-0.2.36-py3-none-any.whl |
|---|---|
| Size | 866.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c84f15cd867d1f95e1e6b65b395e9cd1c0115dd6ef76d4006e4fe9378b6a5ad0
|
|
BLAKE2b-256 checksum How to use checksums |
1e1e388fc71bd531f7e8bc25ba889ad6c8c6a661f4c173c2c78bdd58004c02d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|