Skip to main content

Fyron Banner

PyPI CI Python License FHIR DICOM Survival ML Docs

Fyron

Clinical data science, from source systems to evidence artifacts.

Fyron is an open Python toolkit for healthcare researchers, imaging AI teams, and clinical data scientists who need research workflows to be inspectable, reproducible, and ready for scientific review. It connects the practical pieces around clinical evidence generation: FHIR and DICOM acquisition, local imaging and BOA outputs, cohort construction, manuscript statistics, survival analysis, tabular machine learning, validation, explainability, paper-ready figures, and provenance manifests.

We developed Fyron from years of hands-on clinical data science work, where the hard part is rarely one isolated model or one isolated table. Real studies often span hospital systems, registries, PACS exports, segmentation folders, spreadsheets, notebooks, statistical scripts, figures, and reviewer questions. Fyron gives those steps a shared, explicit shape so assumptions are visible and outputs can be checked, saved, repeated, and cited.

Fyron is not a replacement for pandas, scikit-learn, lifelines, highdicom, MONAI, or FHIR/DICOM libraries. It is the pragmatic research layer around them: small APIs, explicit parameters, DataFrame-first outputs, Matplotlib figures, clinical workflow defaults, and audit artifacts that help a team move from raw clinical data to defensible scientific results.

Documentation · Example Gallery · API Design · Using Fyron In Research

What Fyron Enables

Research need Fyron support
Acquire clinical data FHIR REST/SQL workflows, FHIRPath extraction presets, DICOMweb downloads, document downloads
Build cohorts patient joins, endpoint construction, cohort profiles, filter-flow explainability
Work with imaging AI outputs DICOM/NIfTI utilities, BOA feature extraction, radiomics, DICOM SEG export, segmentation collages, CT/MR difference heatmaps
Prepare training datasets nnU-Net v2 segmentation folders, YOLO classification folders, YOLO detection labels
Produce manuscript statistics Table 1, missingness/QC tables, FDR correction, regression tables, model-comparison tests
Run survival and ML studies Kaplan-Meier, Cox, RMST, Schoenfeld diagnostics, classification pipelines, calibration, thresholds, subgroup metrics
Explain and review results feature importance, SHAP-ready summaries, patient-level prediction drivers, cohort flow charts, paper-ready plots
Preserve provenance analysis run manifests, file hashes, parameters, output paths, package/version metadata

Why We Built Fyron

Clinical research is full of valuable but fragmented work: a FHIR query in one place, an imaging export in another, a cohort spreadsheet, a survival notebook, a model validation script, and figures assembled late in the manuscript process. That fragmentation makes it difficult to answer simple but essential questions: Which patients entered the study? Which endpoint definition was used? Which features were excluded? Which parameters produced this figure?

Fyron is built for that middle layer. It makes the common clinical data science steps explicit, composable, and reviewable without turning them into a black box. The goal is not AutoML and not regulatory compliance software; the goal is practical scientific discipline: clear inputs, clear assumptions, clear outputs, and artifacts that can travel from notebook to manuscript to supplement.

From Clinical Data To Evidence

FHIR / DICOM / files
        -> cohort and endpoints
        -> feature tables and imaging measurements
        -> statistics, survival, and ML
        -> validation and explainability
        -> figures, reports, and provenance manifests
from fyron import FHIRRestClient
from fyron.fhir import get_fhir_path_preset
from fyron.cohort import build_time_to_event_endpoint, cohort_profile
from fyron.flow import FlowTracker
from fyron.audit import analysis_run_manifest, write_manifest

client = FHIRRestClient("https://hapi.fhir.org/baseR4")
observations = client.search_df(
    "Observation",
    params={"_count": 50, "code": "http://loinc.org|718-7"},
    fhir_paths=get_fhir_path_preset("Observation"),
    max_pages=1,
)

cohort = build_time_to_event_endpoint(
    cohort,
    index_date_col="diagnosis_date",
    event_date_col="death_date",
    censor_date_col="last_followup_date",
)

profile = cohort_profile(cohort, id_col="patient_id", endpoint_cols=["time", "event"])

flow = FlowTracker("NSCLC CT cohort")
flow.add_step("Reviewed export", cohort, reason="source cohort")

manifest = analysis_run_manifest(
    title="nsclc_ct_survival_model",
    inputs=["cohort.csv", "features.csv"],
    outputs=["table1.csv", "km.png", "model_metrics.csv"],
    parameters={"seed": 42, "endpoint": "overall_survival"},
)
write_manifest(manifest, "analysis_manifest.json")

The Example Gallery contains full synthetic workflows for FHIR-to-cohort, BOA/imaging validation, cohort-flow explainability, manuscript statistics, plotting, DICOM SEG export, and CT/MR difference heatmaps.

Built For Responsible Research

  • Local-first by default. Fyron sends no telemetry on import; external calls happen only when you configure a client or CLI command.
  • Inspectable outputs. Core helpers return DataFrames, dictionaries, named objects, Matplotlib figures, and JSON-compatible manifests.
  • Explicit clinical assumptions. Endpoints, censoring, event coding, FHIR paths, imaging geometry, p-value correction, and model validation choices are parameterized.
  • Synthetic examples. Documentation examples are designed to be runnable without PHI.
  • Research, not clinical deployment. Fyron is not a medical device, treatment recommendation system, or compliance platform.

For citation, security, and API expectations, see CITATION.cff, SECURITY.md, API Design, and Using Fyron In Research.

Install

uv add fyron

Useful extras:

Extra Install Adds
All features uv add "fyron[all]" Full local research environment with every optional dependency
Excel uv add "fyron[excel]" Excel read/write via openpyxl
Survival uv add "fyron[survival]" KM, RMST, Cox, Weibull AFT
Survival ML uv add "fyron[survival-ml]" Gradient survival boosting via scikit-survival
ML uv add "fyron[ml]" Random Forest, XGBoost, metrics, plots
Statistics uv add "fyron[statistics]" FDR correction, regression tables, QC tests
Feature selection uv add "fyron[feature-selection]" Univariate, model, permutation, Boruta, stability selection
Validation uv add "fyron[validation]" Thresholds, calibration, subgroups, decision curves
Explainability uv add "fyron[explainability]" Permutation importance, partial dependence, SHAP tables
Radiomics uv add "fyron[radiomics]" BOA radiomics via PyRadiomics
Visualization uv add "fyron[visualization]" BOA collages and CT/MR difference heatmaps
S3 uv add "fyron[s3]" S3 and S3-compatible table/object storage

For a broad local analysis environment:

uv add "fyron[all]"

Modules

Module Purpose
fyron.fhir FHIR REST/SQL access, FHIRPath extraction, resource building, mapping, write-back
fyron.dicom DICOMweb downloads, study/series manifests, NIfTI conversion, DICOM SEG
fyron.boa_extraction BOA cohort feature tables from measurement JSON and NIfTI masks
fyron.boa_radiomics Radiomics extraction from BOA segmentations
fyron.datasets Synthetic demo data plus nnU-Net v2 and YOLO dataset preparation
fyron.cohort Patient joins, endpoint construction, cohort profiles, survival columns
fyron.flow Filter-flow tracking, Markdown flow charts, cohort inclusion explainability
fyron.statistics FDR correction, regression tables, model-comparison tests, QC tables
fyron.survival KM, RMST, Cox, Weibull AFT, PH checks, Schoenfeld residual diagnostics
fyron.ml Tabular classification pipelines, metrics, model plots
fyron.validation Bootstrap metrics, calibration, thresholding, subgroup and survival validation
fyron.explainability Feature importance, SHAP summaries, patient-level prediction explanations
fyron.reporting Table 1, metric tables, cohort-flow tables, Markdown report tables
fyron.audit Provenance manifests, file hashes, analysis run records
fyron.plotting Clinical and paper-ready plots across survival, ML, QC, and flow workflows

See the module documentation for workflow guides, tutorials, and the generated complete function reference.

Example Gallery

Start with the Example Gallery for runnable synthetic workflows. It includes FHIR-to-cohort, BOA/imaging validation, cohort-flow explainability, manuscript statistics, plotting, DICOM SEG export, synthetic GAN volume export, and CT/MR difference heatmaps.

Several plotting examples render manuscript-style figures:

Risk score distribution Forest estimates

API Stability

Documented public APIs are intended to be stable within the 0.x line unless marked experimental. Fyron favors additive changes, aliases, and documented migration paths over silent breakage. See API Design for return-shape conventions, optional extras, and deprecation expectations.

Privacy And Security

Fyron is local-first and sends no telemetry on import. External calls happen only when you configure a client or CLI command for systems such as FHIR, DICOMweb, S3, Teable, or document downloads. See SECURITY.md and Using Fyron In Research for healthcare data cautions.

Development

uv sync --all-extras --dev
uv run pytest

Preview documentation locally:

uv run python scripts/build_docs.py
uv run python -m http.server 8001 --directory site

GitHub Pages is built from the Markdown files in docs/ through the BF-native generator in scripts/build_docs.py. The Pages workflow publishes the generated site/ folder when changes land on main.

License

MIT. See LICENSE.

Download files

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

Source Distribution

fyron-0.2.6.tar.gz (2.6 MB view details)

Uploaded Source

Built Distribution

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

fyron-0.2.6-py3-none-any.whl (268.3 kB view details)

Uploaded Python 3

File details

Details for the file fyron-0.2.6.tar.gz.

File metadata

  • Download URL: fyron-0.2.6.tar.gz
  • Upload date:
  • Size: 2.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for fyron-0.2.6.tar.gz
Algorithm Hash digest
SHA256 8a833f12bed296743b0cbaa46418578b36188260e9ee7e27c6e6fc2718903682
MD5 2dba9093ac3c4470928bb7d073858031
BLAKE2b-256 2124e91fa1721a575011c2d3017ffe1b9b2b528e7eec14e09186abcfcd7568b1

See more details on using hashes here.

File details

Details for the file fyron-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: fyron-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 268.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for fyron-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 bf08cc88499db95ef6b79dd1da2735aeaa63ec1f17fbf0f090cccb4fa860e763
MD5 5bc86a856f246349ea3b2447cf002c68
BLAKE2b-256 aa68366f4d240101bea8dbfac8a3e62b756fcf871c6050a883ebd737b473bb16

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.5

2 files

0.3.4

1 file

0.3.3

1 file

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.9

2 files

0.2.8

2 files

0.2.7

2 files

This release

0.2.6 This release

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 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