Quantifying volatile concentrations in magmas is critical for understanding magma storage, phase equilibria, and eruption processes. We present PyIRoGlass, an open-source Python package for quantifying concentrations of H2O and CO2 species in the transmission FTIR spectra of basaltic to andesitic glasses. We leverage a dataset of natural melt inclusions and back-arc basin basalts with volatiles below detection to delineate the fundamental shape and variability of the baseline underlying the CO23− and H2Om,1635 peaks, in the mid-infrared region. All Beer-Lambert Law parameters are examined to quantify associated uncertainties. PyIRoGlass employs Bayesian inference and Markov Chain Monte Carlo sampling to fit all probable baselines and peaks, solving for best-fit parameters and capturing covariance to offer robust uncertainty estimates. Results from PyIRoGlass agree with independent analyses of experimental devolatilized glasses (within 6 %) and interlaboratory standards (10 % for H2O, 6 % for CO2). We determine new molar absorptivities for basalts, [Formula presented] and [Formula presented]; we additionally update the composition-dependent parameterizations of molar absorptivities, with their uncertainties, for all H2O and CO2 species peaks. The open-source nature of PyIRoGlass ensures its adaptability and evolution as more data become available.