https://github.com/ericentin/tqdm_elixir
Add a progress bar to your enumerables in a second
https://github.com/ericentin/tqdm_elixir
Last synced: 4 months ago
JSON representation
Add a progress bar to your enumerables in a second
- Host: GitHub
- URL: https://github.com/ericentin/tqdm_elixir
- Owner: ericentin
- License: apache-2.0
- Created: 2015-12-23T17:49:13.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-08-25T17:39:03.000Z (almost 3 years ago)
- Last Synced: 2026-01-14T07:33:50.226Z (5 months ago)
- Language: Elixir
- Size: 16.6 KB
- Stars: 58
- Watchers: 1
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/antipax/tqdm_elixir) [](https://coveralls.io/github/antipax/tqdm_elixir?branch=master) [](http://inch-ci.org/github/antipax/tqdm_elixir) [](https://hex.pm/packages/tqdm) [](https://github.com/antipax/tqdm_elixir/blob/master/LICENSE)
# Tqdm
Tqdm easily adds a CLI progress bar to any enumerable.

A (partial) port of Python's [tqdm](https://github.com/tqdm/tqdm) to Elixir. Thanks noamraph and all other contributors for the original library!
Just wrap Lists, Maps, Streams, or anything else that implements Enumerable with `Tqdm.tqdm`:
```elixir
for _ <- Tqdm.tqdm(1..1000) do
:timer.sleep(10)
end
# or
1..1000
|> Tqdm.tqdm()
|> Enum.map(fn _ -> :timer.sleep(10) end)
# or even...
1..1000
|> Stream.map(fn _ -> :timer.sleep(10) end)
|> Tqdm.tqdm(total: 1000)
|> Stream.run()
# |###-------| 392/1000 39.0% [elapsed: 00:00:04.627479 left: 00:00:07, 84.71 iters/sec]
```
Full documentation can be found [here](https://hexdocs.pm/tqdm/0.0.2).
## Installation
1. Add tqdm to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:tqdm, "~> 0.0.2"}]
end
```
2. Ensure tqdm is added to your list of applications:
```elixir
def application do
[applications: [:tqdm]]
end
```