A tool to download files. It supports progress bar, cksum, timeout, retry failed download.
Low maintenance activity. Last release 16 months ago, commits in 0 of the last 26 weeks. Weaker on commit activity and recent releases.
Consider insteadDrissionGetPythie’s Index: 69138.2K downloads/moCompare →
pip install py3-wgetpy3-wget
A Python library for downloading files of any size, especially optimized for large file downloads, with support for progress bars, checksum verification, timeout handling, and automatic retry on failed downloads.
Features
- 🚀 Optimized for large file downloads
- 📊 Progress bar visualization (optional)
- 🔄 Automatic retry on failed downloads
- 🔍 Optional integrity checks (cksum, MD5, SHA256)
- ⏱️ Configurable timeout and retry settings
- 🛡️ Safe file handling, optional overwrite
- 📦 Simple and intuitive API
- 💻 Cross-platform compatibility (works on any OS)
Installation
pip install py3-wget
Quick Start
Basic Download
from py3_wget import download_file
# Simple download with progress bar
download_file("https://raw.githubusercontent.com/python/cpython/3.11/LICENSE")

Advanced Usage
Retry on Failure
The library automatically retries failed downloads with exponential backoff:
download_file(
"https://raw.githubusercontent.com/python/cpython/3.11/LICENSE",
max_tries=5, # Maximum number of retry attempts
retry_seconds=2 # Initial retry delay in seconds
)
Checksum Verification
Verify downloaded files using checksums:
download_file(
"https://raw.githubusercontent.com/python/cpython/3.11/LICENSE",
md5="fcf6b249c2641540219a727f35d8d2c2", # MD5 checksum
sha256="3aff1954277c4fc27603346901e4848b58fe3c8bed63affe6086003dd6c2b9fe" # SHA256 checksum
)

File Overwrite Control
download_file(
"https://raw.githubusercontent.com/python/cpython/3.11/LICENSE",
output_path="downloads/test.bin",
overwrite=True # Overwrite existing file
)

API Reference
download_file
download_file(
url: str,
output_path: Optional[Union[str, Path]] = None,
overwrite: bool = False,
verbose: bool = True,
cksum: Optional[int] = None,
md5: Optional[str] = None,
sha256: Optional[str] = None,
max_tries: int = 5,
block_size_bytes: int = 8192,
retry_seconds: Union[int, float] = 2,
timeout_seconds: Union[int, float] = 60,
) -> None