PySpiro: A Python Library for Lung Function Reference Equations and Severity Classification
H. Pott, B. Schmeck, D. Heider, R. Martin
Key points
From the paper's conclusion- 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.
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.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Accuracy and reproducibility of a large language model in assessing spirometry test acceptability and interpretation: a performance study.Frontiers in medicine · 2026
- Clinical validation of the Swaasa® artificial intelligence platform using cough sounds for screening and aid in diagnosis of respiratory diseases.Frontiers in medicine · 2026
- Race-Neutral Spirometry to Predict Residual Volume in COPD Patients: The Pittsburgh Residual Volume Calculator.Chronic obstructive pulmonary diseases (Miami, Fla.) · 2026
- Diagnostic outcomes of the 2023 race-neutral and 2012 race-specific global lung function initiative spirometry equations in healthy Algerian adults: a cross-sectional comparative analysisLibyan Journal of Medicine · 2026
- Spirometry documentation gaps and reporting delays in a COPD reporting system: implications for surveillance data quality.Frontiers in medicine · 2026
- Race-neutral Global Lung Function Initiative 2022 equations alter COPD trial eligibility in a northeast Asian COPD cohort.ERJ open research · 2026