A lightweight progress bar for Python without dependencies.
Project description
TinyProgress is a minimal and lightweight progress bar module for Python. It provides an easy way to track progress in loops and iterables without requiring external dependencies.
🚀 Features
- ✅ Simple and lightweight (no external dependencies)
- ✅ Customizable progress bar length and characters
- ✅ Supports named tasks
- ✅ Works with any iterable
📦 Installation
Since TinyProgress is a single-file module, you can simply copy tinyprogress.py into your project.
Alternatively, install it via pip (once published to PyPI):
pip install tinyprogress
🛠 Usage
Basic Progress Bar
from tinyprogress import progress
import time
for i in progress(range(100)):
time.sleep(0.05) # Simulating work
Custom Progress Bar Length
for i in progress(range(100), bar_length=50):
time.sleep(0.05)
Named Task Progress Bar
for i in progress(range(100), task_name="Downloading"):
time.sleep(0.05)
Using Custom Characters
for i in progress(range(100), fill_char='#', empty_char='-'):
time.sleep(0.05)
Using Custom Colors
def bar_color(progress: float) -> str:
if progress < 0.7: # 70%
return '\033[31m'
return '\033[32m'
def text_color(progress: float) -> str:
return '\033[35m'
for i in progress(
range(100),
task_name='Colored bar',
fill_char='—',
start_char=' ',
end_char=' ',
bar_color=bar_color,
text_color=text_color
):
time.sleep(0.05)
You can also use the Colorama module to set the colors.
from colorama import Fore
def bar_color(progress: float) -> str:
if progress < 0.7: # 70%
return Fore.RED
return Fore.GREEN
#...
🤝 Contributing
First of all, thank you if you are interested in contributing to this project. To contribute, please carefully read the CONTRIBUTING file and follow its guidelines.
📜 License
GNU General Public License v3, see LICENSE file.
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
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 tinyprogress-1.2.0.tar.gz.
File metadata
- Download URL: tinyprogress-1.2.0.tar.gz
- Upload date:
- Size: 17.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bd61e540f50b8c6ddc441088bfbd824acaeee6f7ed0dfdb07a8c50370a10b5c
|
|
| MD5 |
ee87b35a963b3ff15108d1b710103b35
|
|
| BLAKE2b-256 |
0e0c0b55de0e0e3764cfbce6ccba845cccaddcb09eb45989c1d57c8a1ec90d1e
|
File details
Details for the file tinyprogress-1.2.0-py3-none-any.whl.
File metadata
- Download URL: tinyprogress-1.2.0-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d45c6682385be5157f90d7e8f7d8fc6c467b6bd2103ff23a934ce5d49bbf1a8
|
|
| MD5 |
bf0b939d3674188b967d74ae0a69d847
|
|
| BLAKE2b-256 |
06c741d45507af451b797ae952f757c38e837d9764644c54b503f5e1fc467e33
|