Skip to main content

SCOOP

SCOOP is a Python library designed to generate synthetic oncology patient data conforming to the OMOP Common Data Model (CDM). It provides tools to create realistic patient profiles, including demographics, diagnoses, treatments, and outcomes, facilitating dataset alignment and software development for healthcare analytics without compromising patient privacy.

Key Features

  • HemOnc integration — realistic longitudinal roll-out of systemic therapy regimens.
  • Configurable attributes — define demographic, clinical, and molecular distributions via YAML or code.
  • CDM compatibility — outputs data natively aligned to OMOP tables and concept identifiers.
  • Composable design — easily extend distributions, conditional logic, and transformation rules for new disease domains.

Principles

The functionality of SCOOP should be considered in four broad phases:

  1. Sampling: Drawing samples from defined statistical distributions to create individual patient attributes.
  2. Simulation: Rules-based roll out of patient trajectories based on clinical logic and treatment regimens, aligned to generated attributes.
  3. Synthesis: Applying defined transformations to the sampled attributes to generate the final patient data
  4. Serialisation: Converting the generated patient data into a format compatible with the OMOP CDM for storage and analysis.

Flow

  1. a Person object is created with basic attributes (sampled from flat distributions - no dependencies)
  2. a Condition object is created for that person, with attributes sampled conditionally based on the Person attributes
  3. a Regimen object may optionally be created for that condition x person combination, sampled conditionally based on both Person and Condition attributes
  4. exposure events (procedures, drug administration events) are created based on the Regimen object
  5. treatment response and outcome events are created based on the Condition and Regimen objects
  6. all objects are serialised to OMOP CDM tables

Start here

Install the project dependencies with uv:

uv sync

Choose a guide

Profiles

Profiles are YAML files under scoop/profiles/. NSCLC is the most complete example of the current graph, treatment registry, intervention catalog, and routed-profile format. See Create a profile before copying or extending one.

Export a local synthetic cohort

onco-scoop export-synthetic-cohort samples a routed profile and writes a new, self-contained SQLite file with OMOP rows, the HemOnc snapshot, source-event links, and run metadata. It retains patients whose schedule cannot be resolved. Repeating courses use a finite cycle limit; fixed courses keep their source-defined end.

The source HemOnc and OMOP vocabulary tables are found through an oa-configurator config file. Both must live in the same physical database (one DuckDB file, or one PostgreSQL database). A DuckDB config looks like this; keep the path absolute:

[connections.hemonc_stack]
dialect = "duckdb"
database_name = "/absolute/path/to/scoop/data/hemonc-stack.duckdb"

[databases.hemonc_db]
kind = "generic"
connection = "hemonc_stack"
schema_name = "hemonc"

[databases.cdm_db]
kind = "cdm"
connection = "hemonc_stack"
cdm_schema = "cdm"
vocab_schema = "omop"

[tools.scoop]
hemonc_db = "hemonc_db"

[tools.hemonc_alchemy]
hemonc_db = "hemonc_db"
omop_db = "cdm_db"

[tools.omop_alchemy]
cdm_db = "cdm_db"

Install the locked runtime dependencies, point OA_CONFIG_PATH at the local DuckDB config, set the HemOnc SQLite snapshot, then run:

uv sync --locked
export OA_CONFIG_PATH="$PWD/data/scoop.duckdb.toml"
export HEMONC_SNAPSHOT="$PWD/data/hemonc-snapshot.sqlite"
uv run onco-scoop export-synthetic-cohort \
  --profile nsclc \
  --count 10000 \
  --seed 0 \
  --max-cycles 35 \
  --output data/synthetic_nsclc_from_cli.sqlite

For PostgreSQL, point the connection at a postgresql database instead; the psycopg driver is a core dependency. The output must not already exist; the command builds a temporary file, checks SQLite integrity and foreign keys, then renames it into place. Use --help for all options.

Add --quiet to show only an in-place progress bar instead of progress messages and the JSON summary.

Development

Install development dependencies and run the test suite:

uv sync --extra dev
uv run pytest -q

Metadata

Release files for onco-scoop 0.3.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 onco-scoop 0.3.0
File Size Uploaded Provenance Actions
onco_scoop-0.3.0.tar.gz 397.3 kB With provenance Details for onco_scoop-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for onco-scoop 0.3.0
File Interpreter ABI Platform Actions
onco_scoop-0.3.0-py3-none-any.whl Python 3 none any Details for onco_scoop-0.3.0-py3-none-any.whl

Total release size: 585.6 kB

Release files / onco_scoop-0.3.0.tar.gz

Download URL onco_scoop-0.3.0.tar.gz
Size 397.3 kB
Tags Source
SHA-256 checksum
How to use checksums
479985a6b824fcedc444da297afbfa41561a8b4962a8aafbceab6c364414c336
BLAKE2b-256 checksum
How to use checksums
4fbf042aba180c2093b93b3d5ae1bcff497fbbfe78349e9fdd90262dc92000c3
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 20, 2026.

Transparency log

Release files / onco_scoop-0.3.0-py3-none-any.whl

Download URL onco_scoop-0.3.0-py3-none-any.whl
Size 188.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c7cb2ae1c26d34387524b859ea468415ddce0e9862e6b726f8aef6881472a399
BLAKE2b-256 checksum
How to use checksums
0a86efaa7c7684812a6051d78143f51d5d854217874a3471deb8a125b90202bf
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 20, 2026.

Transparency log

Security for onco-scoop 0.3.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 onco_scoop-0.3.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 20, 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.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files Full provenance

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