App::PipeFilters - JSON in the Shell

I've just put App::PipeFilters on github for review before I inflict them on CPAN.

They're a small set of UNIX command line tools for working with structured data. In particular, JSON objects, one per line. They're compatible with many UNIX command line tools like sort and uniq. From the README:

% head −1 sample.json
{"network":"freenode","channel":"#perl","nick":"dngor","karma":"120"}

% jcut −o network −o channel < sample.json | sort | uniq
{"network":"efnet","channel":"#perl"}
{"network":"efnet","channel":"#poe"}
{"network":"efnet","channel":"#reflex"}
{"network":"freenode","channel":"#perl"}
{"network":"freenode","channel":"#poe"}
{"network":"freenode","channel":"#reflex"}
{"network":"magnet","channel":"#perl"}
{"network":"magnet","channel":"#poe"}
{"network":"magnet","channel":"#reflex"}

The new repository contains just a few tools for working on JSON data. The goal is to let UNIX do most of the work. ☺

  • jcut is like cut(1) but understands named fields
  • jmap renames JSON fields
  • json2yaml reads JSON and writes YAML, which may be easier for some to read.
  • jsort is like sort(1) but -k names JSON fields
  • mysql2json reads mysql(1) batch files (-B flag) and writes JSON

4 Comments

ooh, interesting.

when I find a use for this I'll be very excited. :-)

Neat.

You should include the dzil built tarball into the repo as well, so people can easily check it out without having to install the 58 dzil deps.

Leave a comment

About Rocco Caputo

user-pic Among other things I write software, a lot of which is in Perl.