We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
get_capabilities
harmony-py
1 parent 77ad92c commit 6d9a660Copy full SHA for 6d9a660
icepyx/core/harmony.py
@@ -1,13 +1,14 @@
1
from typing import Any
2
3
-import requests
4
-
5
-from icepyx.core.urls import CAPABILITIES_BASE_URL
+import harmony
6
7
8
def get_capabilities(concept_id: str) -> dict[str, Any]:
9
- response = requests.get(
10
- CAPABILITIES_BASE_URL,
11
- params={"collectionId": concept_id},
12
- )
13
- 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)
+
14
+ return response
0 commit comments