Skip to content

Commit

Permalink
Update Aragorn kp script to not use kp registry
Browse files Browse the repository at this point in the history
  • Loading branch information
maximusunc committed Oct 10, 2024
1 parent 223d0a1 commit 882e2c1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
29 changes: 15 additions & 14 deletions src/information_resource_registry/relation_map/aragorn_kps.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
import asyncio
import requests
import json
from kp_registry import Registry

infores_dict = {"infores:aragorn": []}


async def main():
registry = Registry()
def main():
url = "https://strider.renci.org/kps"
response = requests.get(url)

kps = await registry.retrieve_kps()
if response.status_code == 200:
try:
kps = response.json()

for kp in kps.values():
if kp.get("maturity") == "staging":
infores_dict["infores:aragorn"].append(kp.get("infores", "Unknown"))

# Sort the list in alphabetical order
infores_dict['infores:aragorn'].sort()
infores_dict["infores:aragorn"] = kps

with open('src/information_resource_registry/relation_map/data/aragorn_to_kps.json', 'w') as outfile:
json.dump(infores_dict, outfile, indent=2, sort_keys=True)
with open('src/information_resource_registry/relation_map/data/aragorn_to_kps.json', 'w') as outfile:
json.dump(infores_dict, outfile, indent=2, sort_keys=True)
except Exception as e:
print(f"Failed to parse list of KPs from Aragorn: {e}")
else:
print(f"Failed to download list of KPs from Aragorn with status code: {response.status_code}.")

if __name__ == "__main__":
asyncio.run(main())
main()
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"infores:automat-cam-kp",
"infores:automat-ctd",
"infores:automat-drug-central",
"infores:automat-ehr-may-treat-kp",
"infores:automat-genome-alliance",
"infores:automat-gtex",
"infores:automat-gtopdb",
Expand All @@ -23,7 +24,6 @@
"infores:automat-ubergraph",
"infores:automat-viral-proteome",
"infores:cohd",
"infores:connections-hypothesis",
"infores:gelinea",
"infores:genetics-data-provider",
"infores:knowledge-collaboratory",
Expand Down

0 comments on commit 882e2c1

Please sign in to comment.