Minimal progress bar
Project description
barre
Install
pip install barre
Usage
from barre import b
from time import sleep # for demo purpose
# Simple iteration
for x in b(range(100)):
sleep(0.1) # simulate work
# With any iterable
items = ["item1", "item2", "item3"]
for x in b(items):
sleep(0.1) # your actual work here
Examples
Processing Files
from barre import b
import os
# Process all images in a directory
image_files = [f for f in os.listdir("images/") if f.endswith((".jpg", ".png"))]
for file in b(image_files):
with open(f"images/{file}", "rb") as img:
# Your image processing here
pass
API Requests
from barre import b
import requests
# Download multiple URLs with progress
urls = [
"https://api.example.com/data1",
"https://api.example.com/data2",
"https://api.example.com/data3",
]
responses = []
for url in b(urls):
response = requests.get(url)
responses.append(response.json())
Data Processing
from barre import b
import pandas as pd
# Process chunks of a large DataFrame
df = pd.read_csv("large_file.csv")
chunk_size = 1000
chunks = [df[i:i+chunk_size] for i in range(0, len(df), chunk_size)]
results = []
for chunk in b(chunks):
result = chunk.groupby('category').sum()
results.append(result)
Long Computations
from barre import b
import numpy as np
# Heavy computations with visual feedback
matrices = []
for i in b(range(100)):
matrix = np.random.rand(100, 100)
result = np.linalg.eig(matrix)
matrices.append(result)
Training ML Models
from barre import b
# Training epochs with progress
epochs = 100
for epoch in b(range(epochs)):
model.train_epoch()
loss = model.evaluate()
Features
- Single file (<1KB)
- Zero dependencies
- No configuration needed
- Clean ASCII progress display
License
MIT
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
barre-1.0.4.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
barre-1.0.4-py3-none-any.whl
(3.2 kB
view details)
File details
Details for the file barre-1.0.4.tar.gz.
File metadata
- Download URL: barre-1.0.4.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38effc35452d0c59933c0a17778c348cbca9fc4c3bd472ee7b72700c60410a88
|
|
| MD5 |
25bbff5642ca58819db2bf7f67d1e4fe
|
|
| BLAKE2b-256 |
dba2dd936f9426310f935a6ef75517c851db399aab9c0b8a966913fbb39400f1
|
File details
Details for the file barre-1.0.4-py3-none-any.whl.
File metadata
- Download URL: barre-1.0.4-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c1605c2f28b28210abbce9fc2326bab7e990a0d4fecb44f594ec25d461ed93e
|
|
| MD5 |
ebb7f32857b62e39de6fe8d30d67fa2a
|
|
| BLAKE2b-256 |
d89273adf91f8e0b3f085d920371f3234a3c09b6d14fbafed4f58c752d3e89db
|