Animated progress bars with nyan cat and friends -- a drop-in tqdm replacement
Project description
nayan-tqdm
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
bearbeecat_mousecat_playcat_sleepycat_smugcat_yarnconstructioncrydeal_with_itdisapprovaldiscodouble_flipfinger_gunsfireflexgardenheartbeathypelennylightninglovematrixmusicnyanoceanpastaragerocketrunshrugsnakesparklestable_fliptable_ragetable_unfliptrainuwuwizardzen
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb18a00faf1dd75f9a6a21d1f75f7d6f4f55e29eb7f5bfdd2c52623d01d8f33e
|
|
| MD5 |
95316b140bff5f9afd8ca365b9ca4ec5
|
|
| BLAKE2b-256 |
ee2efa452bb1e12cb11eb04060547b4502840982cfe2ce3252183f2653a6d245
|
Provenance
The following attestation bundles were made for nayan_tqdm-2.0.0.tar.gz:
Publisher:
publish.yml on ParkerWilliams/nayan-tqdm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nayan_tqdm-2.0.0.tar.gz -
Subject digest:
fb18a00faf1dd75f9a6a21d1f75f7d6f4f55e29eb7f5bfdd2c52623d01d8f33e - Sigstore transparency entry: 1032479770
- Sigstore integration time:
-
Permalink:
ParkerWilliams/nayan-tqdm@8a95a2c2749c944c8e6628194db02c8709973bed -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ParkerWilliams
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8a95a2c2749c944c8e6628194db02c8709973bed -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37daa8705f59dbc3277b055082f86db78e71cf6f581c6648921fea57554f4681
|
|
| MD5 |
31a7bd343778c6c3039d6cb284932175
|
|
| BLAKE2b-256 |
94aff4bcd64292f07baf967c09d5c1943ae8d226a595946c6281ec35180e17f6
|
Provenance
The following attestation bundles were made for nayan_tqdm-2.0.0-py3-none-any.whl:
Publisher:
publish.yml on ParkerWilliams/nayan-tqdm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nayan_tqdm-2.0.0-py3-none-any.whl -
Subject digest:
37daa8705f59dbc3277b055082f86db78e71cf6f581c6648921fea57554f4681 - Sigstore transparency entry: 1032479885
- Sigstore integration time:
-
Permalink:
ParkerWilliams/nayan-tqdm@8a95a2c2749c944c8e6628194db02c8709973bed -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ParkerWilliams
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8a95a2c2749c944c8e6628194db02c8709973bed -
Trigger Event:
release
-
Statement type: