Skip to main content

Simple api collector

Project description

pyllector

Modifided aiohttp.ClientSession. More Safety.

Instalation

pip install pyllector 

Example

from pyllector import ApiCollector
from models import HttpMethod, ContentType

import asyncio


async def main():
    api = ApiCollector('https://some-api.com/v2/', main_params={'some_api_key': 'some...'})
    data = await api.push('some_api_method',
                        content_type=ContentType.JSON,
                        http_method=HttpMethod.POST,
                        params={'some_method_param': 'some_value'},
                        )
    print(data['some keys'])


asyncio.run(main())

ApiCollector check allmost http errors, and repeat request limit times until he gets response, or will return None else limit is 0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyllector-0.0.3.2.tar.gz (2.6 kB view hashes)

Uploaded Source

Built Distribution

pyllector-0.0.3.2-py3-none-any.whl (3.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page