Download Manager
Project description
download-manager
Download Manager is a single python tool dedicated to help to download products from LTA and AIP.
Download manager features
The tool has been implemented with the objective to implements the following features:
-
Manage download in a configurable local folder,
-
Manage partial downloads and recovery downloads,
-
Manage parallelized downloads
-
Manage bulk download
-
Management of connections error/retry
-
Monitoring of downloads (bandwidth/progress) and errors
-
Run in command line (GUI is a nice to have)
-
Support of multiple sources
-
Manage checksum validation of downloads
-
Local storage management (identification of incomplete downloads to be resume, evictions...)
-
Manage/anticipate quota limitation:
- bandwidth limitation
- parallel transfers number
- transfer volume per time ..
-
Download list issued from an OData filter
-
Manage OData endpoint notifications/action when new product matching filter is up to allow performing routine downloads.
Install the download manager
Installing download-manager with execute the following in a terminal:
pip install download-manager
Options
Option | Type | Explanation | Example |
---|---|---|---|
-s, --service | TEXT | Service to requests data [required] | download_manager --service odata://my_service.com |
-f, --filters | TEXT | Filter to apply to requests products by default only online products are requested. | download_manager --service odata://my_service.com -f 'filter to apply' |
-O, --order | TEXT | Sort query (ASC or DESC). | download_manager --service odata://my_service.com -O ASC |
-u, --username | TEXT | Service connection username. | download_manager --service odata://my_service.com -u user |
-p, --password | TEXT | Service connection password. | download_manager --service odata://my_service.com -p pwd |
-P, --process_number | INTEGER | Number of parallel download threads (default:2). | download_manager --service odata://my_service.com -P 16 |
-l, --limit | INTEGER | Limit the number matching products (default: 10) | download_manager --service odata://my_service.com -l 100 |
-o, --output | TEXT | The directory to store the downloaded files. | download_manager --service odata://my_service.com -o /path/to/products |
-q, --quiet | BOOLEAN | Silent mode: only errors are reported. | download_manager --service odata://my_service.com -q |
-c, --chunk-size | INTEGER | The size of downloaded chunks (default: 4194304). | download_manager --service odata://my_service.com -c 16777216 |
-v, --verify | BOOLEAN | Check file integrity by hashes. | download_manager --service odata://my_service.com -v |
-r, --resume | BOOLEAN | Resume downloading a partially downloaded file. | download_manager --service odata://my_service.com -r |
-d, --database | TEXT | Folder to store the database if not present the database will be in a folder /.download_manager in the home directory.. | download_manager --service odata://my_service.com -d /path/to/your/db |
-S, --storage_limit_size | INTEGER | The size max of file to download. | download_manager --service odata://my_service.com -S 20000000 |
-C, --continuous | BOOLEAN | When present the download keep going download package by package. | download_manager --service odata://my_service.com -C |
-b, --bulk | TEXT | Path to a csv file containing name of products to downloads. | download_manager --service odata://my_service.com --bulk <Path_to_csv> |
--help | Show this message and exit. | download_manager --help |
Getting started
Download one product, with one thread:
download_manager --service odata://service.com/ -P 1 -u user -p password -l 1
Download 10 products:
download_manager --service odata://service.com/ -u user -p password -l 10
Use the silent option:
download_manager --service odata://service.com/ -u user -p password --quiet
Use filter to download specific products:
download_manager --service odata://service.com/ -u user -p password -f "Online eq true and startswith(Name,'S1')"
Use the resume option:
download_manager --service odata://service.com/ -u user -p password --db_folder 'database_folder' --resume
Use the storage management option:
download_manager --service odata://service.com/ -u user -p password -f "Online eq true and startswith(Name,'S2')" -l 25 -S 278209392 -o tests -db resources
Use python code:
from download_manager.download_manager import DownloadManager
from requests.auth import HTTPBasicAuth
service = 'https://odata.service.com'
auth=HTTPBasicAuth("user", "pwd")
dm = DownloadManager(service=service, auth=auth)
dm.start()
nodes = dm.find_nodes(filter="startswith(Name, 'S2B')")
for node in nodes:
if node['Attributes']['cloudCover'].value == 0:
dm.submit(node)
dm.join()
dm.stop()
Limitation
For now only odata implementation is available, quota still not supported.
The error management is implemented but cannot be parametrized in command line.
Offline product are not yet supported.
Project details
Release history Release notifications | RSS feed
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_manager-1.0.0b2.tar.gz
.
File metadata
- Download URL: download_manager-1.0.0b2.tar.gz
- Upload date:
- Size: 33.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c8ad523fa05b50f548f43b323a93d139f2680571386fe822e7f51f2d55c19a1 |
|
MD5 | 9cfc8d80b71ff34cb92c7c0dabbbc16a |
|
BLAKE2b-256 | 75c7fa79263109ab9929ee5b93db5f7a0764117f24fa71f6a9afe8834079c15a |
File details
Details for the file download_manager-1.0.0b2-py3-none-any.whl
.
File metadata
- Download URL: download_manager-1.0.0b2-py3-none-any.whl
- Upload date:
- Size: 21.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f476bbca9ad0feb4df29cc0401ea02c1b2f525d038f717852cf3fec4ecd0357 |
|
MD5 | 86a6664f4c01c08b45642101b83e1d71 |
|
BLAKE2b-256 | 83ccdd31b81fa6584de93bd46d66384fb0b0ed0b8b8f15048d1f47ae2aca850c |