| 1 |
Metadata-Version: 2.1 |
| 2 |
Name: dlmanager |
| 3 |
Version: 0.1.1 |
| 4 |
Summary: download manager library |
| 5 |
Home-page: http://github.com/parkouss/dlmanager |
| 6 |
Author: Julien Pagès |
| 7 |
Author-email: [email protected] |
| 8 |
License: GPL/LGPL |
| 9 |
Requires-Dist: requests |
| 10 |
Requires-Dist: six |
| 11 |
|
| 12 |
.. image:: https://badge.fury.io/py/dlmanager.svg |
| 13 |
:target: https://pypi.python.org/pypi/dlmanager |
| 14 |
|
| 15 |
.. image:: https://readthedocs.org/projects/dlmanager/badge/?version=latest |
| 16 |
:target: http://dlmanager.readthedocs.org/en/latest/?badge=latest |
| 17 |
:alt: Documentation Status |
| 18 |
|
| 19 |
.. image:: https://travis-ci.org/parkouss/dlmanager.svg?branch=master |
| 20 |
:target: https://travis-ci.org/parkouss/dlmanager |
| 21 |
|
| 22 |
.. image:: https://codecov.io/github/parkouss/dlmanager/coverage.svg?branch=master |
| 23 |
:target: https://codecov.io/github/parkouss/dlmanager?branch=master |
| 24 |
|
| 25 |
dlmanager |
| 26 |
========= |
| 27 |
|
| 28 |
**dlmanager** is Python 2 and 3 download manager library, with the following |
| 29 |
features: |
| 30 |
|
| 31 |
- Download files in background and in parallel |
| 32 |
- Cancel downloads |
| 33 |
- store downloads in a given directory, avoiding re-downloading files |
| 34 |
- Limit the size of this directory, removing oldest files |
| 35 |
|
| 36 |
|
| 37 |
Example |
| 38 |
------- |
| 39 |
|
| 40 |
.. code-block:: python |
| 41 |
|
| 42 |
from dlmanager import DownloadManager, PersistLimit |
| 43 |
|
| 44 |
manager = DownloadManager( |
| 45 |
"dlmanager-destir", |
| 46 |
persist_limit=PersistLimit( |
| 47 |
size_limit=1073741824, # 1 GB max |
| 48 |
file_limit=10, # force to keep 10 files even if size_limit is reached |
| 49 |
) |
| 50 |
) |
| 51 |
|
| 52 |
# Start downloads in background |
| 53 |
# Note that if files are already present, this is a no-op. |
| 54 |
manager.download(url1) |
| 55 |
manager.download(url2) |
| 56 |
|
| 57 |
# Wait for completion |
| 58 |
try: |
| 59 |
manager.wait() |
| 60 |
except: |
| 61 |
manager.cancel() |
| 62 |
raise |
| 63 |
|
| 64 |
|
| 65 |
Installation |
| 66 |
------------ |
| 67 |
|
| 68 |
Use pip: :: |
| 69 |
|
| 70 |
pip install -U dlmanager |