minirepo
minirepo copied to clipboard
Replace Log-Based Progress with Visual Progress Bar and Total Size Calculation in minirepo
Issue Description:
The current implementation of the minirepo script provides progress updates through log messages that display the number of packages downloaded and a percentage completion. While functional, this method is less user-friendly compared to a visual progress bar. Additionally, the script does not calculate or display the total size to be downloaded before starting the process, which would be useful for users in managing disk space and network bandwidth.
Findings:
-
Log-Based Progress Reporting:The script currently logs the number of packages downloaded and the percentage of progress.Example:
WARNING: Downloaded: example-package-1.0.0.whl Ok pid:1234 20% [2/10]
..While this is informative, it lacks the visual clarity and continuous feedback provided by a graphical progress bar. -
Absence of Total Download Size:The script does not calculate the total size of all packages to be downloaded before starting.This can lead to unexpected resource usage, particularly when dealing with large downloads.
Proposed Solution:
-
Implement a Visual Progress Bar:Replace the log-based progress reporting with a visual progress bar using for example the
tqdm
library.The progress bar should show the percentage completed, the current download speed, and the total data downloaded so far. -
Calculate and Display Total Download Size:Before starting the download process, calculate the total size of all packages that will be downloaded.Display this total alongside the progress bar, so users know the expected resource usage.
Benefits:
A visual progress bar provides continuous feedback and is more intuitive for users. Additionally, knowing the total size in advance allows users to make informed decisions about whether to proceed with the download.
Environment:
Python version: 2.x and 3.x
minirepo version: 1.0.3
Operating System: Zorin OS