ecmwf / earthkit-data

A format-agnostic Python interface for geospatial data
Apache License 2.0
50 stars 9 forks source link

Implement Amazon S3 bucket source #223

Open sandorkertesz opened 9 months ago

sandorkertesz commented 9 months ago

Still work in progress.

The new source for an S3 bucket can be used like this:

import earthkit.data

# endpoint="s3.amazonaws.com"
bucket_name = "ecmwf-forecasts"
key = "20240111/00z/0p4-beta/oper/20240111000000-0h-oper-fc.grib2"

r = {"bucket": bucket_name, 
     "objects": [
         {"object":  key} 
          ],
   }

ds = earthkit.data.from_source("s3", r, stream=False, anon=True)
ds.ls()

More examples are available at: https://earthkit-data.readthedocs.io/en/feature-s3/examples/s3.html

r = {"bucket": bucket_name, 
      "endpoint": "my_endpoint",
     "objects": [
     ....
corentincarton commented 1 month ago

Tagging @chpolste as he could be interested by this for CLIMAAX.