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
Release history Release notifications | RSS feed
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 hashes)
Built Distribution
Close
Hashes for aiodownloads-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | acd0c5d2595dcff11375210440c0138a04be5263eeb844f09bf212fd728f44c4 |
|
MD5 | 34ed1ef906e1be570e84c001c003d3cf |
|
BLAKE2b-256 | 9225ec497d60c6520ff8285f5a9575c43155605998eda0a0fde317269eb87717 |