Skip to main content

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 sites1 takes just one line of code2.

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 engine3 with pandas v2.1+.

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

Conda install example4:

conda create -n crn -c conda-forge python=3.11 joblib numpy pandas pyyaml requests xarray pyarrow netcdf4
conda activate crn
pip install --no-deps uscrn
  1. Use uscrn.load_meta() to load the site metadata table. ↩

  2. Not counting the import statement... ↩

  3. Or the fastparquet engine with fastparquet v2024.2.0+. ↩

  4. uscrn is not yet on conda-forge. ↩

Metadata

Release files for uscrn 0.2.0

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

Source distribution (sdist)

Source distribution for uscrn 0.2.0
File Size Uploaded
uscrn-0.2.0.tar.gz 21.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for uscrn 0.2.0
File Interpreter ABI Platform
uscrn-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 42.3 kB

Release files / uscrn-0.2.0.tar.gz

Download URL uscrn-0.2.0.tar.gz
Size 21.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a8cd00d8d079cdb3e78e0df37a1a040bf2ff79e613bf74b5fc8a237ede6ecfaf
BLAKE2b-256 checksum
How to use checksums
2cd1fd185f3256acfe1255b2bf34c121e42281b0be4fd5b62f4e3b63995c5dc7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release files / uscrn-0.2.0-py3-none-any.whl

Download URL uscrn-0.2.0-py3-none-any.whl
Size 21.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bef12dd3a6ce19e2beca99a0cf94332cdd6a8a39897a4e0b549d3ee9483f7fce
BLAKE2b-256 checksum
How to use checksums
8f81e41366e41b9acc79dde8c29e2519a11dbea4b2b812cb68244debf182224c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0
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