Download mcp/who.py from mgbam/MCP_Res: direct link, hf CLI and curl.
- Browser
- Download file 468 Bytes
-
https://huggingface.co/spaces/mgbam/MCP_Res/resolve/392591064f42dbd2d1f5bde48d8f2eb2c2bbfd0f/mcp/who.py
- Command line
-
hf download hf://spaces/mgbam/MCP_Res@392591064f42dbd2d1f5bde48d8f2eb2c2bbfd0f/mcp/who.py
-
curl -L -o who.py https://huggingface.co/spaces/mgbam/MCP_Res/resolve/392591064f42dbd2d1f5bde48d8f2eb2c2bbfd0f/mcp/who.py
468 Bytes
| # mcp/who.py | |
| """ | |
| WHO Global Health Observatory (GHO) OData API helper. | |
| Example: fetch essential medicines list or Covid stats. | |
| """ | |
| import httpx | |
| from typing import Dict, List | |
| BASE = "https://ghoapi.azureedge.net/api" | |
| async def list_essential_medicines() -> List[Dict]: | |
| url = f"{BASE}/EML" | |
| async with httpx.AsyncClient(timeout=20) as client: | |
| r = await client.get(url) | |
| r.raise_for_status() | |
| return r.json()["value"] # list of medicines | |