A powerful python based downloader module.
Project description
Python Downloader Demo
Build a powerful python based downloader app.
Requirements
- python>=3.6
- requests
- tqdm
- retry
- hashlib
- multitasking
- signal
- gooey (GUI only / check the Github repo)
Example, create a test.py
file with the following code to download the tensorflow git repo (about 76 MB) and the gitignore git repo (about 100KB)
The run
function will return the md5 of the downloaded file for checking purposes.
from pySpeedDownloader import pydownloader
url = "https://github.com/tensorflow/tensorflow/archive/refs/heads/master.zip"
file_name = "tensorflow-master.zip"
output_dir = "download/tf"
file_md5 = pydownloader.run(url, file_name, output_dir)
print(file_md5)
url = "https://github.com/github/gitignore/archive/refs/heads/master.zip"
file_name = "gitignore-master.zip"
output_dir = "download/gitignore"
file_md5 = pydownloader.run(url, file_name, output_dir)
print(file_md5)
Bash command window output will be like:
❯ python test.py
Downloading tensorflow-master.zip...
Downloading: tensorflow-master.zip: 76029696it [00:21, 3457111.70it/s]
dd8bfb4bab14f81742574bbe19aae8a6
Downloading gitignore-master.zip...
Downloading: gitignore-master.zip: 103808it [00:02, 35557.32it/s]
8c0224157f4748eead1423530f52f401
If you re-run the code again, it will ask you if you want to overwrite the existing files.
❯ python test.py
Downloading tensorflow-master.zip...
⛔️ download/tf/tensorflow-master.zip already exists, overwrite it?? (Y/N): N
dd8bfb4bab14f81742574bbe19aae8a6
Downloading gitignore-master.zip...
⛔️ download/gitignore/gitignore-master.zip already exists, overwrite it?? (Y/N): N
8c0224157f4748eead1423530f52f401
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
pySpeedDownloader-0.1.1.tar.gz
(145.2 kB
view hashes)
Built Distribution
Close
Hashes for pySpeedDownloader-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a3680755c882659b4cbd2cbdcb4eafc384200f4cba2560898d497758710af21 |
|
MD5 | aa57c643239cbf6f44478910efa0071b |
|
BLAKE2b-256 | 0fea46e99e0ef813d6118dbc741f22613ed56f74bd7b0188c11b8028c6a28c1e |