From fcbde26dca8482de48e5846c5370a5ed38c04fbc Mon Sep 17 00:00:00 2001 From: Joseph H Kennedy Date: Tue, 12 May 2026 10:35:57 -0800 Subject: [PATCH] WIP: sketch out what a services plugin API might look like --- earthaccess/services/__init__.py | 0 earthaccess/services/harmony.py | 32 ++++++++++++++++++++++++++++++++ earthaccess/services/hyp3.py | 0 earthaccess/services/services.py | 0 4 files changed, 32 insertions(+) create mode 100644 earthaccess/services/__init__.py create mode 100644 earthaccess/services/harmony.py create mode 100644 earthaccess/services/hyp3.py create mode 100644 earthaccess/services/services.py diff --git a/earthaccess/services/__init__.py b/earthaccess/services/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/earthaccess/services/harmony.py b/earthaccess/services/harmony.py new file mode 100644 index 000000000..4f002b226 --- /dev/null +++ b/earthaccess/services/harmony.py @@ -0,0 +1,32 @@ +# import earthaccess as ea +# +# ea.login() +# +# results = ea.search_data(**params) +# job_id = ea.services.harmony.request(results, **kwargs) # internally the API will use only the concept-id and pass the kwargs +# status= ea.services.harmony.status(job_id) +# +# if status is "COMPLETED": # or an enum of it +# files = ea.services.harmony.results(job_id) +# +# ds = xr.open_mfdataset(files) +from enum import Enum + + +def request(results: list[dict], **kwargs) -> str: + """ + + Args: + results: Results from an earthaccess search + **kwargs: Stuff to give to harmony + + returns: + the harmony job_id for your request + """ + pass + +# TODO: Define enum for possible statuses +HyP3 = ['PENDING', 'RUNNING', 'SUCCEEDED', 'FAILED'] +Harmony = ['failed', 'cancelled', 'paused'] +def status(job_id) -> Enum['']: + pass diff --git a/earthaccess/services/hyp3.py b/earthaccess/services/hyp3.py new file mode 100644 index 000000000..e69de29bb diff --git a/earthaccess/services/services.py b/earthaccess/services/services.py new file mode 100644 index 000000000..e69de29bb