Several days ago I tested the waters and asked you guys, the
community, how useful you thought a command-line front-end to
matplotlib would be. The overwhelmingly positive feedback was enough
for me to sit down and figure out how to do this well, and in a way
that would mimic existing tools to achieve such tasks. One example
being the `graph` utility, which is a part of GNU plotutils. Though
there are subtle differences between mpl_binutils and GNU plotutils
they, in my opinion, improve the user experience and reduce the
ambiguity regarding the parsing of command-line options.
I am announcing that mpl_binutils is in a state ready to be tested by
you guys. Hopefully you'll find it useful. You can check out the
source code here: https://github.com/dmcdougall/mpl_binutils
Without getting into details, I ran into some serious limitations with
argparse. At the end of the day, nothing is perfect, but some tools
are better than others. One such tool, docopt, was shown to me by Mark
Lawrence. docopt will change the way I do any python from the
command-line in the future. docopt is a light-weight command-line
parsing library written in python with no dependencies.
mpl_binutils has two dependencies: docopt and matplotlib. Most of you
should already have one of these! For the other, a simple `pip install
docopt` should work but I had no problems installing it from source
(python setup.py install) on OS X. mpl_binutils is currently a single
script (a python script), called mpl-graph. There is example usage on
the github readme if you'd like to take a look.
Currently, mpl-graph doesn't fail gracefully. It should, but I wanted
to get something working first. Command-line option validation is next
on my todo list and since there are only a handful of command line
options implemented (albeit the most useful ones, in my opinion), this
shouldn't be too big of a job.
Go forth and fork!
University of Warwick