Skip to content

Commit

Permalink
Remove excess API call
Browse files Browse the repository at this point in the history
  • Loading branch information
caufieldjh committed Sep 5, 2024
1 parent 1eb2dc1 commit a044180
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/kg_bioportal/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,12 @@ def get_ontology_list(self) -> None:
with open(f"{self.output_dir}/{ONTOLOGY_LIST_NAME}", "w") as outfile:
outfile.write(f"id\tname\tcurrent_version\tsubmission_id\n")
for acronym in ontologies:
metadata_url = f"https://data.bioontology.org/ontologies/{acronym}"
metadata = requests.get(metadata_url, headers=headers).json()
latest_submission_url = f"https://data.bioontology.org/ontologies/{acronym}/latest_submission"
latest_submission = requests.get(
latest_submission_url, headers=headers
).json()

name = metadata["name"].replace("\n", " ").replace("\t", " ")
name = latest_submission["ontology"]["name"].replace("\n", " ").replace("\t", " ")
if len(latest_submission) > 0:
if latest_submission["version"]:
current_version = " ".join(
Expand Down

0 comments on commit a044180

Please sign in to comment.