Feature request: add opendap/netcdf authorization to backend_kwargs in open_[mf]dataset
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.2k
- Forks
- 1.4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 14
Description
This is a paraphrase of a SO Q: https://stackoverflow.com/questions/66178846/read-in-authorized-opendap-url-using-xarray
Is your feature request related to a problem? Please describe.
I would like to use xarray to read data stored at UCAR's Research Data Archive. To access data you have to create an account with a username and password.
Describe the solution you'd like
url = ""https://rda.ucar.edu/thredds/dodsC/files/g/ds084.1/2020/20200101/gfs.0p25.2020010100.f000.grib2"
ds = xr.open_dataset(url, backend_kwargs={"auth": ("username", "password")})
Describe alternatives you've considered
You can read this file by create dot files in your home directory (https://stackoverflow.com/a/66179413/6046019)
Additional context
The idea of "auth" comes from siphon (https://unidata.github.io/siphon/latest/examples/Basic_Usage.html#sphx-glr-examples-basic-usage-py).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how open_dataset and open_mfdataset pass backend_kwargs to the backend, then compare the requested auth tuple with Siphon's authorization approach and the linked Stack Overflow context. Done means an authorized OPeNDAP/NetCDF URL can be opened with backend_kwargs containing credentials, including through the requested dataset-opening interfaces.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- authentication, data
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100