File size: 329 Bytes
830595a
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
import httpx
from functools import lru_cache

_URL = "https://www.ebi.ac.uk/gxa/json/expressionSummary?geneQuery={}"

@lru_cache(maxsize=512)
async def fetch_expression(sym: str):
    async with httpx.AsyncClient(timeout=10) as c:
        r = await c.get(_URL.format(sym))
        return r.json() if r.status_code == 200 else {}