Metadata-Version: 2.4
Name: everbar
Version: 0.3.0
Summary: A progress bar that works everywhere — terminal, Jupyter, VS Code, Colab, Marimo.
Project-URL: Homepage, https://github.com/mluttikh/everbar
Project-URL: Issues, https://github.com/mluttikh/everbar/issues
License-Expression: MIT
Keywords: jupyter,marimo,notebook,progress,progressbar,tqdm
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Terminals
Requires-Python: >=3.11
Provides-Extra: all
Requires-Dist: ipywidgets>=8.0; extra == 'all'
Requires-Dist: marimo>=0.10; extra == 'all'
Requires-Dist: rich>=13.0; extra == 'all'
Requires-Dist: tqdm>=4.65; extra == 'all'
Provides-Extra: marimo
Requires-Dist: marimo>=0.10; extra == 'marimo'
Provides-Extra: notebook
Requires-Dist: ipywidgets>=8.0; extra == 'notebook'
Requires-Dist: tqdm>=4.65; extra == 'notebook'
Provides-Extra: rich
Requires-Dist: rich>=13.0; extra == 'rich'
Provides-Extra: tqdm
Requires-Dist: tqdm>=4.65; extra == 'tqdm'
Description-Content-Type: text/markdown

# everbar

A progress bar that works **everywhere** — terminal, Jupyter, JupyterLab, VS Code notebooks, Google Colab, Marimo, Pyodide, and CI logs. One API, the right backend per environment.

> Status: 0.2.0 — alpha. API may shift.

## Install

```bash
pip install everbar             # core only; uses text fallback if nothing else is installed
pip install "everbar[tqdm]"     # terminal + Jupyter via tqdm
pip install "everbar[notebook]" # tqdm + ipywidgets for notebook front-ends
pip install "everbar[all]"      # everything (tqdm, rich, ipywidgets, marimo)
```

## Use

```python
from everbar import Progress

for x in Progress(items, desc="Loading"):
    work(x)

with Progress(total=100, desc="Steps") as bar:
    for _ in range(100):
        do_step()
        bar.update(1)
```

Other options:

```python
Progress(items, unit="files")   # label what's being counted
Progress(items, disable=True)   # render nothing (e.g. behind a quiet flag)
```

### Live metrics with `set_postfix`

Show a live key/value suffix next to the bar — useful in training loops:

```python
with Progress(total=epochs, desc="Training") as bar:
    for epoch in range(epochs):
        loss, acc = train_one_epoch()
        bar.set_postfix(loss=loss, acc=acc)
        bar.update(1)
```

Calling `set_postfix` again replaces the previous suffix. Floats are
formatted compactly (e.g. `loss=0.424, acc=0.91`).

### Signal failure with `fail()`

Mark the bar as failing without stopping it — useful when one task in a
batch errors but the overall job continues:

```python
with Progress(total=len(jobs), desc="Batch") as bar:
    for job in jobs:
        if not run(job):
            bar.fail()
        bar.update(1)
```

Rendering is backend-specific: red bar in tqdm, `FAIL` marker in Rich,
`[failing]` log lines in non-TTY mode, a red badge in Marimo. The state
is sticky.

## Overrides

```python
Progress(items, backend="terminal")        # per-call
```

```bash
EVERBAR_BACKEND=terminal python script.py  # env var
```

```python
import everbar
everbar.set_default_backend("terminal")    # module-wide
```

Precedence: the `backend=` argument wins, then `EVERBAR_BACKEND`, then
`set_default_backend`, then auto-detection.

Unknown backend names raise `ValueError` (`EVERBAR_BACKEND` warns and is
ignored instead). If you request a backend in code (`backend=` or
`set_default_backend`) and its dependency isn't installed, you get an
`ImportError`; if `EVERBAR_BACKEND` names it, everbar warns and uses the
text fallback instead — deploy-time configuration never crashes a
script. Auto-detection falls back silently.

Extra keyword arguments to `Progress` are forwarded to the selected
backend, so they are environment-specific by nature (tqdm's `colour`,
Rich's `console`, the fallback's `min_interval`). Stick to the named
parameters in code that must run everywhere.

## How it picks a backend

`everbar.detect_environment()` returns one of: `marimo`, `colab`, `kaggle`, `vscode_notebook`, `jupyter`, `spyder`, `databricks`, `pyodide`, `ipython_terminal`, `terminal`, `non_tty`. Each maps to a backend, with graceful fallback to a log-line text mode when nothing better is available.
