Skip to main content

Minimal progress bar

Project description

barre

PyPI version CI License: MIT

A lightweight progress bar. One line, zero config, zero dependencies.

Demo

Install

pip install barre

Usage

Simple and intuitive:

from barre import b
from time import sleep

# Simple iteration
for x in b(range(100)):
    sleep(0.1)  # your work here

# With any iterable
items = ["item1", "item2", "item3"]
for x in b(items):
    process(x)

Output:

[||||||||||||||||||||                    ] 50/100

Real-world 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

  • Minimal: Single file (<1KB)
  • Fast: Zero dependencies
  • Simple: No configuration needed
  • Clean: Professional ASCII output
  • Universal: Works with any iterable

License

MIT


Made with pragmatism in France 🇫🇷

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

barre-1.0.8.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

barre-1.0.8-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file barre-1.0.8.tar.gz.

File metadata

  • Download URL: barre-1.0.8.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for barre-1.0.8.tar.gz
Algorithm Hash digest
SHA256 08af8eaeb1336d5463a9b48a8ebb1bd50878955a8982ce32c0967d7f0fc3a18d
MD5 5de2cdfab5b67698bbb52c751fcdcc8f
BLAKE2b-256 80c52e97f5f09258aa4647059727d8806fae8708468a0a9e47fcef372d6fcde1

See more details on using hashes here.

Provenance

The following attestation bundles were made for barre-1.0.8.tar.gz:

Publisher: release.yml on FeelTheFonk/barre

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file barre-1.0.8-py3-none-any.whl.

File metadata

  • Download URL: barre-1.0.8-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for barre-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 b8af337c295305b3ccf43a0e72af760c956f424dbe924bb380852ee2b20b5e39
MD5 b5b4c8e2077e611bc0082a78cb956371
BLAKE2b-256 ef6b2fccab74b09da8a703f7396c9843c03681f6a08efd03ae8406a1baa7497f

See more details on using hashes here.

Provenance

The following attestation bundles were made for barre-1.0.8-py3-none-any.whl:

Publisher: release.yml on FeelTheFonk/barre

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page