PK!hygge/__init__.py__version__ = '0.1.2' PK!oLW hygge/get.pyimport aiohttp import asyncio class GetResponse: '''Async response to get json response ```python from hygge.get import GetResponse url = 'https://www.trustpilot.com/businessunit/search' params = {'country': 'dk', 'query': 'mate.bike'} res = GetResponse(url).get(params=params) info_url = f'https://www.trustpilot.com/businessunit/{res["businessUnits"][0]["id"]}/companyinfobox' print(GetResponse(info_url).get()) ``` ''' def __init__(self, url): self.url = url async def fetch(self, session, **kwargs): async with session.get(self.url, **kwargs) as response: return await response.json() async def get_data(self, **kwargs): async with aiohttp.ClientSession() as session: return await self.fetch(session, **kwargs) def get(self, **kwargs): loop = asyncio.get_event_loop() return loop.run_until_complete(self.get_data(**kwargs)) PK!H,TThygge-0.1.3.dist-info/WHEEL 1 0 =Rn>ZD:_dhRUQTk-k]m`Q'iPK!H hygge-0.1.3.dist-info/METADATAT]o8}]rt- RD]*ty*pi@wq/[@"d29οHRymMHuC35/v}+^ ]ܔ3(2ӒjP#PL8kI<YVkjBˎ%~E Dыo F*ɯx6Pc]NMnVpsm}Lc:Dq}5H'<ە׏*F9ajk|`˰"?ɻf]xy m Ipá^1. zB$=A%2${uki&T0H)\$si\!WLJ;rSCR]&kH_;E( }ɧ8ެP8[>ȇÜ禷.9sX,Ƚx[ENZrִS2طl?r۳6t!8?9?[jq)^).ur mё*3PK!H̗Uhygge-0.1.3.dist-info/RECORDurC@{a)rAY#E )o}_6MRc^WL28o47kSBQ{d\`}99 o_BYLL-O4xSŠ+ƐwŰ^m"' PvwC=n0-|SvצUx(\R;4aR(ngaxAmp,7ʳԆ(Y$oq}Og$GU 6?PK!hygge/__init__.pyPK!oLW Fhygge/get.pyPK!H,TT\hygge-0.1.3.dist-info/WHEELPK!H hygge-0.1.3.dist-info/METADATAPK!H̗U0hygge-0.1.3.dist-info/RECORDPKX_