Apps for understanding better the air we breathe

I have been suckered* into running a schools event next week, so spent most of the day writing an app to allow school kids to plot the CO2 concentration of indoor air, and do some very basic analysis. The app is now running, both on Streamlit Community Cloud and Railway*. It takes csv files that have some fraction of a day’s data on CO2 concentration in the air, and plots the data. A plot from the app is shown above. The data on CO2 levels is from a Canadian school, I thought some data on a school might be good to interest the school children.

Then you can do some simple fitting on this data, or use the CO2 concentration to estimate the fraction of air that is second hand, i.e., has passed through someone’s lungs. It is this fraction that carries airborne diseases, and so the fraction is proxy for the risk of catching COVID, flu, or another airborne diseases.

At the time of writing I have no idea how teenagers will react to this, we will see next week. We spend maybe 90% of the time indoors – maybe more at this time of year. But we pay little attention to the quality of the air indoors. Arguably we should think more about this, and maybe the app helps here.

Really the people who should be thinking more about about the quality of air we breathe are those responsible for public health, the PM Sir Keir Starmer, and others in power. But there seems little sign of politcians or medics putting time and energy into this**, so I guess I am starting with teenagers.

Even if you are not a teenager, you can try the app, example data for the app is on github – just try any of the csv files. All the csvs should work, that is what I spent most of today on. The CO2 data has times in various date time formats.

Date time formats are an absolute pain to work with, every data set uses a different format, some have seconds, others not, some have the year first, some have the day first, etc etc. You can spend hours (and I did!) getting code that works with a range of eccentric date time formats. But it works now, so I probably just need to get another data set or two for the kids for next week.

* A colleague was looking for “volunteers” so I said sure, and now somewhat regret as of course it is a lot of work, and semester starts in 10 days …

** It is running at the time of writing on Railway but only on free trial, so if this not Jan/Feb 2026, you may be too late …

*** An exception is the Mayor of London, Sir Sadiq Khan, who seems to be on the case here.

Leave a Comment