ascii-progress alternatives and similar packages
Based on the "System" category.
Alternatively, view ascii-progress alternatives based on common mentions on social networks and blogs.
-
taffybar
A gtk based status bar for tiling window managers such as XMonad -
optparse-generic
Auto-generate a command-line parser for your datatype -
nix-deploy
Deploy software or an entire NixOS system configuration to another NixOS system -
ghc-hotswap
Example code for how we swap compiled code within a running Haskell process. -
hapistrano
Deploy tool for Haskell applications, like Capistrano for Rails -
directory
Platform-independent library for basic file system operations -
typed-process
Alternative API for processes, featuring more type safety -
pid1
Do signal handling and orphan reaping for Unix PID1 init processes -
openssh-github-keys
Control SSH access to your servers via GitHub teams -
clock
High-resolution clock functions: monotonic, realtime, cputime. -
hnix-store-core
Haskell implementation of the nix store API -
atomic-write
Writes files atomically in Haskell while preserving permissions -
system-fileio
Contains the system-filepath and system-fileio packages -
language-puppet
A library to work with Puppet manifests, test them and eventually replace everything ruby. -
optparse-declarative
Declarative command-line option parser -
plugins
Dynamic linking and runtime evaluation of Haskell, and C, including dependency chasing and package resolution. -
executable-hash
Provides the SHA1 hash of the program executable -
halfs
The Haskell File System: A file system implementation in Haskell -
directory-contents
Recursively build a tree of directory contents, avoiding symlink cycles
Clean code begins in your IDE with SonarLint
Do you think we are missing an alternative of ascii-progress or a related project?
README
ascii-progress
A simple Haskell progress bar for the console. Heavily borrows from TJ Holowaychuk's Node.JS project progress.
Basic Usage
import Control.Concurrent (threadDelay)
import Control.Monad (unless)
import System.Console.AsciiProgress (Options(..), displayConsoleRegions,
isComplete, def, newProgressBar, tick)
main :: IO ()
main = displayConsoleRegions $ do
pg <- newProgressBar def { pgWidth = 50 }
loop pg
where
loop pg = do
b <- isComplete pg
unless b $ do
threadDelay $ 200 * 1000
tick pg
loop pg
Multiple progress bar support
Though still rudimentary, there's support for running multiple concurrent
progress bars. The multi-example
shows off this
feature:
Examples
The bin directory contains the example above and a more complex example
which uses http-conduit
to download an image from imgur, printing the
progress using the package.
To build the examples, just configure and compile with -fexamples
:
git clone https://github.com/yamadapc/haskell-ascii-progress
cabal install -j --only-dep -fexamples
cabal configure -fexamples
cabal run example
# ...
cabal run download-example
Options
ascii-progress
uses an Options
data type for configuring the progress bar.
Available options are:
pgFormat :: String
A format String
for the progress bar. The following placeholders are
supported:
":eta"
(ETA displayed in seconds)":current"
(current tick)":total"
(total number of ticks)":percent"
(percentage completed)":elapsed"
(elapsed time in seconds)":bar"
(the actual progress bar)
Example
main = do
pg <- newProgressBar def { pgFormat = ":current/:total [:bar]" }
-- ...
pgCompletedChar :: Char
The character used on the completed part of the bar
There's an example which mimicks the NPM3 progress-bar. It looks like:
Working ╢████████████████████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
pgPendingChar :: Char
The character used on the completed part of the bar
pgTotal :: Int
The total amount of ticks for the bar to be completed
pgWidth :: Int
The progress bar's total width in columns
pgOnCompletion :: Maybe String
What to output when the progress bar is done. The same format placeholders used
in pgFormat
may be used.
pgGetProgressStr :: Options -> Stats -> String
If all else fails, you can provide a function which determines how a progress-bar is rendered.
Installing
This package is published to hackage as
ascii-progress
, so you
can install it with:
cabal install ascii-progress
It's also part of stackage.
License
This code is licensed under the MIT license for Pedro Tacla Yamada. For more information please refer to the LICENSE file.
*Note that all licence references and agreements mentioned in the ascii-progress README section above
are relevant to that project's source code only.