Skip to main content

Asynchronous downloads

Project description

aiodownloads

Asynchronous downloads

Installation

pip install aiodownloads

Usage

Inherit aiodownloads.Downloader then override handle_success, handle_fail methods

Examples

  • Download list of urls
import asyncio

from aiodownloads import Downloader

urls = [
    'https://httpbin.org/status/200',
    'https://httpbin.org/status/400'
]
class UrlsDownloader(Downloader):

    async def handle_success(self, resp, item):
        content = await resp.read()
        # save content stuff

    async def handle_fail(self, resp, item):
        ...

url_downloader = UrlsDownloader()
asyncio.run(url_downloader.download(urls))

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

aiodownloads-0.2.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aiodownloads-0.2.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file aiodownloads-0.2.0.tar.gz.

File metadata

  • Download URL: aiodownloads-0.2.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/21.8.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.6

File hashes

Hashes for aiodownloads-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e7d94682ffc32b2534dc9efc4527aa80c848c638f6c57993837d7f9eb5425aa2
MD5 b57883e33e273187de45d9c40cef9447
BLAKE2b-256 7e99c437debb0adf7c97ccc8cbfa4ccdf946ef694565915276b07e2d4ada0442

See more details on using hashes here.

File details

Details for the file aiodownloads-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: aiodownloads-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/21.8.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.6

File hashes

Hashes for aiodownloads-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 acd0c5d2595dcff11375210440c0138a04be5263eeb844f09bf212fd728f44c4
MD5 34ed1ef906e1be570e84c001c003d3cf
BLAKE2b-256 9225ec497d60c6520ff8285f5a9575c43155605998eda0a0fde317269eb87717

See more details on using hashes here.

Supported by

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