Skip to main content

Client library for NASA Earthdata APIs

Project description

earthdata 🌍

Client library for NASA CMR and EDL APIs

Test Publish Package version Python Versions Code style: black Documentation link

Overview

Binder

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(strategy="netrc") # 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(access="direct") for granule in granules]

# or if the data is an on-prem dataset

data_links = [granule.data_links(access="onprem") 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 of S3 files!
fileset = store.open(granules)

# Given that this is gridded data (Level 3 or up) we could
xarray.open_mfdataset(fileset, combine='by_coords')

For more examples see the Demo and EarthdataSearch notebooks.

Only Python 3.8+ is supported.

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.

Contributors

Contributors

Contributing Guide

Welcome! 😊👋

Please see the Contributing Guide.

Project details


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.4.0.tar.gz (41.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

earthdata-0.4.0-py3-none-any.whl (42.1 kB view details)

Uploaded Python 3

File details

Details for the file earthdata-0.4.0.tar.gz.

File metadata

  • Download URL: earthdata-0.4.0.tar.gz
  • Upload date:
  • Size: 41.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.9.6 Linux/5.15.0-1017-azure

File hashes

Hashes for earthdata-0.4.0.tar.gz
Algorithm Hash digest
SHA256 23c8d2eabc508300a0e3a36749d52178685953a7e2fc2f209bd221823adcd0cf
MD5 58feaf410c11cdc54d15eda77d3ebb40
BLAKE2b-256 76b740f292085710cf60c1c4ea1a55b02433d87903370cea97623ab5ed49f8c0

See more details on using hashes here.

File details

Details for the file earthdata-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: earthdata-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 42.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.9.6 Linux/5.15.0-1017-azure

File hashes

Hashes for earthdata-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e27d58c41ebd447465b9c5c7d461a15276eacdb77b46d829e02162aa3c0345ac
MD5 d54573b3e88b4500a4461ac9b96435aa
BLAKE2b-256 5d9a772657b0884db718238d291965e095cb183c946ce11f34cbe4dd739e4648

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page