Download mcp/ensembl.py from mgbam/MCP_Res: direct link, hf CLI and curl.
- Browser
- Download file 363 Bytes
-
https://huggingface.co/spaces/mgbam/MCP_Res/resolve/d3ef28f09426c4c4300a38bc46fb3ffa674e48c8/mcp/ensembl.py
- Command line
-
hf download hf://spaces/mgbam/MCP_Res@d3ef28f09426c4c4300a38bc46fb3ffa674e48c8/mcp/ensembl.py
-
curl -L -o ensembl.py https://huggingface.co/spaces/mgbam/MCP_Res/resolve/d3ef28f09426c4c4300a38bc46fb3ffa674e48c8/mcp/ensembl.py
363 Bytes
| import httpx | |
| from functools import lru_cache | |
| _URL = "https://rest.ensembl.org/xrefs/symbol/homo_sapiens/{}?content-type=application/json" | |
| async def fetch_ensembl(sym: str): | |
| async with httpx.AsyncClient(timeout=8) as c: | |
| r = await c.get(_URL.format(sym)) | |
| return r.json()[0] if r.status_code == 200 and r.json() else {} | |