A quick module to help downloading files using python.
Project description
Download
A no-frills tool to download files from the web. It will attempt to be smart about not downloading data that’s already there, checking to make sure that there were no errors in fetching data, automatically unzipping the contents of downloaded zipfiles (if desired), and displaying a progress bar with statistics.
_This package doesn’t get a ton of developer attention, but is hopefully well-scoped enough that it should still be useful! If you’d like to help improve it, fix bugs, etc, please reach out in the issues!_
Installation
Either clone this repository and install with:
python setup.py install
or, simply install with pip:
pip install download
Usage
Download a file on the web is as easy as:
from download import download path = download(url, file_path)
a file called file_name will be downloaded to the folder of file_path.
File types
If your file is a zip file, you can add the flag:
path = download(url, file_path, kind="zip")
in this case, the file will be downloaded, and then unzipped into the folder specified by file_name.
Supported formats are ‘file’, ‘zip’, ‘tar’, ‘tar.gz’ Defaults to file.
Progress bar
Whether to display a progress bar during file download. Defaults to True:
path = download(url, file_path, progressbar=True)
Replace
If True and the URL points to a single file, overwrite the old file if possible. Defaults to False:
path = download(url, file_path, replace=False)
Timeout
The URL open timeout in seconds. Defaults to 10 seconds:
path = download(url, file_path, timeout=10)
Verbose
Whether to print download status to the screen. Defaults to True:
path = download(url, file_path, verbose=True)
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
Built Distribution
File details
Details for the file download-0.3.4.tar.gz
.
File metadata
- Download URL: download-0.3.4.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7022eca9bb997c6df959a23a4db91354cb7d9a2bdd40bfb95e25754aac5926d |
|
MD5 | 01b889c60f8ee7d345a7152637ee47b2 |
|
BLAKE2b-256 | 8c6bf583d9a7ae2acf3a715a7441d58ebc6a040e82a4fd144f7009fb36c72056 |
File details
Details for the file download-0.3.4-py3-none-any.whl
.
File metadata
- Download URL: download-0.3.4-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f8a5ecb6607e7641eee49ad65d74698a68388c683a1724caaefdd9e63e5c0bb |
|
MD5 | ed89b3d15c87e9395f20e5dedf059037 |
|
BLAKE2b-256 | e30210dbbf98043d6f5ec94d0715401b80e65a0dff49c3d937614d8976c35cb2 |