Robust Downloader
A minimal Python downloader designed for robustness, offering features like resumable downloads and automatic retries. It is currently in beta status (Development Status :: 4 - Beta) and provides both a Python interface and a command-line utility for simple file transfers.
Warnings
- gotcha The library is currently in 'Beta' development status (Development Status :: 4 - Beta). This implies that APIs and core behaviors might still evolve and change in future versions without strict adherence to semantic versioning until a stable 1.0 release.
- gotcha While designed for robustness, the basic `download` function, as shown in minimal usage examples, does not explicitly include `try-except` blocks for error handling. For production-ready applications, it is essential to implement comprehensive exception handling for network issues, file system errors, or unexpected server responses.
- gotcha Version 0.0.2 introduced an optional SHA256 integrity check. If downloading critical files where data integrity is paramount, it is highly recommended to provide the expected SHA256 hash to the `download` function to verify the file's authenticity and ensure it hasn't been corrupted during transfer. This check is not enabled by default.
- gotcha The library describes itself as a 'minimal' downloader. While it supports resumable downloads and retries, users accustomed to more feature-rich download managers (e.g., those offering multi-part downloads, advanced proxy configurations, or sophisticated handling of dynamic/expiring URLs) might find certain advanced capabilities or extensive customization options to be limited.
Install
-
pip install robust-downloader
Imports
- download
from robust_downloader import download
Quickstart
from robust_downloader import download
# Download a file from a URL
# Replace with an actual URL to test
file_url = "https://raw.githubusercontent.com/fedebotu/robust-downloader/main/README.md"
try:
download(file_url, filename="downloaded_readme.md")
print(f"Successfully downloaded {file_url} to downloaded_readme.md")
except Exception as e:
print(f"An error occurred during download: {e}")