Skip to main content

A simple yet powerfull file downloader package for python

Project description

TechZDL

A simple yet powerful file downloader package for Python.

Description

TechZDL is a highly efficient and easy-to-use file downloader package for Python. It provides features for downloading files with multiple threads, dynamic worker adjustments based on network speed, and more.

Installation

You can install TechZDL using pip:

pip install techzdl

To update TechZDL to the latest version, use:

pip install --upgrade techzdl

Usage

Here's a basic example of how to use TechZDL:

Basic Usage

Code from test.py file

import asyncio
from techzdl.api import TechZDL


async def main():
    techzdl = TechZDL()
    downloader = techzdl.get_downloader(url="https://link.testfile.org/bNYZFw")
    await downloader.start()


asyncio.run(main())

https://github.com/TechShreyash/techzdl/assets/82265247/33267e71-2b41-4dd1-b306-c87a197a3b57

Configuration Parameters

The get_downloader method accepts several parameters to customize the download process:

  • url (str): URL of the file to download.

  • custom_headers (Optional[dict], optional): Custom headers to send with the request. Defaults to None.

  • output_dir (Union[str, Path], optional): Directory where the file will be saved. Defaults to "downloads".

  • filename (Optional[str], optional): Name to save the file as (including extension). By default, this will be determined automatically based on the URL or Content-Disposition header.

  • workers (Optional[int], optional): Number of fixed concurrent download workers. By default, this will be dynamically adjusted based on the download speed. Setting this will disable dynamic worker adjustment.

  • initial_dynamic_workers (int, optional): Initial number of dynamic workers. Defaults to 2.

  • dynamic_workers_update_interval (int, optional): Interval in seconds to update the dynamic worker count. Defaults to 5.

  • debug (bool, optional): Enable debug logs. Defaults to True.

  • progress (bool, optional): Enable download progress display. Defaults to True.

  • progress_callback (Optional[Union[Callable[..., Any], Callable[..., Awaitable[Any]]]], optional): Callback function for download progress updates. Can be sync or async. Defaults to None. Setting this disables tqdm progress.

  • progress_args (tuple, optional): Additional arguments for progress_callback. Defaults to ().

  • progress_interval (int, optional): Time interval for progress updates in seconds. Defaults to 1.

  • chunk_size (int, optional): Size of each download chunk in bytes. Defaults to 5 MB.

  • single_threaded (bool, optional): Force single-threaded download. Defaults to False.

  • max_retries (int, optional): Maximum retries for each chunk/file download. Defaults to 3.

  • timeout (int, optional): Timeout for each request in seconds. Defaults to 60.

Examples

Will be added soon

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

techzdl-1.1.6.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

techzdl-1.1.6-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file techzdl-1.1.6.tar.gz.

File metadata

  • Download URL: techzdl-1.1.6.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.7

File hashes

Hashes for techzdl-1.1.6.tar.gz
Algorithm Hash digest
SHA256 a22f499b0b40b266d09c464d5a4e0522a5ba8217a13ee5abc8c22b07541c16c3
MD5 e72f4edb2a65e6f120ff83a12614553f
BLAKE2b-256 abb72cc6a52cbdf0b260b9e80b3ccdb9900bef6c243bc54b8289cab9b1f4933d

See more details on using hashes here.

File details

Details for the file techzdl-1.1.6-py3-none-any.whl.

File metadata

  • Download URL: techzdl-1.1.6-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.7

File hashes

Hashes for techzdl-1.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 2a0181410048cb30f45ac42bd97d04452cfb767e79ca29db6e89a057a1c3e938
MD5 2810f1c6789cf35807e34c0ba7a339a7
BLAKE2b-256 fb9541d1072580a423e4385df654265ba23f88ac4844f3c3dba0cb44a40b9cdf

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