From e574d1a90a8312b4122125d340cb27c56f7bc57d Mon Sep 17 00:00:00 2001 From: Rishiraj Acharya <44090649+rishiraj@users.noreply.github.com> Date: Mon, 23 Sep 2024 03:39:00 +0530 Subject: [PATCH] set default values --- README.md | 10 +++++----- firerequests/main.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7aadfcc..300012a 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![PyPI version](https://img.shields.io/pypi/v/firerequests.svg)](https://pypi.org/project/firerequests/) [![License](https://img.shields.io/pypi/l/firerequests.svg)](https://github.com/rishiraj/firerequests/blob/main/LICENSE) [![Python version](https://img.shields.io/pypi/pyversions/firerequests.svg)](https://pypi.org/project/firerequests/) -**FireRequests** is a high-performance, asynchronous HTTP client library for Python, engineered to accelerate your file transfers. By harnessing advanced concepts like semaphores, exponential backoff with jitter, concurrency, and fault tolerance, FireRequests can achieve up to a **5x real-world speedup** in file downloads and uploads compared to traditional synchronous methods. +**FireRequests** is a high-performance, asynchronous HTTP client library for Python, engineered to accelerate your file transfers. By harnessing advanced concepts like semaphores, exponential backoff with jitter, concurrency, and fault tolerance, FireRequests can achieve up to a **6x real-world speedup** in file downloads and uploads compared to traditional synchronous methods. ## Features 🚀 @@ -39,11 +39,11 @@ fr.download(url, filename) FireRequests delivers significant performance improvements over traditional download methods. Below is the result of a real-world speed test: ```plaintext -Normal Download 🐌: 100%|██████████| 3.42G/3.42G [06:16<00:00, 9.08MB/s] -Downloading on 🔥: 100%|██████████| 3.42G/3.42G [01:15<00:00, 45.2MB/s] +Normal Download 🐌: 100%|██████████| 3.42G/3.42G [18:26<00:00, 3.09MB/s] +Downloading on 🔥: 100%|██████████| 3.42G/3.42G [03:29<00:00, 16.4MB/s] -🐌 Download Time: 376.77 seconds -🔥 Download Time: 75.75 seconds +🐌 Download Time: 1107.32 seconds +🔥 Download Time: 209.41 seconds ``` ## Advanced Usage ⚙️ diff --git a/firerequests/main.py b/firerequests/main.py index 3cef314..14a5ccc 100644 --- a/firerequests/main.py +++ b/firerequests/main.py @@ -46,7 +46,7 @@ async def download_chunk( async def download_file( self, url: str, filename: str, max_files: int, chunk_size: int, headers: Optional[Dict[str, str]] = None, - parallel_failures: int = 0, max_retries: int = 0, callback: Optional[Any] = None + parallel_failures: int = 3, max_retries: int = 5, callback: Optional[Any] = None ): headers = headers or {} try: @@ -96,7 +96,7 @@ async def download_chunk_with_retries( async def upload_file( self, file_path: str, parts_urls: List[str], chunk_size: int, max_files: int, - parallel_failures: int = 0, max_retries: int = 0, callback: Optional[Any] = None + parallel_failures: int = 3, max_retries: int = 5, callback: Optional[Any] = None ): file_size = os.path.getsize(file_path) tasks = []