damageboy / yaap

.NET version of python's excellent tqdm (https://github.com/tqdm/tqdm)
MIT License
30 stars 4 forks source link
Build status NuGet

Yaap

This is a straight up port of python venerable tqdm to .NET / CLR

Yaap stands for Yet Another ANSI Progressbar

Origin

From the python project README:

`tqdm` means "progress" in Arabic (taqadum, تقدّم)
and an abbreviation for "I love you so much" in Spanish (te quiero demasiado).

Instantly make your loops show a smart progress meter - just wrap any
iterable with ``tqdm(iterable)``, and you're done!

What does it do

Much like in python, Yaap can make .NET loops, IEnumerables and more show a smart progress meter.

The most dead simple way of starting with Yaap is to add it via the nuget package and

using Yaap;

foreach (var i in Enumerable.Range(0, 1000).Yaap()) {
    Thread.Sleep(10);
}

Will display a continuously updating progress bar like this, on Mac/Linux:

76%|████████████████████████████         | 7568/10000 [00:07s<00:10s, 229.00it/s]

Unfortunately, getting nice looking progress to show up on Windows is not so straight forward, unless you follow these instructions...

Out of the box, On Windows, the progress bar will be less visually appeaking and use ASCII characters:

76%|############################         | 7568/10000 [00:07s<00:10s, 229.00it/s]

What Else

Yaap has the following features:

Docs

Full documentation is provided here

Examples

See the Demo project for a fancy demo that covers most of what Yaap can do and how it can be optimized

You can either run the demo project with dotnet run to run all the demos sequentially or invoke specific demos with dotnet run <n> where <n> is the number of the demo to run...

FAQ and Known Issues