Skip to main content
https://codecov.io/gh/choldgraf/download/branch/master/graph/badge.svg https://circleci.com/gh/choldgraf/download.svg?style=svg

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)

Frequently Asked Questions

Why do I occasionally get a “Error file size is…” error?

Occasionally, when you try to download a file, the server from which you are downloading will return that the download is finished, when it is not. download will check whether the final downloaded file is the correct size. If not, it will throw this error. In this case, you should try re-downloading the file.

Release files for download 0.3.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for download 0.3.5
File Size Uploaded
download-0.3.5.tar.gz 8.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for download 0.3.5
File Interpreter ABI Platform
download-0.3.5-py3-none-any.whl Python 3 none any Details

Total release size: 16.9 kB

Release files / download-0.3.5.tar.gz

Download URL download-0.3.5.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
884a885475b3cdbec0aa277e41643995c3394a1e064a0816f53fffae4a382130
BLAKE2b-256 checksum
How to use checksums
3c6e1fd2e220b42858e2fb0e5fe870404210d003f151930e62b58675223444d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

Release files / download-0.3.5-py3-none-any.whl

Download URL download-0.3.5-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b2f7695745254b0bebdfb789d426b35768366054538b4f8e7f9377dd5a9499d
BLAKE2b-256 checksum
How to use checksums
374501e7455a9659528e77a414b222326d4c525796e4f571bbabcb2e0ff3d1f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

Release history Release notifications | RSS feed

This release

0.3.5 This release

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2

2 release files

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page