Skip to main content

An extremely smart and efficient download manager for various cases.

Project description

TurboDL

PyPI - Version PyPI - Downloads PyPI - Code Style PyPI - Format PyPI - Python Compatible Versions

TurboDL is an extremely smart, fast and efficient download manager with several automations.

  • Built-in sophisticated download acceleration technique.
  • Uses a sophisticated algorithm to calculate the optimal number of connections based on file size and connection speed.
  • Retry failed requests efficiently.
  • Automatically detects file information before download.
  • Automatically handles redirects.
  • Supports post-download hash verification.
  • Automatically uses RAM buffer to speed up downloads and reduce disk I/O overhead.
  • Accurately displays a beautiful progress bar.

Installation (from PyPI)

pip install -U turbodl  # Install the latest version of TurboDL

Example Usage

Inside a Python script

from turbodl import TurboDL


turbodl = TurboDL(
    max_connections='auto',
    connection_speed=80,
    show_progress_bars=True,
    custom_headers=None,
    timeout=None
)

turbodl.download(
    url='https://example.com/file.txt',
    output_path='path/to/file',
    expected_hash='0a1b2c3d4e5f6g7h8i9j',  # Or None if you don't want to check the hash
    hash_type='md5'
    pre_allocate_space=False,
    use_ram_buffer=True,
)
# >>> file.txt ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 35.6/35.6 kB 36.2 MB/s 0:00:00 100%

# All functions are documented and have detailed typings, use your development IDE to learn more.

From the command line

turbodl --help
# >>>  Usage: turbodl [OPTIONS] URL [OUTPUT_PATH]
# >>>
# >>> ╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
# >>> │ *    url              TEXT           The download URL to download the file from. [default: None] [required]                                                                                                                  │
# >>> │      output_path      [OUTPUT_PATH]  The path to save the downloaded file to. If the path is a directory, the file name will be generated from the server response. If the path is a file, the file will be saved with the   │
# >>> │                                      provided name. If not provided, the file will be saved to the current working directory. (default: Path.cwd())                                                                          │
# >>> │                                      [default: None]                                                                                                                                                                         │
# >>> ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
# >>> ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
# >>> │ --max-connections     -mc                               INTEGER  The maximum number of connections to use for downloading the file (default: 'auto'). [default: None]                                                        │
# >>> │ --connection-speed    -cs                               FLOAT    Your connection speed in Mbps (default: 80). [default: None]                                                                                                │
# >>> │ --overwrite           -o    --no-overwrite        -no            Overwrite the file if it already exists. Otherwise, a "_1", "_2", etc. suffix will be added. [default: overwrite]                                           │
# >>> │ --show-progress-bars  -spb  --hide-progress-bars  -hpb           Show or hide all progress bars. [default: show-progress-bars]                                                                                               │
# >>> │ --timeout             -t                                INTEGER  Timeout in seconds for the download process. Or None for no timeout. [default: None]                                                                        │
# >>> │ --expected-hash       -eh                               TEXT     The expected hash of the downloaded file. If not provided, the hash will not be checked. [default: None]                                                    │
# >>> │ --hash-type           -ht                               TEXT     The hash type to use for the hash verification. Must be one of 'md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'blake2b', 'blake2s', 'sha3_224',     │
# >>> │                                                                  'sha3_256', 'sha3_384', 'sha3_512', 'shake_128' or 'shake_256'.                                                                                             │
# >>> │                                                                  [default: md5]                                                                                                                                              │
# >>> │ --pre-allocate-space  -pas                                       Whether to pre-allocate space for the file, useful to avoid disk fragmentation.                                                                             │
# >>> │ --use-ram-buffer      -urb                                       Whether to use a RAM buffer to download the file. [default: True]                                                                                           │
# >>> │ --help                                                           Show this message and exit.                                                                                                                                 │
# >>> ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

turbodl https://example.com/file.txt [...] path/to/file  # Tip: use -cs argument to set your connection speed in Mbps and accelerate the download
# >>> file.txt ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 35.6/35.6 kB 36.2 MB/s 0:00:00 100%

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, fork the repository and create a pull request. You can also simply open an issue and describe your ideas or report bugs. Don't forget to give the project a star if you like it!

  1. Fork the project;
  2. Create your feature branch ・ git checkout -b feature/{feature_name};
  3. Commit your changes ・ git commit -m "{commit_message}";
  4. Push to the branch ・ git push origin feature/{feature_name};
  5. Open a pull request, describing the changes you made and wait for a review.

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

turbodl-0.1.7.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

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

turbodl-0.1.7-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file turbodl-0.1.7.tar.gz.

File metadata

  • Download URL: turbodl-0.1.7.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for turbodl-0.1.7.tar.gz
Algorithm Hash digest
SHA256 4c3a35d3fbda59d9149d1825a68ff0ae835093185cf078dccedc593ee3139b5e
MD5 934e9bb1080de56ff64e401a812cdd02
BLAKE2b-256 b6b69071c3438673ea7a1c698f15264caa24166e375e10d2e407f2cbd119d34c

See more details on using hashes here.

Provenance

The following attestation bundles were made for turbodl-0.1.7.tar.gz:

Publisher: release.yaml on henrique-coder/turbodl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file turbodl-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: turbodl-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for turbodl-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 7bc0d28c5e42f17a279a3603850ebe558c09be140618457e98345be47626fc2a
MD5 cc14f59005a7b132f43bb03ef774f60d
BLAKE2b-256 87c9531435b67ea82a96855edaab7519a34c0f18174100aa297092962e3b2152

See more details on using hashes here.

Provenance

The following attestation bundles were made for turbodl-0.1.7-py3-none-any.whl:

Publisher: release.yaml on henrique-coder/turbodl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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