Skip to main content

Load `U.S. Climate Reference Network <https://www.ncei.noaa.gov/access/crn/>`__ (USCRN) data.

Project description

uscrn

Easily load U.S. Climate Reference Network (USCRN) data.

Version on PyPI CI status Documentation status Test coverage pre-commit.ci status Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.

With uscrn, fetching and loading years of data for all USCRN sites[^a] takes just one line of code[^b].

Example:

import uscrn

df = uscrn.get_data(2019, "hourly", n_jobs=6)  # pandas.DataFrame

ds = uscrn.to_xarray(df)  # xarray.Dataset, with soil depth dimension if applicable (hourly, daily)

Both df (pandas) and ds (xarray) include dataset and variable metadata. For df, these are in df.attrs and can be preserved by writing to Parquet with the PyArrow engine with pandas v2.1+.

df.to_parquet("uscrn_2019_hourly.parquet", engine="pyarrow")

Conda install example[^c]:

conda create -n crn -c conda-forge python=3.10 joblib numpy pandas pyyaml requests xarray pyarrow netcdf4
conda activate crn
pip install --no-deps uscrn

[^a]: Use uscrn.load_meta() to load the site metadata table. [^b]: Not counting the import statement... [^c]: uscrn is not yet on conda-forge.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uscrn-0.1.0b4.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

uscrn-0.1.0b4-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file uscrn-0.1.0b4.tar.gz.

File metadata

  • Download URL: uscrn-0.1.0b4.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for uscrn-0.1.0b4.tar.gz
Algorithm Hash digest
SHA256 9f8562d3d4143e91cd1660f6815f119f3b8f4eeeb9b5e4cf3e37392f38b10dda
MD5 328d5e250a25c3d1a06897026ca7c3d7
BLAKE2b-256 b689de006a6bba73e29479e3675f7fea438b1c3f31ac7cdb827549c4d3cc1b31

See more details on using hashes here.

Provenance

File details

Details for the file uscrn-0.1.0b4-py3-none-any.whl.

File metadata

  • Download URL: uscrn-0.1.0b4-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for uscrn-0.1.0b4-py3-none-any.whl
Algorithm Hash digest
SHA256 5620fe591ba43301fbaa319e1b6b515e275effaa3730fe676707e8d184199c07
MD5 62b14675bb9fe4d043ed6ede606f20f2
BLAKE2b-256 193a5686b64d797dc0b5b3a6233576755070d7fe9bd621949f71f3dd6e9a2259

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page