Skip to content

Commit

Permalink
Use the new JSON-API #8
Browse files Browse the repository at this point in the history
  • Loading branch information
kozo2 committed Aug 14, 2024
1 parent e6676b7 commit 7ba544b
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions pywikipathways/list_organisms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
from .utilities import *
import requests

def list_organisms():
res = wikipathways_get('listOrganisms', {'format': 'json'})
return res['organisms']
"""List Organisms.
Retrieve the list of organisms supported by WikiPathways
Returns:
list: A list of organisms
Example:
>>> list_organisms()
"""
res = requests.get("https://www.wikipathways.org/json/listOrganisms.json")
res.raise_for_status()
return res.json()['organisms']

0 comments on commit 7ba544b

Please sign in to comment.