python download manager
Project description
pyg-downloader
Uses multiple parallel connections to download a file.
Testing
pytest
Install
pip install pyg-downloader
OR if you want to show progress
pip install pyg-downloader[atpbar]
Usage
CLI
pyg-downloader https://download.samplelib.com/mp4/sample-15s.mp4 -o test.mp4 --max-connections 8 --progress
To Download to disk
from pyg_download_manager import DownloadManager
manager = DownloadManager(max_connections=8, show_progress=True)
# Download to disk and returns the path to the file
# destination_path is the path to the folder for download
# filename is the name of the file to save to. Default is the filename from url.
path = manager.download("https://download.samplelib.com/mp4/sample-15s.mp4", destination_path='./', filename=None)
To Download to memory
from pyg_download_manager import DownloadManager
manager = DownloadManager(max_connections=8, show_progress=True)
# Download data to an BytesIO object and returns the object
# task_name is used to log progress. Default is the filename from url.
data = manager.get("https://download.samplelib.com/mp4/sample-15s.mp4", task_name='Test Task')
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
pyg-downloader-0.0.2.tar.gz
(5.4 kB
view hashes)
Built Distribution
Close
Hashes for pyg_downloader-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 042cc8ffb8bdb74372e87057d303d6bf90f1fd223090c7efb7fcf5bb02125736 |
|
MD5 | 4321e64a8b09efd35e888eb85d1fbcef |
|
BLAKE2b-256 | cf7bbd1016e3fe6ce81741952e6a0ad84a956dd552a94936d0796565738b925b |