Asynchronous downloads
Project description
aiodownloads
Asynchronous downloads
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.1.0.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for aiodownloads-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68b353757f40ea2aa3aca5831dee51d7dfe9e7f538d7066acc1e86b3c115171f |
|
MD5 | 38bc2fee269c489771863af8ae83ff72 |
|
BLAKE2b-256 | 22f7d97ee34a58cc780fc6cc0d3231d06e5233dd1e5d0e986f800cb2b6dbd93e |