Minimal terminal download UI
Project description
Mini Download UI
A minimalist and cross-platform Python module providing a terminal download using ANSI escape sequences.
This project focuses on simplicity and clarity:
- No external dependencies
- Pure Python
- Works on Linux, macOS and modern Windows terminals
Features
- APT style progress bar
- Log area displayed above the progress bar
- Progress percentage indicator
- Adaptive to terminal size
- ANSI-based rendering
- Simple and explicit usage
Requirements
- Python 3.8+
- ANSI-compatible terminal
- Linux terminals
- macOS Terminal / iTerm2
- Windows Terminal, PowerShell 7+, WSL
Installation
No installation step required.
Simply install the lib with pip
pip install mini_dl_ui
Basic Usage
from mini_dl_ui import DownloadUI
import time
ui = DownloadUI()
for i in range(101):
ui.set_progress(i)
ui.log(f"Downloading package {i}/100")
time.sleep(0.05)
ui.finish()
Example Terminal Output
[LOG] Downloading package 48/100
[LOG] Downloading package 49/100
[LOG] Downloading package 50/100
--------------------------------------------------
[########## ] 50%
Threaded Usage
import threading
import time
from mini_dl_ui import DownloadUI
ui = DownloadUI(fill='=')
def worker():
for i in range(101):
ui.set_progress(i)
ui.log(f"Chunk {i} received")
time.sleep(0.03)
ui.finish()
threading.Thread(target=worker).start()
Example Terminal Output
[LOG] Downloading package 48/100
[LOG] Downloading package 49/100
[LOG] Downloading package 50/100
--------------------------------------------------
[========= ] 50%
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mini_download_ui-1.0.tar.gz
(3.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mini_download_ui-1.0.tar.gz.
File metadata
- Download URL: mini_download_ui-1.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3d24af2b2b31a81da287cc085121059607ef2e24d62a61ec650fb6df77b7640
|
|
| MD5 |
e69c1ba77fe6214ef246682a7f024864
|
|
| BLAKE2b-256 |
9fd655a845c4e39efe45cd176df30c32c473521f34e0da1a9cb2521a9e5b3a06
|
File details
Details for the file mini_download_ui-1.0-py3-none-any.whl.
File metadata
- Download URL: mini_download_ui-1.0-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
488eb9dcda7b1696bb053aa87ca10fe89f887c12c3576673c4cf7e1beefd279f
|
|
| MD5 |
f0ac9fc3fac93781b6bff03e59d4c56a
|
|
| BLAKE2b-256 |
bc35283748fc119d0d25c25920580bc49b3dfe455f9a22c4354c314e8040f174
|