v0.5.0
This release will fix some bugs and bring new capabilities to the top level API
import earthaccess
auth = earthaccess.login()
will automatically try all strategies, there is no need to specify one, if our credentials are not found it will ask the user to provide them interactively.
s3_credentials = earthaccess.get_s3_credentials(daac="PODAAC")
# use them with your fav library, e.g. boto3
# another thing we can do with our auth instance is to refresh our EDL tokens
auth.refresh_tokens()
We can also get authenticated fsspec sessions:
url = "https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/EMITL2ARFL.001/EMIT_L2A_RFL_001_20220903T163129_2224611_012/EMIT_L2A_RFL_001_20220903T163129_2224611_012.nc"
fs = earthaccess.get_fsspec_https_session()
with fs.open(lpcloud_url) as f:
data = f.read(10)
data
or we can use them in tandem with xarray/rioxarray
import xarray as xr
ds = xr.open_mfdataset(earthaccess.open([url]))
ds