Skip to main content

Animated progress bars with nyan cat and friends -- a drop-in tqdm replacement

Project description

nayan-tqdm

PyPI version Python versions License: MIT Typed

Animated progress bars that spark joy. A drop-in tqdm replacement with 40 themes, zero dependencies, and full type safety.

Your progress bars don't have to be boring. Swap one import and get rainbow cats, fire-breathing dragons, surfing waves, and table flips.

Installation

pip install nayan-tqdm

Zero dependencies. Python 3.10+. That's it.

Quick Start

# Before
from tqdm import tqdm

# After -- same API, way more fun
from nayan_tqdm import tqdm

for item in tqdm(range(1000)):
    pass

Themes

nayan-tqdm ships with 40 built-in themes across emoji, kaomoji, and meme categories. Each theme has 3 rendering tiers (emoji, unicode, ascii) automatically selected based on your terminal.

Emoji Trail Themes

These themes fill the bar with emoji, leaving a colorful trail behind the sprite.

ocean:       50%|๐ŸŒŠ๐ŸŒŠ๐ŸŒŠ๐ŸŒŠ๐ŸŒŠ๐ŸŒŠ๐ŸŒŠ๐ŸŒŠ๐Ÿ„                | 50/100 [00:05<00:05, 10.00it/s]
fire:        50%|๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ‰                | 50/100 [00:05<00:05, 10.00it/s]
bee:         50%|๐ŸŒป๐ŸŒธ๐ŸŒผ๐ŸŒท๐ŸŒบ๐ŸŒป๐ŸŒธ๐ŸŒผ๐Ÿ                | 50/100 [00:05<00:05, 10.00it/s]
love:        50%|โค๏ธ๐Ÿ’›๐Ÿ’š๐Ÿ’™๐Ÿ’œโค๏ธ๐Ÿ’›๐Ÿ’š๐Ÿ’˜                | 50/100 [00:05<00:05, 10.00it/s]
music:       50%|๐ŸŽต๐ŸŽถ๐ŸŽต๐ŸŽถ๐ŸŽต๐ŸŽถ๐ŸŽต๐ŸŽถ๐ŸŽธ                | 50/100 [00:05<00:05, 10.00it/s]
snake:       50%|๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ๐Ÿ                | 50/100 [00:05<00:05, 10.00it/s]
train:       50%|๐Ÿšƒ๐Ÿšƒ๐Ÿšƒ๐Ÿšƒ๐Ÿšƒ๐Ÿšƒ๐Ÿšƒ๐Ÿšƒ๐Ÿš‚                | 50/100 [00:05<00:05, 10.00it/s]
pasta:       50%|๐Ÿ๐Ÿ๐Ÿ๐Ÿ๐Ÿ๐Ÿ๐Ÿ๐Ÿ‘จโ€๐Ÿณ               | 50/100 [00:05<00:05, 10.00it/s]

Cat Themes

Five feline variations, each with distinct personality.

cat_mouse:   50%|โ€ขยทโ€ขยทโ€ขยทโ€ขยทโ€ขยทโ€ขยทโ€ขยท๐Ÿฑ๐Ÿญ                | 50/100 [00:05<00:05, 10.00it/s]
cat_yarn:    50%|โ€ขโ—†โ€ขโ—†โ€ขโ—†โ€ขโ—†โ€ขโ—†โ€ขโ—†โ€ข๐Ÿฑ๐Ÿงถ                | 50/100 [00:05<00:05, 10.00it/s]
cat_play:    50%|๐Ÿพ๐Ÿพ๐Ÿพ๐Ÿพ๐Ÿพ๐Ÿพ๐Ÿพ๐Ÿพ๐Ÿ™€                | 50/100 [00:05<00:05, 10.00it/s]
cat_smug:    50%|๐ŸŸ๐ŸŸ๐ŸŸ๐Ÿฅ๐ŸŸ๐ŸŸ๐ŸŸ๐Ÿฅ๐Ÿ˜ผ                | 50/100 [00:05<00:05, 10.00it/s]
cat_sleepy:  50%|๐Ÿ’ค๐Ÿ’ค๐Ÿ’ค๐Ÿ’ค๐Ÿ’ค๐Ÿ’ค๐Ÿ’ค๐Ÿ’ค๐Ÿ˜ฟ                | 50/100 [00:05<00:05, 10.00it/s]

Decorated Themes

These have twinkling decorations above and below the bar.

  โœฆ       โ˜…                    โœฆ                    โ˜…
nyan:        50%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ๐Ÿฑ                | 50/100 [00:05<00:05, 10.00it/s]
  โ˜…    โœฆ              โ˜…              โœฆ

  โ˜…  ยท       โœฆ        ยท  โ˜…       โœฆ    ยท  โ˜…
rocket:      50%|๐Ÿ”ฅ๐Ÿ’ฅ๐Ÿ”ฅโœจ๐Ÿ”ฅ๐ŸŒŸ๐Ÿ”ฅ๐Ÿ’ฅ๐Ÿš€                | 50/100 [00:05<00:05, 10.00it/s]
  โ€ข    ยท        โ€ข   ยท        โ€ข    ยท

  โœฆ       โ˜…           ยท       โœฆ       โ˜…
wizard:      50%|โ˜…โœณโ™ฆโ˜†โ„โ˜„โœกโˆดโŒ‚โœฆโ˜…โœณโ™ฆโ˜†โ„โ˜„๐Ÿง™                | 50/100 [00:05<00:05, 10.00it/s]
  โ˜…    ยท              โ˜…              โœฆ

Kaomoji & Meme Themes

Classic internet faces as progress bars.

table_flip:  50%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ(ยฐ_ยฐ)               | 50/100 [00:05<00:05, 10.00it/s]
             100%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ(โ•ฏยฐโ–กยฐ)โ•ฏ๏ธต โ”ปโ”โ”ป|

finger_guns: 50%|โœงโœฆโœงโ˜†โœงโœฆโœงโ˜†โœงโœฆโœงโ˜†โœง(โ˜ž๏พŸโˆ€๏พŸ)โ˜ž              | 50/100 [00:05<00:05, 10.00it/s]
shrug:       50%|โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“ยฏ\_(ใƒ„)_/ยฏ            | 50/100 [00:05<00:05, 10.00it/s]
deal_with_it:50%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ( โ€ข_โ€ข)              | 50/100 [00:05<00:05, 10.00it/s]
             100%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ(โŒโ– _โ– )|

lenny:       50%|โ–‘โ–’โ–“โ–ˆโ–‘โ–’โ–“โ–ˆโ–‘โ–’โ–“โ–ˆโ–‘( อกยฐ อœส– อกยฐ)             | 50/100 [00:05<00:05, 10.00it/s]
uwu:         50%|โ™กโ™ฅโ™กโ™ฅโ™กโ™ฅโ™กโ™ฅโ™กโ™ฅโ™กโ™ฅโ™ก(โœฟโ— โ€ฟโ— )               | 50/100 [00:05<00:05, 10.00it/s]
rage:        50%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ(เฒ ็›Šเฒ )              | 50/100 [00:05<00:05, 10.00it/s]
flex:        50%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆแ•™(โ‡€โ€ธโ†ผโ€ถ)แ•—            | 50/100 [00:05<00:05, 10.00it/s]

All 40 Themes

bear bee cat_mouse cat_play cat_sleepy cat_smug cat_yarn construction cry deal_with_it disapproval disco double_flip finger_guns fire flex garden heartbeat hype lenny lightning love matrix music nyan ocean pasta rage rocket run shrug snake sparkles table_flip table_rage table_unflip train uwu wizard zen

Pick one:

for item in tqdm(range(1000), theme="ocean"):
    pass

Usage

trange shorthand

from nayan_tqdm import trange

for i in trange(100):
    pass

Context manager

from nayan_tqdm import tqdm

with tqdm(total=100) as bar:
    for batch in data_loader:
        process(batch)
        bar.update(10)

Manual update

from nayan_tqdm import tqdm

bar = tqdm(total=500)
for chunk in download_chunks():
    save(chunk)
    bar.update(len(chunk))
bar.close()

Description and postfix

bar = tqdm(range(100))
for epoch in bar:
    loss = train(epoch)
    bar.set_description(f"Epoch {epoch}")
    bar.set_postfix(loss=f"{loss:.4f}")

Set a global default theme

from nayan_tqdm import set_theme, tqdm

set_theme("rocket")

# All bars now use the rocket theme
for item in tqdm(range(100)):
    pass

Force a render level

# Force ASCII rendering even in a fancy terminal
for item in tqdm(range(100), render_level="ascii"):
    pass

API Reference

Progress bars

Name Description
tqdm(iterable, **kwargs) Wrap an iterable with an animated progress bar
trange(n, **kwargs) Shorthand for tqdm(range(n), **kwargs)
NyanBar The progress bar class (also aliased as tqdm)

Key parameters

Parameter Default Description
total len(iterable) Total number of iterations
desc None Description prefix
theme "nyan" Animation theme name
render_level auto-detected Force "emoji", "unicode", or "ascii"
leave True Keep the bar visible after completion
disable False Disable the progress bar entirely
unit "it" Unit label for rate display
unit_scale False Format counts with SI suffixes (k, M, G, ...)
miniters 1 Minimum iterations between display updates
mininterval 0.1 Minimum seconds between display updates
position 0 Bar position (nested bars use > 0)
postfix None Dict of extra stats to display

Theme management

Name Description
set_theme(name) Set the default theme for all new bars
list_themes() Return sorted list of available theme names
get_theme(name, tier) Get a theme's Animation object for a specific tier

Typed

Fully typed with a py.typed marker (PEP 561). Passes mypy --strict with zero errors.

Graceful Fallback

nayan-tqdm automatically falls back to a plain text progress bar when output is piped, the terminal is too narrow, or the bar is disabled. No crashes, no garbled output.

Requirements

  • Python: 3.10+
  • Dependencies: None
  • Platforms: macOS, Linux, Windows

License

MIT

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

nayan_tqdm-2.0.0.tar.gz (203.8 kB view details)

Uploaded Source

Built Distribution

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

nayan_tqdm-2.0.0-py3-none-any.whl (61.7 kB view details)

Uploaded Python 3

File details

Details for the file nayan_tqdm-2.0.0.tar.gz.

File metadata

  • Download URL: nayan_tqdm-2.0.0.tar.gz
  • Upload date:
  • Size: 203.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nayan_tqdm-2.0.0.tar.gz
Algorithm Hash digest
SHA256 fb18a00faf1dd75f9a6a21d1f75f7d6f4f55e29eb7f5bfdd2c52623d01d8f33e
MD5 95316b140bff5f9afd8ca365b9ca4ec5
BLAKE2b-256 ee2efa452bb1e12cb11eb04060547b4502840982cfe2ce3252183f2653a6d245

See more details on using hashes here.

Provenance

The following attestation bundles were made for nayan_tqdm-2.0.0.tar.gz:

Publisher: publish.yml on ParkerWilliams/nayan-tqdm

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

File details

Details for the file nayan_tqdm-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: nayan_tqdm-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 61.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nayan_tqdm-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 37daa8705f59dbc3277b055082f86db78e71cf6f581c6648921fea57554f4681
MD5 31a7bd343778c6c3039d6cb284932175
BLAKE2b-256 94aff4bcd64292f07baf967c09d5c1943ae8d226a595946c6281ec35180e17f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for nayan_tqdm-2.0.0-py3-none-any.whl:

Publisher: publish.yml on ParkerWilliams/nayan-tqdm

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