or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

animation-factories.mdconfiguration.mddevelopment-tools.mdindex.mdprogress-tracking.mdstyles-themes.md
tile.json

tessl/pypi-alive-progress

A new kind of Progress Bar, with real-time throughput, ETA, and very cool animations!

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/alive-progress@3.3.x

To install, run

npx @tessl/cli install tessl/pypi-alive-progress@3.3.0

index.mddocs/

Alive Progress

A new kind of Progress Bar with real-time throughput, ETA, and very cool animations! Alive Progress provides an animated progress bar library for Python that displays real-time animated progress indicators with comprehensive visual feedback including live spinners, accurate ETA calculations, multithreaded bar updates, and extensive customization options.

Package Information

  • Package Name: alive-progress
  • Language: Python
  • Installation: pip install alive-progress
  • Python Version: >= 3.9

Core Imports

from alive_progress import alive_bar, alive_it, config_handler

Additional imports for styles and customization:

from alive_progress.styles import show_spinners, show_bars, show_themes, showtime, Show, BARS, SPINNERS, THEMES
from alive_progress.animations import bar_factory, frame_spinner_factory, scrolling_spinner_factory
from alive_progress.tools import print_chars

Basic Usage

Simple Progress Bar

from alive_progress import alive_bar
import time

# Basic progress bar with known total
with alive_bar(100, title='Processing') as bar:
    for i in range(100):
        time.sleep(0.1)  # simulate work
        bar()  # advance the bar

Iterator Adapter

from alive_progress import alive_it
import time

items = range(100)
for item in alive_it(items, title='Processing Items'):
    time.sleep(0.05)  # simulate processing
    # No need to call bar() - automatically managed

Unknown Total

from alive_progress import alive_bar

# Progress bar without known total
with alive_bar(title='Processing') as bar:
    for item in some_iterable():
        process_item(item)  # simulate work
        bar()  # advance counter

Architecture

Alive Progress uses a multithreaded architecture with the following key components:

  • Progress Bar Context: Main alive_bar context manager that orchestrates all components
  • Bar Handle: Returned object providing control interface (bar(), properties, methods)
  • Animation Engine: Separate thread managing real-time visual updates and spinner animations
  • Hook Manager: Intercepts and enriches print/logging output during progress tracking
  • Configuration System: Global and local settings management for appearance and behavior
  • Terminal Abstraction: Cross-platform terminal interaction supporting TTY, non-TTY, and Jupyter environments

The design enables smooth visual feedback while maintaining low CPU overhead through calibrated refresh rates and efficient animation compilation.

Capabilities

Progress Tracking

Core progress bar functionality with context managers, iterator adapters, manual and automatic modes, pause/resume capabilities, and comprehensive progress monitoring.

def alive_bar(total: Optional[int] = None, *, calibrate: Optional[int] = None, **options: Any):
    """Create an alive progress bar context manager."""

def alive_it(it: Collection[T], total: Optional[int] = None, *, 
             finalize: Callable[[Any], None] = None, 
             calibrate: Optional[int] = None, **options: Any) -> Iterable[T]:
    """Iterator adapter that automatically tracks progress."""

Progress Tracking

Configuration Management

Global and local configuration system for customizing bar appearance, behavior, widgets, and output formatting across all progress bars or individual instances.

config_handler.set_global(**options)
config_handler.reset()
config_handler.create_context(**options)

Configuration

Styles and Themes

Comprehensive styling system with predefined spinners, bars, and themes, plus factories for creating custom animations and visual effects.

def showtime(show=Show.SPINNERS, *, fps=None, length=None, pattern=None):
    """Display animated demos of all available styles."""

def show_spinners(*, fps=None, length=None, pattern=None):
    """Show all available spinner animations."""

def show_bars(*, fps=None, length=None, pattern=None):
    """Show all available bar styles."""

def show_themes(*, fps=None, length=None, pattern=None):
    """Show all available themes."""

Styles and Themes

Animation Factories

Advanced animation creation system with factories for custom spinners and bars, supporting frame-based, scrolling, bouncing, sequential, and delayed animations.

def bar_factory(**options):
    """Create custom bar animations."""

def frame_spinner_factory(frames, **options):
    """Create frame-based spinners."""

def scrolling_spinner_factory(chars, **options):
    """Create horizontally scrolling spinner animations."""

def bouncing_spinner_factory(chars, **options):
    """Create spinners that bounce back and forth."""

Animation Factories

Development Tools

Development and debugging utilities for character discovery and terminal testing, primarily useful for creating custom animations and testing Unicode support.

def print_chars(line_length: int = 32, max_char: int = 0x20000):
    """Print Unicode characters to help find characters for custom spinners/bars."""

Development Tools

Types

from typing import Optional, Any, Callable, Collection, Iterable, TypeVar
from collections.abc import Collection, Iterable
from types import FunctionType
from enum import Enum

T = TypeVar('T')

class Show(Enum):
    SPINNERS = "SPINNERS"
    BARS = "BARS" 
    THEMES = "THEMES"

# Bar Handle Interface (returned by alive_bar context manager)
class AliveBarHandle:
    # Callable interface
    def __call__(self, count: int = 1, *, skipped: bool = False) -> None: ...
    
    # Read-only properties
    @property
    def current(self) -> Union[int, float]: ...
    @property  
    def monitor(self) -> str: ...
    @property
    def rate(self) -> str: ...
    @property
    def eta(self) -> str: ...
    @property
    def elapsed(self) -> float: ...
    @property
    def receipt(self) -> str: ...
    
    # Assignable properties
    @property
    def text(self) -> Optional[str]: ...
    @text.setter
    def text(self, value: Optional[str]) -> None: ...
    
    @property
    def title(self) -> Optional[str]: ...
    @title.setter  
    def title(self, value: Optional[str]) -> None: ...
    
    # Methods
    def pause(self) -> Any: ...  # Context manager