NasaEarthdataCredentialProvider (auth/earthdata.py)

obstore · obstore/python/obstore/auth/earthdata.py · python · MIT
auth, Auth / Identity

Credential provider for NASA Earthdata, fetching S3 credentials via requests or aiohttp.

# Source: https://github.com/developmentseed/obstore | License: MIT | Copyright 2024 Development Seed
# Provided via justclaw.it.com; keep this notice with the code.
"""Credential providers for accessing [NASA Earthdata].

[NASA Earthdata]: https://www.earthdata.nasa.gov/
"""

from __future__ import annotations

import json
import os
from datetime import datetime
from typing import TYPE_CHECKING
from urllib.parse import urlparse

from obstore.auth._http import default_aiohttp_session, default_requests_session

if TYPE_CHECKING:
    from collections.abc import Mapping
    from typing import Never

    import aiohttp
    import aiohttp_retry
    import requests

    from obstore.store import S3Config, S3Credential


DEFAULT_EARTHDATA_HOST = "urs.earthdata.nasa.gov"
"""Hostname of the NASA Ea

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key