Skip to main content

A simple downloader written in Python with an awesome progressbar.

Project description

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

Conda-Forge

Installing downloader-cli from the conda-forge channel can be achieved by adding conda-forge to your channels with:

conda config --add channels conda-forge
conda config --set channel_priority strict

Once the conda-forge channel has been enabled, downloader-cli can be installed with:

conda install downloader-cli

It is possible to list all of the versions of downloader-cli available on your platform with:

conda search downloader-cli --channel conda-forge

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] [--done DONE] [--left LEFT]
          [--current CURRENT] [--color-done COLOR_DONE]
          [--color-left COLOR_LEFT] [--color-current COLOR_CURRENT]
          [--icon-border ICON_BORDER]
          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

UI Group:
  --done DONE           Icon indicating the percentage done of the downloader
  --left LEFT           Icon indicating the percentage remaining to download
  --current CURRENT     Icon indicating the current percentage in the progress
                        bar
  --color-done COLOR_DONE
                        Color for the done percentage icon
  --color-left COLOR_LEFT
                        Color for the remaining percentage icon
  --color-current COLOR_CURRENT
                        Color for the current indicator icon in the progress
                        bar
  --icon-border ICON_BORDER
                        Icon for the border of the progress bar

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_current 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)
color_done No blue
color_left No blue
color_current No blue

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.

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

downloader_cli-0.3.4.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

downloader_cli-0.3.4-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file downloader_cli-0.3.4.tar.gz.

File metadata

  • Download URL: downloader_cli-0.3.4.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for downloader_cli-0.3.4.tar.gz
Algorithm Hash digest
SHA256 61b40984da05ce0563721126fc7ff977dfdbb0c1bb875f8e9305765a5e49eddb
MD5 0db27c11174e376f53ad7609e9f3b8d0
BLAKE2b-256 a0456b0095df8875e6ce2b83f365a9cf06c78e438d3f0997927894524aa530e0

See more details on using hashes here.

File details

Details for the file downloader_cli-0.3.4-py3-none-any.whl.

File metadata

File hashes

Hashes for downloader_cli-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c68bb6fedd05f1aa4936e7398efe9573a14a531a76e513e05658f4265681a287
MD5 87875ced40c9baa41dd676439a3836fc
BLAKE2b-256 35c0d7f057b89bc9e09ecb1192c1fc002dba37dc380a147bb7b2f6a2e8205fc5

See more details on using hashes here.

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