aiohttpmap

Asynchronously handle bulk http requests.


License
MIT
Install
pip install aiohttpmap==0.2.0

Documentation

PyPI

Aiohttpmap

Bulk asynchronous processing of URLs using the aiohttp package.

Installation

pip install aiohttpmap

Example

import asyncio
from aiohttpmap import AiohttpMap

urls = ['https://api.-placeholder-.com/endpoint']*10

loop = asyncio.get_event_loop()
try:
    results = loop.run_until_complete(AiohttpMap().map(urls, request_type='get'))
finally:
    loop.close()

Example with authentication header.

import asyncio
from aiohttpmap import AiohttpMap

urls = ['https://api.-placeholder-.com/endpoint']*10
auth_header = {'Authorization': 'token...'}

loop = asyncio.get_event_loop()
try:
    results = loop.run_until_complete(AiohttpMap().map(urls, request_type='get', headers=auth_header))
finally:
    loop.close()