Skip to main content

HemOnc Alchemy

HemOnc Alchemy turns an imported HemOnc.org terminology database into typed SQLAlchemy models and composable Python queries.

The package sits between source data and an analysis or application:

HemOnc extracts → generated model → toolkit queries and treatment policies → your application

The generated model describes the source. The toolkit helps navigate it and makes recurring treatment interpretations explicit. Your application remains responsible for cohort definitions, local protocol policy, OMOP mappings, and presentation.

Start here

Read the documentation, beginning with the quickstart if you already have a configured database, or installation and configuration if you do not.

Before writing analytical joins, read Understanding the HemOnc model. The important questions are the row grain, the difference between a HemOnc CUI and an OMOP concept_id, and whether a latest-version policy is being applied.

Install

uv add "hemonc-alchemy[postgres]"

For repository development:

uv sync --extra dev

For notebooks and exploratory plots:

uv sync --extra exploration

The optional omop extra adds the bridge for resolving HemOnc identifiers against an OMOP vocabulary. Docker, PostgreSQL, pgAdmin, source extracts, and clinical data are not installed by the package.

Configure and query

omop-config configure hemonc_alchemy
from sqlalchemy.orm import Session

from hemonc_alchemy import create_hemonc_engine, get_hemonc_context

_, database = get_hemonc_context()
engine = create_hemonc_engine(database)

with Session(engine) as session:
    ...

The toolkit guide explains when to use core model queries, treatment selection, classification, and scheduling. The local development guide describes the disposable Compose stack.

Repository layout

hemonc_alchemy/
├── model/       generated entities and hand-written relationships
├── toolkit/     model queries, treatment analytics, schedules, and loading
├── schema/      registry used to generate the model
├── compiler/    model-generation and validation code
└── config.py    database configuration

Model generation and source loading are maintainer operations. See Regenerating the model before changing generated files.

Metadata

Release files for hemonc-alchemy 0.5.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 hemonc-alchemy 0.5.0
File Size Uploaded Provenance Actions
hemonc_alchemy-0.5.0.tar.gz 498.3 kB With provenance Details for hemonc_alchemy-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hemonc-alchemy 0.5.0
File Interpreter ABI Platform Actions
hemonc_alchemy-0.5.0-py3-none-any.whl Python 3 none any Details for hemonc_alchemy-0.5.0-py3-none-any.whl

Total release size: 688.3 kB

Release files / hemonc_alchemy-0.5.0.tar.gz

Download URL hemonc_alchemy-0.5.0.tar.gz
Size 498.3 kB
Tags Source
SHA-256 checksum
How to use checksums
09f34734fc2381e66c5828913f7b2bce936663c6b1180b8a41ad7675d6fc9e0a
BLAKE2b-256 checksum
How to use checksums
316d9e64cb7549305f74fda8bb42b386bbcbf93cdbcb8bd716370113d824a68e
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 11, 2026.

Transparency log

Release files / hemonc_alchemy-0.5.0-py3-none-any.whl

Download URL hemonc_alchemy-0.5.0-py3-none-any.whl
Size 190.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
67ad48202212e61550647645f108f7ba2498fda8492b7534c1e9beb684a66360
BLAKE2b-256 checksum
How to use checksums
b578794632559547a9b3e3cf56cf8be2faf594cca0b14a2abe4b5743cef30e22
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 11, 2026.

Transparency log

Security for hemonc-alchemy 0.5.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 hemonc_alchemy-0.5.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 11, 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.

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