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.2.dist-info/WHEEL 1 0 =Rn>ZD:_dhRUQTk-k]m`Q'iPK!Hu<g:hygge-0.1.2.dist-info/METADATATO0T>"@Iib!s|=]~SxJ&m1/1ynG&U%7M{ǦijހS[$ZIl62%UeCs9m8΅Wi2>5ae]q8RŘaS+3]]١o`/{9lr' 4NCk֝AG?PK!Ht]Uhygge-0.1.2.dist-info/RECORDuMr0@g! ,(H7vuq/We/?giiLlwuzO!d[~2q1|BivEЙ $nj(VL{ r!~ z*EVe(82q1旅 jK˛YN{oln!HhG5RcbH 0E莚 &P]Ta@<ES\Ҷj%#IPK!hygge/__init__.pyPK!oLW Fhygge/get.pyPK!H,TT\hygge-0.1.2.dist-info/WHEELPK!Hu<g:hygge-0.1.2.dist-info/METADATAPK!Ht]Uhygge-0.1.2.dist-info/RECORDPKX