Open Radar Data
raw JSON → 0.7.0 verified Mon Apr 27 auth: no python
Provides utility functions for accessing the open radar data repository for examples and notebooks. Current version 0.7.0, requires Python >=3.9.
pip install open-radar-data Common errors
error AttributeError: module 'open_radar_data' has no attribute 'datasets' ↓
cause Importing the package without submodule fails because datasets is a submodule.
fix
Use 'from open_radar_data import datasets'
error TypeError: cannot unpack non-iterable str object ↓
cause The fetch() function used to return two values (< v0.7.0) but now returns a single string.
fix
Change code from 'path, filename = datasets.fetch(...)' to 'path = datasets.fetch(...)'
error ValueError: Dataset 'nexrad_level2_example' not found ↓
cause Dataset name is case-sensitive or not a valid key. Check list_datasets() for exact names.
fix
Run datasets.list_datasets() to see available dataset names and use an exact match.
Warnings
breaking In version 0.7.0 the fetch() function changed from returning a tuple (path, filename) to returning a string path. Code using unpacking will break. ↓
fix Update callers to expect a single string: file_path = datasets.fetch('dataset_name')
deprecated The function 'get_path()' is deprecated in favor of 'fetch()' and may be removed in a future release. ↓
fix Replace datasets.get_path('name') with datasets.fetch('name')
gotcha Some datasets require internet access to download. The library does not cache aggressively; repeated calls may re-download. ↓
fix Manually cache the returned path or set environment variable OPEN_RADAR_DATA_CACHE_DIR to a persistent directory.
Imports
- open_radar_data wrong
import open_radar_datacorrectfrom open_radar_data import datasets
Quickstart
from open_radar_data import datasets
# List available datasets
datasets.list_datasets()
# Download a dataset (returns path to downloaded file)
file_path = datasets.fetch('nexrad_level2_example')
print(file_path)