Skip to content

Commit

Permalink
Re-write get_capabilities to use harmony-py
Browse files Browse the repository at this point in the history
  • Loading branch information
trey-stafford committed Oct 31, 2024
1 parent 77ad92c commit 6d9a660
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions icepyx/core/harmony.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
from typing import Any

import requests

from icepyx.core.urls import CAPABILITIES_BASE_URL
import harmony


def get_capabilities(concept_id: str) -> dict[str, Any]:
response = requests.get(
CAPABILITIES_BASE_URL,
params={"collectionId": concept_id},
)
return response.json()
capabilities_request = harmony.CapabilitiesRequest(concept_id=concept_id)
# TODO: This will work if the user has a .netrc file available but the other
# auth options might fail. We might need to add harmony client auth to the
# icepyx auth package.
harmony_client = harmony.Client()
response = harmony_client.submit(capabilities_request)

return response

0 comments on commit 6d9a660

Please sign in to comment.