Client library for NASA Earthdata APIs
Project description
earthdata 🌍
Client library for NASA CMR and EDL APIs
Overview
A Python library to search and access NASA datasets.
Installing earthdata
Install the latest release:
conda install -c conda-forge earthdata
Or you can clone earthdata
and get started locally
# ensure you have Poetry installed
pip install --user poetry
# install all dependencies (including dev)
poetry install
# develop!
Example Usage
from earthdata import Auth, DataGranules, DataCollections, Store
auth = Auth().login() # if we want to access NASA DATA in the cloud
# To search for collecrtions (datasets)
DatasetQuery = DataCollections().keyword('MODIS').bounding_box(-26.85,62.65,-11.86,67.08)
counts = DatasetQuery.hits()
collections = DatasetQuery.get()
# To search for granules (data files)
GranuleQuery = DataGranules().concept_id('C1711961296-LPCLOUD').bounding_box(-10,20,10,50)
# number of granules (data files) that matched our criteria
counts = GranuleQuery.hits()
# We get the metadata
granules = GranuleQuery.get(10)
# earthdata provides some convenience functions for each data granule
data_links = [granule.data_links() for granule in granules]
# The Store class allows to get the granules from on-prem locations with get()
# NOTE: Some datasets require users to accept a Licence Agreement before accessing them
store = Store(auth)
# This works with both, on-prem or cloud based collections**
store.get(granules, local_path='./data')
# if you're in a AWS instance (us-west-2) you can use open() to get a fileset!
fileset = store.open(granules)
# Given that this is gridded data we could
xarray.open_mfdataset(fileset, combine='by_coords')
For more examples see the Demo
and EarthdataSearch
notebooks.
Only Python 3.7+ is supported as required by the black, pydantic packages
Code of Conduct
See Code of Conduct
Level of Support
- This repository is not actively supported by NSIDC but we welcome issue submissions and pull requests in order to foster community contribution.
Contributing Guide
Welcome! 😊👋
Please see the Contributing Guide.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
earthdata-0.2.0.tar.gz
(39.3 kB
view hashes)
Built Distribution
earthdata-0.2.0-py3-none-any.whl
(39.7 kB
view hashes)
Close
Hashes for earthdata-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e228d2da7ae291a4f19ed2dde13e7e198f4fbc22132bc04ba5eb6651e630448c |
|
MD5 | dc64387c8bbc5066469632901d579a54 |
|
BLAKE2b-256 | 818e1c4fbe19f83e1d43ab2c738e960de44c3a3a4f9710333b5d38a6957696b4 |