Skip to main content

download manager library

Project description

https://badge.fury.io/py/dlmanager.svg Documentation Status https://travis-ci.org/parkouss/dlmanager.svg?branch=master https://codecov.io/github/parkouss/dlmanager/coverage.svg?branch=master

dlmanager

dlmanager is Python 2 and 3 download manager library, with the following features:

  • Download files in background and in parallel

  • Cancel downloads

  • store downloads in a given directory, avoiding re-downloading files

  • Limit the size of this directory, removing oldest files

Example

from dlmanager import DownloadManager, PersistLimit

manager = DownloadManager(
    "dlmanager-destir",
    persist_limit=PersistLimit(
        size_limit=1073741824,  #  1 GB max
        file_limit=10,  # force to keep 10 files even if size_limit is reached
    )
)

# Start downloads in background
# Note that if files are already present, this is a no-op.
manager.download(url1)
manager.download(url2)

# Wait for completion
try:
    manager.wait()
except:
    manager.cancel()
    raise

Installation

Use pip:

pip install -U dlmanager

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dlmanager-0.1.1.tar.gz (2.1 kB view hashes)

Uploaded Source

Built Distribution

dlmanager-0.1.1-py2.py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page