https://github.com/bfontaine/simple-progress
Simple progress bar for your Clojure programs
https://github.com/bfontaine/simple-progress
clojure library progress-bar
Last synced: 9 months ago
JSON representation
Simple progress bar for your Clojure programs
- Host: GitHub
- URL: https://github.com/bfontaine/simple-progress
- Owner: bfontaine
- Created: 2013-06-27T19:11:40.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-02-16T23:15:59.000Z (almost 12 years ago)
- Last Synced: 2025-04-15T03:15:24.630Z (9 months ago)
- Topics: clojure, library, progress-bar
- Language: Clojure
- Homepage:
- Size: 371 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# simple-progress
[](https://travis-ci.org/bfontaine/simple-progress)
[](https://coveralls.io/r/bfontaine/simple-progress?branch=master)
`simple-progress` is a Clojure library for simple progress bars display. It’s
focused on simplicity, if you want to display a progress bar for operations on
files, use [`progress`](https://github.com/tobias/progress) instead.
## Usage
```clj
(let [b (mk-progress-bar)]
(doseq [_ (range 100)]
(do-something)
(b))) ; display the progress bar
```
The `simple-progress.bar` module have one public function, `mk-progress-bar`. It
takes one optional argument, which is the maximal value of the bar (the default
is 100). It returns a function which describes the bar. You can then call it to
increment its value and display the bar, with an optional argument:
- `:inc`: increment the bar value (default)
- `:dec`: decrement the bar value
- `:reset`: reset the bar value to `0`
- `:complete`: set the bar to its maximum value
The bar is displayed after each call, and the current value is returned.

## Install
Add the following dependency to your project:
```clj
[simple-progress "0.1.3"]
```
Then require/use the `simple-progress.bar` module.
## Test
```
lein test
```
## License
Copyright © 2013 Baptiste Fontaine
Distributed under the Eclipse Public License, the same as Clojure.