Bits & Flames bitsandflames/fyron

FYRON / OPEN-SOURCE

Give research code a fireplace.

Install Fyron, explore the docs, and connect FHIR extraction, Curate screening, BOA handling, analysis, plotting, reporting, and provenance in one inspectable toolkit.

uv add fyron
Pixel fireplace representing the Fyron open-source research toolkit.

Fyron is built for clinical teams who need code that can be read, reviewed, rerun, and defended. Most helpers accept familiar Python objects such as DataFrames, arrays, file paths, or explicit settings. They return structured tables, dictionaries, model objects, figures, or manifests that another person can inspect.

How To Use These Docs

If you are...Start with
trying Fyron for the first timeGetting Started
designing a clinical analysis pipelineWorkflow Guide
preparing a clinical AI studyClinical AI Study Workflow
looking for runnable examplesExample Gallery
evaluating research trust and citationUsing Fyron In Research
running repeatable terminal jobsUnified CLI
choosing the right moduleModules Overview
reviewing image foldersFyron Curate
working with a live FHIR endpointFHIR REST
downloading imaging cohortsDICOMDownloader
extracting BOA body-composition featuresBOA Extraction
checking function arguments quicklyFunction Reference

Each module page explains what the module is for, when to use it, key parameters, return values, common pitfalls, and related modules. The function reference is intentionally dense and optimized for lookup while coding.

What Fyron Helps You Do

The Scientific Workflow

StageFyron modulesOutput
Connectfhir, dicom, documents, coreraw resources, files, tables
Structurecohort, phenotyping, preprocessingpatient-level analysis tables
Extractimaging, boa_extraction, boa_radiomicsimaging-derived feature tables
Analyzedescriptive, statistics, survival, ml, feature_selectionestimates, models, summaries
Validatevalidation, explainability, imaging.segmentationcalibration, subgroup, segmentation, and external checks
Publishplotting, reporting, audit, clifigures, tables, manifests, repeatable runs

A Minimal Clinical Pipeline

python
from fyron import FHIRRestClient, audit, ml, phenotyping, plotting, preprocessing, validation
from fyron.cohort import build_survival_columns, validate_cohort_table

client = FHIRRestClient("https://hapi.fhir.org/baseR4")
patients = client.search_df("Patient", params={"_count": 50}, max_pages=1)

cohort = build_survival_columns(
    cohort,
    start_col="diagnosis_date",
    end_col="last_followup_or_event_date",
    event_col="event",
)
validate_cohort_table(cohort, required_columns=["patient_id", "time", "event"])

case_flag = phenotyping.define_code_phenotype(
    conditions,
    code_col="code",
    codes=["C34"],
    patient_col="patient_id",
    phenotype_name="lung_cancer",
)

imputer = preprocessing.fit_imputer(cohort, add_missing_indicators=True)
cohort_ready = preprocessing.apply_imputer(cohort, imputer)

km = plotting.plot_kaplan_meier(
    cohort_ready,
    duration_col="time",
    event_col="event",
    group_col="risk_group",
)

result = ml.run_classification_pipeline(
    X,
    y,
    model="random_forest",
    n_estimators=300,
    random_state=42,
    plot=True,
)

calibration, calibration_bins = validation.calibration_summary(y, result["y_prob"])
manifest = audit.create_provenance_manifest(
    title="Minimal Fyron clinical pipeline",
    parameters={"model": "random_forest", "random_state": 42},
)

Start Here