usdata
Unified Python SDK and CLI for discovering, fetching, and tracking the provenance of U.S. public scientific data (NOAA, USGS, NASA, and more).
Status: pre-alpha. v0.5 supports GHCN-Daily, NEXRAD Level II, USGS daily values, and CoastWatch SST subsets with provenance, plus Census state/county lookup. Other datasets are planned. See docs/roadmap.md.
Providers
| Provider | Available | Stub | Planned | Next up (0.6) | Datasets |
|---|---|---|---|---|---|
| NOAA | 3 | 0 | 26 | gfs, hrrr, oisst, etopo |
ghcn-daily, nexrad-level2, coastwatch-sst, +26 planned |
| USGS | 1 | 0 | 2 | — | water-daily, +2 planned |
| Census Bureau | 0 | 0 | 1 | — | +1 planned |
| EPA | 0 | 0 | 1 | — | +1 planned |
| FEMA | 0 | 0 | 1 | — | +1 planned |
| NASA | 0 | 0 | 1 | gpm-imerg |
+1 planned |
| USDA | 0 | 0 | 1 | — | +1 planned |
Available datasets are in code, stubs in italics; planned ones are counted. Available means implemented in this source checkout; consult the releases for published support. Each provider page has access notes and full dataset details; docs/roadmap.md lists datasets by target version.
Install
pip install usdata # or: uv add usdata
Usage
from usdata import build_query, get, search
from usdata.fetch import fetch
for r in search("precipitation", location="Oklahoma"):
print(r.dataset.id, r.dataset.title)
ds = get("noaa:ghcn-daily")
query = build_query(
lat=35.39,
lon=-97.60,
radius_km=15,
start="2024-05-06",
end="2024-05-07",
variables=["PRCP", "TMAX"],
)
for item in fetch(ds, query):
print(item.path, item.provenance.checksum)
usdata search "tornado radar" --state OK
usdata search precipitation --location "Cleveland County, OK"
usdata info noaa:ghcn-daily
usdata fetch noaa:ghcn-daily --lat 35.39 --lon -97.60 --radius-km 15 \
--start 2024-05-06 --end 2024-05-07 --vars PRCP,TMAX
usdata fetch noaa:ghcn-daily -p stations=USW00013967 --start 2024-01-01 --end 2024-12-31
usdata fetch noaa:nexrad-level2 --lat 35.47 --lon -97.52 \
--start 2024-05-06T20:00 --end 2024-05-06T23:00 # nearest radar (KTLX)
usdata fetch noaa:nexrad-level2 -p site=KTLX --start 2024-05-06T20:00 --end 2024-05-06T20:30 --dry-run
usdata fetch usgs:water-daily -p sites=07164500 --vars 00060 \
--start 2024-05-06 --end 2024-05-07
usdata fetch noaa:coastwatch-sst --bbox=-80.08,30.02,-80.02,30.08 \
--start 2024-05-06T12:00Z --end 2024-05-06T12:00Z # four grid cells
usdata pull dataset.yaml # resolve, fetch, write dataset.lock.json
usdata verify dataset.yaml # exit 1 if any cached input drifted
Fetched files land in ~/.cache/usdata/<provider>/<dataset>/ (override with
USDATA_CACHE_DIR or --cache-dir), each with a .provenance.json sidecar
recording source URL, retrieval time, checksum, size, and license.
Locations accept state names/postal codes, county/state names, and quoted FIPS codes. These select bounding rectangles; see place lookup for coverage, ambiguity, and antimeridian limits. CoastWatch CSV includes a second header row containing units; see its access notes.
Manifest and source fields are validated strictly; unknown fields are errors.
Provider-specific options belong under params.
A manifest declares every input a project needs. pull resolves each source,
fetches it, and writes dataset.lock.json pinning every asset with its checksum
and provenance. A second pull restores exactly what the lockfile pins without
re-querying upstream, so the inputs stay reproducible even if the source
changes. verify checks the manifest checksum and re-hashes cached files
against the lockfile. Editing the manifest after locking requires pull --force
to re-resolve. A required source matching no assets fails the pull; set
allow_empty: true on a source only when an empty result is intentional.
Checksums detect upstream changes; they cannot recover historical bytes that are no longer available. Preserve the cache for long-lived reproducibility. See the manifest reference and the small NOAA/USGS example.
name: tornado-environment
sources:
- dataset: noaa:nexrad-level2
location: oklahoma
start: 2024-05-06
end: 2024-05-07
- dataset: noaa:ghcn-daily
location: oklahoma
start: 2024-05-01
end: 2024-05-31
Development
git clone https://github.com/jakeryderv/usdata && cd usdata
just setup # install toolchain and dependencies
just test # unit tests
just check # format, lint, typecheck, offline tests, generated docs
just build # build wheel and sdist
just smoke # install and exercise the built wheel outside the checkout
just run search radar
Unit tests mechanically block network connections. Integration tests that hit
live services run with just test-integration. CI checks Python 3.11 and 3.14 on
Linux and smoke-tests the installed wheel on Linux, macOS, and Windows. The
full unit and live-service suites currently run on Linux.
Releases: just release minor opens a version-bump PR; merging it publishes
to PyPI and creates the tag and GitHub release. See
docs/versioning.md.
See docs/providers/ for per-provider access notes, docs/architecture.md for how the pieces fit, docs/adr/ for why, and CONTRIBUTING.md to add a dataset.
License
Apache-2.0
Release files for usdata 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| usdata-0.5.0.tar.gz | 145.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| usdata-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 302.4 kB
Release files / usdata-0.5.0.tar.gz
| Download URL | usdata-0.5.0.tar.gz |
|---|---|
| Size | 145.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2e551c0eaa1e688bce886e68c333390e520c8e481203ea8010f5d9567b9e8c19
|
|
BLAKE2b-256 checksum How to use checksums |
da002bca771f2722494396bda3e75a93ab53dea95dec51d3b63e55b84d99d5a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / usdata-0.5.0-py3-none-any.whl
| Download URL | usdata-0.5.0-py3-none-any.whl |
|---|---|
| Size | 156.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d8ecb900b678f092b87d436c326c80f6bb393e405fd5ac95429d15c8b6ecf210
|
|
BLAKE2b-256 checksum How to use checksums |
9e8959ab0fc69c3722d244df77fe1295f11f0f09121bde1e0f0c5837b724c148
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|