brozip
brozip copied to clipboard
:zap: CLI to concurrently compress, decompress using Brotli algorithm
brozip is a fast command line tool to concurrently compress,
decompress files using the Brotli compression algorithm. It can handle
arbitrary number of files given and if none are given it will perform
an operation on stdin and push the results to stdout
Why use this over any other zipping tool/algorithm?
Well, Google calls Brotli the …new compression algorithm for the internet with improvements up to 25% over other zipping algorithms, see the comparison shootout here.
Installation
I assume you have opam installed, it is OCaml's package manager.
$ opam install brozip
and you'll have the brozip executable installed.
I tested this on OS X and Debian Jessie, both worked. It should
work on Windows as well but you will have to put in more effort
although it should be fine if run under cygwin (I think)
NOTE You might get a shared library error on Linux, like on
Debian. This is most likely an issue with where your system looks for
shared libraries. Do the following, edit your /etc/ld.so.conf and
add /usr/local/lib, then as root run ldconfig.
brozip usage
brozip keeps some common interfaces like other zipping utilities,
like if no files are given, then it will just take stdin and process
to stdout so you should be able to drop it in some shell scripts
now.
$ brozip < asyoulik.txt.compressed | wc -l
4122
The default action is decompression, tell brozip to compress input
with the --compress, -c flag.
If multiple files are given then brozip will act on them
concurrently, you can control this with the flag --serial, -s
which when given will make brozip process files one by one.
Some compression tuning options are specific to the Brotli algorithm
but all default to the settings used by Google, Look at the man page
for all details, accessible with either man brozip or brozip --help

Issues
As always, please report bugs and PRs are always welcome.
- Even though this is only 250 lines of Code, there are still places
that can be refactored and made more
DRYor just generally improved.