Skip to main content
https://codecov.io/gh/night-crawler/async-fetcher/branch/master/graph/badge.svg https://travis-ci.org/night-crawler/async-fetcher.svg?branch=master https://img.shields.io/pypi/v/async-fetcher.svg PyPI Wheel Requirements Status Supported versions Supported implementations

Installation

pip install async-fetcher
# or
pip install -e git+https://github.com/night-crawler/async-fetcher.git@#egg=async-fetcher

Sample

af = AsyncFetch({
    'first': AsyncFetch.mk_task(build_url('request-info')),
    'second': AsyncFetch.mk_task('http://example.com/'),
    'fail': AsyncFetch.mk_task(build_url('404'))
})
responses = af.go()

mk_task static method can take this arguments:

:param fail_silently: bool, do not raise exceptions, default is False;
    for test purpose, do not use in production
:param num_retries: int, *optional*, default is -1; -1 - no retries; 0 - use AsyncFetch.num_retries
:param autodetect_content_type: if no `content-type` header was specified, set `content-type` as
    `application/json` for dict, and `text/html` otherwise; default is True
:param json_encoder: JSONEncoder, *optional*, JSON encoder for data serialization
    tries to use DRF's encoder, or default JSONEncoder from json package; default is JSONEncoder
:param url: str, *required*, url address
:param api_key: str, optional API key passed into HEADERS dict
:param data: dict, *optional*, request data. Default is None,
:param method: str, *optional*, HTTP request method. Default is True.
:param headers: dict, *optional*, optional HTTP headers
:param response_type: str, *optional*, HTTP response type
    (in fact it's just aiohttp's method name, i.e. text, or json); default is 'json'
:param language_code: str, set `accept-language` header
:param timeout: float, *optional*, time to wait for response in seconds before TimeoutError
:param query: dict, *optional*, url get arguments
:param do_not_wait: bool, *optional*, fail silently with no retries and empty resultset
af0 = AsyncFetch({})
tcp_connector = af0.get_tcp_connector()

af1 = AsyncFetch({
    '1': AsyncFetch.mk_task(build_url('request-info')),
    '2': AsyncFetch.mk_task(build_url('request-info')),
}, tcp_connector=tcp_connector)
responses = af1.go()

Release files for async-fetcher 0.3.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for async-fetcher 0.3.6
File Size Uploaded
async-fetcher-0.3.6.tar.gz 9.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for async-fetcher 0.3.6
File Interpreter ABI Platform
async_fetcher-0.3.6-py3-none-any.whl Python 3 none any Details

Total release size:21.1 kB

Release files / async-fetcher-0.3.6.tar.gz

Download URL async-fetcher-0.3.6.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
054717b2158494e121f04f525d26d9d6ce48161a351bc725b6fed2279aa9c591
BLAKE2b-256 checksum
How to use checksums
de13c8fc375618da93acfc66616543f8113a434c4273d5038a0a94a884c3194d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.6

Release files / async_fetcher-0.3.6-py3-none-any.whl

Download URL async_fetcher-0.3.6-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1e8ddf28a9215e36f9ae0e4e3c53747ef078fef426985c46fab5d9eb79b398f
BLAKE2b-256 checksum
How to use checksums
882b7d312a0d0385cbbeff7c61bee451be435f8d88b11f865111effa560fb20a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.6

Release history Release notifications | RSS feed

This release

0.3.6 This release

2 release files

0.3.4

2 release files

0.3.1

2 release files

0.3.0

1 release file

0.2.2

2 release files

0.2.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page