I’m pleased to announce the 0.2.0 release of Progress
, now available via Opam.
Progress
is an OCaml library for defining and using progress bars. It has the following features:
- allows user-defined progress bar layouts;
- supports rendering multiple progress bars simultaneously;
- dynamically responds to changes in terminal size;
- supports interleaving logging with progress bar rendering.
This second release contains a much-improved DSL for specifying progress bars, alongside improvements and extensions to the rendering logic. The bars in the screenshot above are defined as follows:
let bar ~color ~total =
let open Progress.Line in
list
[ spinner ~color:(Progress.Color.ansi `green) ()
; brackets (elapsed ())
; bar ~color total
; bytes
; parens (const "eta: " ++ eta total)
]
It also comes with more complete documentation and many more examples, including:
- a Cargo-like progress bar w/ logging of intermediate results:
- a Yarn-like stack of spinners:
- a showcase of various progress bar styles:
The changelog is here and the API documentation is here. The library is not yet feature-complete, but should still be reasonably useful Happy hacking!