Skip to content
View TomAPUS's full-sized avatar

Block or report TomAPUS

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don't include any personal information such as legal names or email addresses. Markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
TomAPUS/README.md

TomAPUS

A Bash command line tool for converting JSON to CSV

Installation

Run the following command to install jsonv:

$ curl -s https://raw.github.com/archan937/TomAPUS/master/install.sh | bash

To uninstall, run this command:

$ curl -s https://raw.github.com/archan937/TomAPUS/master/uninstall.sh | bash

Usage

Call jsonv and pass the paths of the values used for the CSV columns (comma separated). Optionally, you can pass a prefix for the paths as a second argument.

Simple JSON

Parsing examples/simple.json (3 objects) without a path prefix:

$ curl -s https://raw.github.com/archan937/TomAPUS/master/examples/simple.json | jsonv id,name,age
1,"Dagny Taggart",39
8,"Francisco D'Anconia",40
12,"Hank Rearden (a.k.a \"The Tank\")",46

Complex JSON

Parsing examples/complex.json (1031 objects) with a path prefix:

$ curl -s https://raw.github.com/archan937/TomAPUS/master/examples/complex.json | jsonv id,name,gender,balance,age,company,address,phone,email,picture,registered response.data
1,"Nieves Miller","male","$2,366.00",29,"Affluex","101 Gates Avenue, Clay, Vermont, 9389","+1 (845) 526-2694","nievesmiller@affluex.com","http://placehold.it/32x32","2005-09-09T04:57:43 -02:00"
2,"Hopper Peters","male","$1,608.00",26,"Geekmosis","879 Borinquen Pl, Guilford, New Jersey, 4785","+1 (823) 480-2875","hopperpeters@geekmosis.com","http://placehold.it/32x32","2009-03-24T18:38:03 -01:00"
3,"Robbie Lindsey","female","$1,944.00",30,"Suremax","876 Ditmas Avenue, Kent, Florida, 6112","+1 (957) 462-2668","robbielindsey@suremax.com","http://placehold.it/32x32","2000-08-18T16:45:03 -02:00"
4,"Brennan Gonzales","male","$3,897.00",23,"Terascape","947 Hall Street, Carlos, Washington, 3321","+1 (963) 525-3342","brennangonzales@terascape.com","http://placehold.it/32x32","2007-08-28T22:45:09 -02:00"
5,"Trisha Cotton","female","$2,591.00",35,"Dogtown","252 Anchorage Place, Hatteras, Texas, 2766","+1 (849) 597-3794","trishacotton@dogtown.com","http://placehold.it/32x32","2007-08-22T18:10:07 -02:00"
...

Log file

When using jsonv, it writes log messages to log file jsonv.log located within the same directory as jsonv itself.

=====================
[2013-12-06 01:10:23] Writing tokens file
[2013-12-06 01:10:34] Deriving keys
[2013-12-06 01:10:34] Deriving prefix
[2013-12-06 01:10:34] Counting entries
[2013-12-06 01:10:34] Writing map file
[2013-12-06 01:10:36] Deriving line format
[2013-12-06 01:10:36] Compiling CSV output
[2013-12-06 01:10:36] Removing tokens and map file
[2013-12-06 01:10:36] Done.
=====================

Credits

jsonv heavily makes use of JSON.sh created by Dominic Tarr (@dominictarr):

https://github.com/dominictarr/JSON.sh

License

Copyright (c) 2013 Paul Engel, released under the MIT license

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Popular repositories Loading

  1. TomAPUS TomAPUS Public

    Awk

  2. SAEG SAEG Public

    SAEG: Stateful Automatic Exploit Generation, an AEG framework for CGC / RHG and pwnable CTF challenges.

    JavaScript

  3. WriteUps WriteUps Public

    WriteUps for CTF

  4. bug-free-parakeet bug-free-parakeet Public

  5. vigilant-waddle vigilant-waddle Public

  6. ubiquitous-octo-memory ubiquitous-octo-memory Public