Skip to main content

A tqdm-like progress bar that snakes across your terminal via a random space-filling curve.

Project description

snakebar

A tqdm-like progress bar that fills your terminal with a one-character-thick snake along a random space-filling curve. Based on https://observablehq.com/@esperanc/random-space-filling-curves

Installation

pip install snakebar

Installation with uv

If you are using uv as your Python environment manager, you can install snakebar with:

uv pip install snakebar

Usage

Basic Python usage

Using snake_tqdm as a drop-in replacement for tqdm:

from snakebar import snake_tqdm
for i in snake_tqdm(range(100)):
    # your code here
    pass

Using SnakeTQDM for manual progress bar updates:

from snakebar import SnakeTQDM
with SnakeTQDM(total=100) as pbar:
    for i in range(100):
        # your code here
        pbar.update(1)

CLI usage

You can also use the snakebar command line interface:

snakebar -n 100 --desc "Processing" --sleep 0.05

Options:

  • -n, --total: Total number of steps (default 100)
  • --desc: Description text to show alongside the progress bar
  • --sleep: Time in seconds to sleep between steps (simulates work)

Development

To install snakebar in editable mode for development, run:

uv pip install -e .

To run the CLI demo during development:

snakebar -n 100 --desc "Demo" --sleep 0.05

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

snakebar-0.1.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

snakebar-0.1.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file snakebar-0.1.0.tar.gz.

File metadata

  • Download URL: snakebar-0.1.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.12

File hashes

Hashes for snakebar-0.1.0.tar.gz
Algorithm Hash digest
SHA256 57c4ff91e33ee54b5d5784d5b501b5d5eb9b997c684ae8c8d821e3f87fa958bc
MD5 30620de1f705abf44e8b04be6edd52aa
BLAKE2b-256 44df1a70f2ba6c75fe15c9bf7e8368096e1f411d0585ece6015051bd7620035f

See more details on using hashes here.

File details

Details for the file snakebar-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: snakebar-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.12

File hashes

Hashes for snakebar-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4862ed183ac4b74f67438f34ec8d2445a6c15e704981f0ca2ed7bbef6968170d
MD5 3de8f123308b7c14c18ca2bc53254693
BLAKE2b-256 fa0d11838c4c0d079b69ac8c1f6e75edc3f70d8d4d02cbc22a911fbe264ea9a6

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