Name | pipebar JSON |
Version |
1.0.4
JSON |
| download |
home_page | None |
Summary | Colorful terminal progress bar with ETA and speed tracking |
upload_time | 2025-07-21 10:43:32 |
maintainer | None |
docs_url | None |
author | カネキ |
requires_python | >=3.6 |
license | None |
keywords |
progress
bar
terminal
cli
ansi
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|

Lightweight and stylish command-line progress bar written in pure **Python** with colorful ANSI output. Perfect for downloads, iterations, or pipelines where you want clean, responsive visual feedback.
---
## 🚀 Features
- ⏱️ ETA and speed tracking
- 🎨 Colorful and modern terminal output (no external dependencies)
- 📦 Works as iterator or manual `.update()` style
- ✅ Minimal and production-ready
---
## 🧪 Usage
```python
from pipebar import ProgressBar
n = 100_000_000
with ProgressBar(total=n, unit='M', scale=1_000_000) as pbar:
result = 0
for i in range(n):
result += i ** 2
pbar.update()
print(f'Result: {result}')
```
---
## 📁 For file downloads
```python
from pipebar import ProgressBar
import requests
import os
red = '\033[38;2;235;64;52m'
end = '\033[0m'
def download_file(url):
url = url.strip('/')
file_name = url.split('/')[-1]
response = requests.get(url, stream=True)
total_size = int(response.headers.get('content-length', 0))
total_size_mb = total_size / (1024 * 1024)
print(f'Downloading {file_name} ({total_size_mb:.1f} MB)')
with ProgressBar(total=total_size, unit='MB', scale=1024*1024) as pbar:
try:
with open(file_name, 'wb') as file:
for data in response.iter_content(chunk_size=1024):
file.write(data)
pbar.update(len(data))
except KeyboardInterrupt:
print(f'\n{red}ERROR: Aborted by user.{end}')
if os.path.exists(file_name):
os.remove(file_name)
raise SystemExit(0)
download_file('http://ipv4.download.thinkbroadband.com/200MB.zip')
```
---
## ⚙️ ProgressBar Parameters
| Parameter | Type | Default | Description |
| ------------ | ----------- | ------- | ------------------------------------------------------------------------------------------ |
| `iterable` | `Iterable` | `None` | Optional iterable to wrap. If provided, `ProgressBar` acts as a generator. |
| `total` | `int` | `None` | Total number of units (e.g., items, bytes). Required for ETA/speed display. |
| `unit` | `str` | `'it'` | Unit name (e.g., `'MB'`, `'files'`, `'records'`). Displayed after progress numbers. |
| `scale` | `int/float` | `1` | Scale factor to convert units (e.g., `1024*1024` to convert bytes to MB). |
| `bar_length` | `int` | auto | Visual length of the progress bar in characters. Auto-adjusts to terminal size if not set. |
Raw data
{
"_id": null,
"home_page": null,
"name": "pipebar",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "progress, bar, terminal, CLI, ansi",
"author": "\u30ab\u30cd\u30ad",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/27/40/e299e0fbad4e5b2f042a4254d2ac42dddc334bb9b6a7b6cff73f7f1fe5e5/pipebar-1.0.4.tar.gz",
"platform": null,
"description": "\n\nLightweight and stylish command-line progress bar written in pure **Python** with colorful ANSI output. Perfect for downloads, iterations, or pipelines where you want clean, responsive visual feedback.\n\n---\n\n## \ud83d\ude80 Features\n\n- \u23f1\ufe0f ETA and speed tracking\n- \ud83c\udfa8 Colorful and modern terminal output (no external dependencies)\n- \ud83d\udce6 Works as iterator or manual `.update()` style\n- \u2705 Minimal and production-ready\n\n---\n\n## \ud83e\uddea Usage\n\n```python\nfrom pipebar import ProgressBar\n\nn = 100_000_000\n\nwith ProgressBar(total=n, unit='M', scale=1_000_000) as pbar:\n result = 0\n\n for i in range(n):\n result += i ** 2\n pbar.update()\n\nprint(f'Result: {result}')\n```\n\n---\n\n## \ud83d\udcc1 For file downloads\n\n```python\nfrom pipebar import ProgressBar\nimport requests\nimport os\n\nred = '\\033[38;2;235;64;52m'\nend = '\\033[0m'\n\ndef download_file(url):\n url = url.strip('/')\n file_name = url.split('/')[-1]\n response = requests.get(url, stream=True)\n total_size = int(response.headers.get('content-length', 0))\n total_size_mb = total_size / (1024 * 1024)\n print(f'Downloading {file_name} ({total_size_mb:.1f} MB)')\n \n with ProgressBar(total=total_size, unit='MB', scale=1024*1024) as pbar:\n try:\n with open(file_name, 'wb') as file:\n for data in response.iter_content(chunk_size=1024):\n file.write(data)\n pbar.update(len(data))\n except KeyboardInterrupt:\n print(f'\\n{red}ERROR: Aborted by user.{end}')\n if os.path.exists(file_name):\n os.remove(file_name)\n raise SystemExit(0)\n\ndownload_file('http://ipv4.download.thinkbroadband.com/200MB.zip')\n```\n\n---\n\n## \u2699\ufe0f ProgressBar Parameters\n\n| Parameter | Type | Default | Description |\n| ------------ | ----------- | ------- | ------------------------------------------------------------------------------------------ |\n| `iterable` | `Iterable` | `None` | Optional iterable to wrap. If provided, `ProgressBar` acts as a generator. |\n| `total` | `int` | `None` | Total number of units (e.g., items, bytes). Required for ETA/speed display. |\n| `unit` | `str` | `'it'` | Unit name (e.g., `'MB'`, `'files'`, `'records'`). Displayed after progress numbers. |\n| `scale` | `int/float` | `1` | Scale factor to convert units (e.g., `1024*1024` to convert bytes to MB). |\n| `bar_length` | `int` | auto | Visual length of the progress bar in characters. Auto-adjusts to terminal size if not set. |\n",
"bugtrack_url": null,
"license": null,
"summary": "Colorful terminal progress bar with ETA and speed tracking",
"version": "1.0.4",
"project_urls": {
"Source": "https://github.com/fabfawufawd/pipebar/"
},
"split_keywords": [
"progress",
" bar",
" terminal",
" cli",
" ansi"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "0395d95071659207dcd490ab4cea9dce21be03f658e859d7d0774cdd4a6dcc64",
"md5": "e3bee810eebc1ade205eb01a0cc2da5b",
"sha256": "ead0d460142fee6b4c9669492fa5f2e7e0b9357ab1c1ca14b7c381c553eca190"
},
"downloads": -1,
"filename": "pipebar-1.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e3bee810eebc1ade205eb01a0cc2da5b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 4304,
"upload_time": "2025-07-21T10:43:31",
"upload_time_iso_8601": "2025-07-21T10:43:31.213265Z",
"url": "https://files.pythonhosted.org/packages/03/95/d95071659207dcd490ab4cea9dce21be03f658e859d7d0774cdd4a6dcc64/pipebar-1.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "2740e299e0fbad4e5b2f042a4254d2ac42dddc334bb9b6a7b6cff73f7f1fe5e5",
"md5": "2dcbbb69161b35d960a7fe871209cd91",
"sha256": "c5015dc137498e6e1a4192d6f3fa4366979ac162acf338bb7c444c53a68b1aa5"
},
"downloads": -1,
"filename": "pipebar-1.0.4.tar.gz",
"has_sig": false,
"md5_digest": "2dcbbb69161b35d960a7fe871209cd91",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 3994,
"upload_time": "2025-07-21T10:43:32",
"upload_time_iso_8601": "2025-07-21T10:43:32.283266Z",
"url": "https://files.pythonhosted.org/packages/27/40/e299e0fbad4e5b2f042a4254d2ac42dddc334bb9b6a7b6cff73f7f1fe5e5/pipebar-1.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-21 10:43:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "fabfawufawd",
"github_project": "pipebar",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pipebar"
}