Skip to content

csda-client

csda-client is a Python client for interacting with NASA's Commercial Satellite Data Acquisition (CSDA) APIs.

Quickstart

Install csda-client via pip:

python -m pip install git+https://github.com/NASA-IMPACT/csda-client

Note

csda-client is not yet available via PyPI, but we plan to publish it there soon.

Then:

from csda_client import CsdaClient
from httpx import BasicAuth

auth = BasicAuth(username="your-earthdata-username", password="your-earthdata-password")
client = CsdaClient.open(auth)
client.verify()

See our search and download notebook for an example of finding and downloading data from the CSDA system.

Authentication

We use httpx authentication to verify your Earthdata login credentials, which we use for CSDA API access. You can use BasicAuth as demonstrated above, but we recommend setting up .netrc authentication to avoid putting your password in code. To set up .netrc:

  1. Follow the instructions here
  2. Provide a NetrcAuth to CsdaClient.open:

    from csda_client import CsdaClient
    from https import NetrcAuth
    
    client = CsdaClient.open(NetrcAuth())