Skip to main content

Mauna Loa Observatory Carbon Dioxide Data Scraper

This Python package includes a script to scrape the NOAA Earth Science Research Lab for Carbon Dioxide (CO2) readings from the Mauna Loa Observatory in Hawai'i. You can access this data here: https://www.esrl.noaa.gov/gmd/ccgg/trends/mlo.html

Installation

pip install git+https://github.com/kylepollina/mlo_co2.git

Features

monthly_mean()

# Data from March 1958 through April 1974 have been obtained by C. David Keeling
# of the Scripps Institution of Oceanography (SIO) and were obtained from the
# Scripps website (scrippsco2.ucsd.edu).
# Monthly mean CO2 constructed from daily mean values
# Scripps data downloaded from http://scrippsco2.ucsd.edu/data/atmospheric_co2
# Monthly values are corrected to center of month based on average seasonal
# cycle. Missing days can be asymmetric which would produce a high or low bias.
# Missing months have been interpolated, for NOAA data indicated by negative stdev
# and uncertainty. We have no information for SIO data about Ndays, stdv, unc
# so that they are also indicated by negative numbers

Optional start date and end date parameters. Scraped from this url: https://www.esrl.noaa.gov/gmd/webdata/ccgg/trends/co2/co2_mm_mlo.txt

>>> from mlo_co2 import monthly_mean
>>> mean = monthly_mean(start=datetime(year=1985, day=1, month=1), end=datetime(year=2014, day=1, month=1))
>>> mean.keys()
dict_keys(['url', 'license', 'description', 'headers', 'raw', 'data'])
>>> mean['data'].keys()
dict_keys(['yr', 'mon', 'decimal', 'monthly average (ppm)', 'de-seasonalized (ppm)', '#days', 'st.dev of days', 'unc. of mon mean'])

annual_mean()

# Data from March 1958 through April 1974 have been obtained by C. David Keeling
# of the Scripps Institution of Oceanography (SIO) and were obtained from the
# Scripps website (scrippsco2.ucsd.edu).
#
# The estimated uncertainty in the annual mean is the standard deviation
# of the differences of annual mean values determined independently by
# NOAA/ESRL and the Scripps Institution of Oceanography.
#
# NOTE: In general, the data presented for the last year are subject to change,
# depending on recalibration of the reference gas mixtures used, and other quality
# control procedures. Occasionally, earlier years may also be changed for the same
# reasons.  Usually these changes are minor.
#
# CO2 expressed as a mole fraction in dry air, micromol/mol, abbreviated as ppm

Optional start date and end date parameters. Scraped from this url: https://www.esrl.noaa.gov/gmd/webdata/ccgg/trends/co2/co2_annmean_mlo.txt

>>> from mlo_co2 import annual_mean
>>> mean = annual_mean(start=datetime(year=1985, day=1, month=1), end=datetime(year=2014, day=1, month=1))
>>> mean.keys()
dict_keys(['url', 'license', 'description', 'headers', 'raw', 'data'])
>>> mean['data'].keys()
dict_keys(['yr', 'mean (ppm)', 'unc'])

annual_mean_increase()

# Data from March 1958 through April 1974 have been obtained by C. David Keeling
# of the Scripps Institution of Oceanography (SIO) and were obtained from the
# Scripps website (scrippsco2.ucsd.edu).
#
# Annual CO2 mole fraction increase (ppm) from Jan 1 through Dec 31.
#
# The uncertainty in the Mauna Loa annual mean growth rate is estimated
# from the standard deviation of the differences between monthly mean
# values determined independently by the Scripps Institution of Oceanography
# and by NOAA/ESRL.
#
# NOTE: In general, the data presented for the last year are subject to change,
# depending on recalibration of the reference gas mixtures used, and other quality
# control procedures. Occasionally, earlier years may also be changed for the same
# reasons.  Usually these changes are minor.
#
# CO2 expressed as a mole fraction in dry air, micromol/mol, abbreviated as ppm

Optional start date and end date parameters. Scraped from this url: https://www.esrl.noaa.gov/gmd/webdata/ccgg/trends/co2/co2_gr_mlo.txt

>>> from mlo_co2 import annual_mean_increase
>>> mean = annual_mean_increase()
>>> mean.keys()
dict_keys(['url', 'license', 'description', 'headers', 'raw', 'data'])
>>> mean['data'].keys()
dict_keys(['yr', 'ann inc', 'unc'])

weekly_mean()

# NOTE: DATA FOR THE LAST SEVERAL MONTHS ARE PRELIMINARY, ARE STILL SUBJECT
# TO QUALITY CONTROL PROCEDURES.
# NOTE: The week "1 yr ago" is exactly 365 days ago, and thus does not run from
# Sunday through Saturday. 365 also ignores the possibility of a leap year.
# The week "10 yr ago" is exactly 10*365 days +3 days (for leap years) ago.

Optional start date and end date parameters. Scraped from this url: https://www.esrl.noaa.gov/gmd/webdata/ccgg/trends/co2/co2_weekly_mlo.txt

>>> from mlo_co2 import weekly_mean
>>> mean = weekly_mean()
>>> mean.keys()
dict_keys(['url', 'license', 'description', 'headers', 'raw', 'data'])
>>> mean['data'].keys()
dict_keys(['yr', 'mon', 'day', 'decimal', 'ppm', '#days', '1 yr ago', '10 yr ago', 'since 1800'])

Metadata

Release files for mlo-co2 0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mlo-co2 0.4
File Size Uploaded Provenance Actions
mlo_co2-0.4.tar.gz 4.1 kB Without provenance Details for mlo_co2-0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mlo-co2 0.4
File Interpreter ABI Platform Actions
mlo_co2-0.4-py3-none-any.whl Python 3 none any Details for mlo_co2-0.4-py3-none-any.whl

Total release size: 10.3 kB

Release files / mlo_co2-0.4.tar.gz

Download URL mlo_co2-0.4.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a06bcac8800f44dbb57183fa9e79e5101974d986de6d9422a2769919efab0455
BLAKE2b-256 checksum
How to use checksums
3ebb57ccef5e9bfa3b2bb5c5a62e3e78c15f145c817841bb572adb67156b7239
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.1

Release files / mlo_co2-0.4-py3-none-any.whl

Download URL mlo_co2-0.4-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6770ef3078f11cba9596bf20bbed2b65c7c218298b3304375caaec1f3b295ac7
BLAKE2b-256 checksum
How to use checksums
3675e25f202b45d0eac8de33fa5c558121ba767e99b77844b564fddbfa8c356c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.1

Security for mlo-co2 0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page