Skip to main content

Display progress as a pretty table in the command line.

Project description

Progress Table

PyPi version PyPI license codecov

Lightweight utility to display the progress of your process as a pretty table in the command line.

  • Alternative to TQDM whenever you want to track metrics produced by your process
  • Designed to monitor ML experiments, but works for any metrics-producing process
  • Allows you to see at a glance what's going on with your process
  • Increases readability and simplifies your command line logging

Change this:

example

Into this:

example

Examples

From examples/ directory:

  • Neural network training

example-training

  • Progress of multi-threaded downloads

example-download

  • Simulation and interactive display of Brownian motion

example-brown2d

  • Display of a game board

example-tictactoe

Quick start code

import random
import time

from progress_table import ProgressTable

# Create table object:
table = ProgressTable(num_decimal_places=1)

# You can (optionally) define the columns at the beginning
table.add_column("x", color="bold red")

for step in range(10):
    x = random.randint(0, 200)

    # You can add entries in a compact way
    table["x"] = x

    # Or you can use the update method
    table.update("x", value=x, weight=1.0)

    # Display the progress bar by wrapping an iterator or an integer
    for _ in table(10):  # -> Equivalent to `table(range(10))`
        # Set and get values from the table
        table["y"] = random.randint(0, 200)
        table["x-y"] = table["x"] - table["y"]
        table.update("average x-y", value=table["x-y"], weight=1.0, aggregate="mean")
        time.sleep(0.1)

    # Go to the next row when you're ready
    table.next_row()

# Close the table when it's finished
table.close()

Go to integrations page to see examples of integration with deep learning libraries.

Advanced usage

Go to advanced usage page for more information.

Troubleshooting

Exceesive output

Progress Table works correctly in most consoles, but there are some exceptions:

  • Some cloud logging consoles (e.g. kubernetes) don't support \r properly. You can still use ProgressTable, but with interactive=0 option. This mode will not display progress bars.

  • Some consoles like 'PyCharm Python Console' or 'IDLE' don't support cursor movement. You can still use ProgressTable, but with interactive=1 option. In this mode, you can display only a single progress bar.

By default interactive=2. You can change the default 'interactive' with an argument when creating the table object or by setting 'PTABLE_INTERACTIVE' environment variable, e.g. PTABLE_INTERACTIVE=1.

Other problems

If you encounter different messy outputs or other unexpected behavior: please create an issue!

Installation

Install Progress Table easily with pip:

pip install progress-table

Links

Alternatives

  • Progress bars: great for tracking progress, but they don't provide ways to display data in clear and compact way

    • tqdm
    • rich.progress
    • keras.utils.Progbar
  • Libraries displaying data: great for presenting tabular data, but they lack the progress tracking aspect

    • rich.table
    • tabulate
    • texttable

Project details


Release history Release notifications | RSS feed

This version

3.2.2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

progress_table-3.2.2.tar.gz (28.4 kB view details)

Uploaded Source

Built Distribution

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

progress_table-3.2.2-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

Details for the file progress_table-3.2.2.tar.gz.

File metadata

  • Download URL: progress_table-3.2.2.tar.gz
  • Upload date:
  • Size: 28.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for progress_table-3.2.2.tar.gz
Algorithm Hash digest
SHA256 6a415cc7b61f1f3ea2c3fe322d93abb77eb3b6db268b281673d88eee95bf692e
MD5 c1829181a848fe061fd600db76a06ce6
BLAKE2b-256 e911dce0b115815943d41392966de72e2d47adf8273a62a27e1ac6d14dd57c15

See more details on using hashes here.

File details

Details for the file progress_table-3.2.2-py3-none-any.whl.

File metadata

  • Download URL: progress_table-3.2.2-py3-none-any.whl
  • Upload date:
  • Size: 21.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for progress_table-3.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e0e35a23e726310b347db508c2da661a4abbda30ef7ad41963d7f4306704521e
MD5 88ea59b5e5a58ada6728cb33d1b17140
BLAKE2b-256 06010e7b331ece3f6dd69d4776aa351862a19c3f9493ba2a662331c6530c8466

See more details on using hashes here.

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