Skip to main content

downloader-cli

A simple downloader written in Python with an awesome progressbar.


Installation   |   Requirements   |   Usage   |   Use It   |   Other examples   

forthebadge made-with-python

License Downloads PyPI AUR PRs Welcome

Installation

NOTE: The following packages (except installing manually) will get you the latest release. If you want to try out the latest development stuff, install manually.

PyPI

The package is available in PyPI here

Install it using

pip install downloader-cli

Arch

The package is available in the AUR here

Install it using yay

yay -S downloader-cli

Gentoo

The package is also available in src_prepare Gentoo overlay here

First set up src_prepare-overlay

sudo emerge -anv --noreplace app-eselect/eselect-repository
sudo eselect repository enable src_prepare-overlay
sudo emaint sync -r src_prepare-overlay

Install it using

sudo emerge -anv --autounmask net-misc/downloader-cli

Manual

If you want to manuall install, clone the repo and run the following command

sudo python setup.py install

Requirements

downloader-cli requires just one external module.

Usage

The script also allows some other values from the commandline.

usage: dw [-h] [-f | -c] [-e] [-q] [-b] [-v] SOURCE [TARGET]

positional arguments:
  SOURCE           URL of the file
  TARGET           target filepath (existing directories will be treated as
                   the target location)

optional arguments:
  -h, --help       show this help message and exit
  -f, -o, --force  overwrite if the file already exists
  -c, --resume     resume failed or cancelled download (partial sanity check)
  -e, --echo       print the filepath to stdout after downloading (other
                   output will be redirected to stderr)
  -q, --quiet      suppress filesize and progress info
  -b, --batch      Download files in batch. If this flag is passed the passed
                   source will be considered as a file with download links
                   seperated by a newline. This flag will be ignored if source
                   is a valid URL.
  -v, --version    show the program version number and exit

Use It

Want to use it in your project?

Import the Download class using the following.

from downloader_cli.download import Download
Download(url).download()

Above is the simplest way to use it in your app. The other arguments are optional.

Arguments

The module takes various arguments. Only one is required though.

Name required default
URL/file Yes
des No None (Current directory is selected and the name is extracted from the URL)
overwrite No False
continue_download No False
echo No False
quiet No False
batch No False
icon_done No
icon_left No
icon_border No | (If a single char is passed, it will be used for both the right and left border. If a string of 2 chars are passed, 1st char will be used as left border and the 2nd as the right border)

NOTE For details regarding the arguments, check Usage

NOTE In case the file size is not available, the bar is shown as indefinite, in which case the icon_left by default space(" ").

Other examples

In case you want to experiment with the progress bar's icons, here's some examples.

  • This is when I passed icon_done as # and icon_left as space.

  • In case a file's size is not available from the server, the progressbar is indefinite.

Download files

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

Source Distribution

downloader_cli-0.3.2.post1.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

downloader_cli-0.3.2.post1-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file downloader_cli-0.3.2.post1.tar.gz.

File metadata

  • Download URL: downloader_cli-0.3.2.post1.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/57.4.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.7

File hashes

Hashes for downloader_cli-0.3.2.post1.tar.gz
Algorithm Hash digest
SHA256 bfb77d3843a2ae34b23030b649987af13e3a686d5800ba8757d6ce58c45b9ac2
MD5 5ea9979770b993367fade6a6fb8e505b
BLAKE2b-256 2d8432d0b1623b907e35e5b401d8e179e1aa0ca0684cb415d12a460d5c024103

See more details on using hashes here.

File details

Details for the file downloader_cli-0.3.2.post1-py3-none-any.whl.

File metadata

  • Download URL: downloader_cli-0.3.2.post1-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/57.4.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.7

File hashes

Hashes for downloader_cli-0.3.2.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 907ba2f24878a039a667f1322d96a6b0a85e15de0b214f1511c7fd1018f8ba2e
MD5 7f572a1382a73512260bc99f4bc652d3
BLAKE2b-256 189e05f804fa7c49085d6bde3bc1eb5f5b1da553bf59a6634316b2f52059b92a

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.4

2 files

0.3.3

2 files

This release

0.3.2.post1 This release

2 files

0.3.2

2 files

0.3.1

2 files

0.2.0

2 files

0.1.0.post2

2 files

0.1.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page