PySpiro: A Python Library for Lung Function Reference Equations and Severity Classification
Pott, H.; Schmeck, B.; Heider, D.; Martin, R.
Show abstract
Background and Objective: Lung function reference equations are essential for interpreting spirometry and related modalities, yet existing tools are fragmented, modality- and language-specific (predominantly R), and lack integrated severity classifiers. We present PySpiro, an open-source Python library unifying 23 spirometry, 1 multiple breath washout, 2 diffusing capacity, 1 static lung volume, and 2 oscillometry reference equations under a single API, with 10 clinical severity classifiers. Methods: PySpiro was implemented in Python 3 using NumPy and pandas, with all equations coded directly from literature. The unified API exposes predicted medians, z-scores, limits of normal (LLN/ULN), and raw Lambda-Mu-Sigma (LMS) triplets per parameter, plus a vectorised compute() method for batch processing at the DataFrame level. Unit-tests covering every equation and classifier verify agreement with published values and confirm correct boundary, out-of-range, and missing-input handling. Results: PySpiro covers spirometry equations from 1971 to 2022 across Caucasian, Asian, Indian, and race-neutral global populations, plus non-spirometry modalities (multiple breath washout, diffusing capacity, static lung volumes, oscillometry). Classifiers span COPD, interstitial lung disease, pattern and severity grading, bronchodilator reversibility, and primary ciliary dyskinesia. Compared with rspiro (5 equations, 4 spirometry) and the only prior Python package (spiref, 2 equations, no z-scores or % predicted), PySpiro offers substantially broader coverage, multi-modality support, a richer output API, and 10 classifiers absent from both. Conclusions: PySpiro is freely available (PyPI: pyspiro; doi:10.5281/zenodo.15519193) and provides a comprehensive, validated, and extensible platform for lung function data analysis in research pipelines.
Matching journals
The top 8 journals account for 50% of the predicted probability mass.
Similar papers in this journal
- Predicting pulmonary function from the analysis of voice: a machine learning approach 92%
- Using wearable and nearable devices in telerehabilitation for COPD: A review of digital endpoints in home-based programs 88%
- Large Language Models in Real-World Clinical Workflows: A Systematic Review of Applications and Implementation 88%
Similar papers in this journal
- Designing a computer-assisted diagnosis system for cardiomegaly detection and radiology report generation 89%
- Identification of physiological adverse events using continuous vital signs monitoring during paediatric critical care transport: a novel data-driven approach 89%
- Raising awareness of potential biases in medical machine learning: Experience from a Datathon 89%
Similar papers in this journal
- A Cross-sectional Feasibility Study to Evaluate the Usability and Efficacy of “Swaasa”: An AI-Platform for Rapid Respiratory Health Assessment 92%
- Identifying low-dimensional trajectories of mechanically-ventilated patient systems: Empirical phenotypes of joint patient+care processes to enhance temporal analysis in ARDS research 91%
- Development and Clinical Validation of Swaasa AI Platform for screening and prioritization of Pulmonary TB 91%
Similar papers in this journal
- Longitudinal prediction of outcome in idiopathic pulmonary fibrosis using automated CT analysis 89%
- Genome-wide association study of Idiopathic Pulmonary Fibrosis susceptibility using clinically-curated European-ancestry datasets 88%
- Sotatercept Improves Small Airway Disease and Hyperinflation in Patients with Pulmonary Hypertension 88%
Similar papers in this journal
- Clinical utility of home versus hospital spirometry in fibrotic ILD: evaluation following INJUSTIS interim analysis 90%
- A Normal Forced Vital Capacity Does Not Reliably or Equitably Exclude Restriction 89%
- Multiple breath-washout for pulmonary function assessment in young childhood cancer survivors: a multicenter study 89%
"Similar papers" are the closest papers from that journal in the model's embedding space. They show what the match is built on, but the ranking comes mostly from a classifier over the whole training set, not from these examples alone.