Skip to content

NASA Earthdata

obstore.auth.earthdata.NasaEarthdataCredentialProvider

A credential provider for accessing NASA Earthdata to be used with S3Store.

This credential provider uses requests, and will error if that cannot be imported.

NASA Earthdata supports public in-region direct S3 access. This credential provider automatically manages the S3 credentials.

Note

Note that you must be in the same AWS region (us-west-2) to use the credentials returned from this provider.

Example:

from obstore.auth.earthdata import NasaEarthdataCredentialProvider
from obstore.store import S3Store

credential_provider = NasaEarthdataCredentialProvider(username="...", password="...")
store = S3Store("bucket_name", credential_provider=credential_provider)

__init__

__init__(username: str, password: str) -> None

Create a new NasaEarthdataCredentialProvider.

Parameters:

  • username (str) –

    Username to NASA Earthdata.

  • password (str) –

    Password to NASA Earthdata.

__call__

__call__() -> S3Credential

Request updated credentials.

close

close() -> None

Close the underlying session.

You should call this method after you've finished all obstore calls to close the underlying requests.Session.

obstore.auth.earthdata.NasaEarthdataAsyncCredentialProvider

An async credential provider for accessing NASA Earthdata to be used with S3Store.

This credential provider should be preferred over the synchronous NasaEarthdataCredentialProvider whenever you're using async obstore methods.

This credential provider uses aiohttp, and will error if that cannot be imported.

NASA Earthdata supports public in-region direct S3 access. This credential provider automatically manages the S3 credentials.

Note

Note that you must be in the same AWS region (us-west-2) to use the credentials returned from this provider.

Example:

from obstore.auth.earthdata import NasaEarthdataAsyncCredentialProvider
from obstore.store import S3Store

credential_provider = NasaEarthdataAsyncCredentialProvider(
    username="...",
    password="...",
)
store = S3Store("bucket_name", credential_provider=credential_provider)

__init__

__init__(username: str, password: str) -> None

Create a new NasaEarthdataAsyncCredentialProvider.

Parameters:

  • username (str) –

    Username to NASA Earthdata.

  • password (str) –

    Password to NASA Earthdata.

__call__ async

__call__() -> S3Credential

Request updated credentials.

close async

close() -> None

Close the underlying session.

You should call this method after you've finished all obstore calls to close the underlying aiohttp.ClientSession.