Skip to content

Commit

Permalink
Released jsonv 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Engel committed Dec 7, 2013
1 parent 0cf2226 commit d29f86c
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 13 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.rdoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
= jsonv.sh CHANGELOG

== Version 0.2.0 (December 7, 2013)

* Using <tt>JSON.awk</tt> instead of <tt>JSON.sh</tt> for much, much better performance (this requires <tt>gawk</tt> to be installed)
* Parsing <tt>examples/complex-3.json</tt> (19828 objects, file size 13.6MB) took:
- <tt>0.1.0</tt>: 4 minutes and 32 seconds
- <tt>0.2.0</tt>: 20 seconds
* Refactored writing the map file which gains performance
* Introduced <tt>.jsonv</tt> and <tt>tmp</tt> directory for better file directory management
* Not removing tokens and map file when done anymore
* Improved install and uninstall scripts
* Provided <tt>-v</tt> and <tt>--version</tt> options

== Version 0.1.0 (December 6, 2013)

* Initial release
40 changes: 31 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,30 @@ Parsing `examples/simple.json` (3 objects) without a path prefix:

### Complex JSON

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

$ curl -s https://raw.github.com/archan937/jsonv.sh/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"
Parsing `examples/complex-2.json` (4734 objects) with a path prefix:

$ curl -s https://raw.github.com/archan937/jsonv.sh/master/examples/complex-2.json | jsonv id,name,gender,balance,age,company,address,phone,email,picture,registered response.data
1,"Newton Bush","male","$1,653.00",27,"Xanide","710 Corbin Place, Vivian, Mississippi, 6954","+1 (916) 520-2940","newtonbush@xanide.com","http://placehold.it/32x32","1998-02-17T17:00:12 -01:00"
2,"Ratliff Workman","male","$2,941.00",39,"Bitendrex","680 Menahan Street, Matheny, North Dakota, 3316","+1 (997) 409-2099","ratliffworkman@bitendrex.com","http://placehold.it/32x32","1996-02-02T13:26:48 -01:00"
3,"Hawkins Jacobs","male","$1,584.00",40,"Marqet","349 Joralemon Street, Mansfield, California, 8655","+1 (831) 508-2216","hawkinsjacobs@marqet.com","http://placehold.it/32x32","2012-07-23T15:13:43 -02:00"
4,"Whitfield Maldonado","male","$2,519.00",34,"Tri@Tribalog","966 Moffat Street, Wanamie, Indiana, 3006","+1 (940) 554-2482","whitfieldmaldonado@tri@tribalog.com","http://placehold.it/32x32","2002-11-06T13:40:49 -01:00"
5,"Wise Phelps","male","$1,322.00",23,"Temorak","116 Matthews Court, Orin, Kentucky, 2196","+1 (967) 577-3292","wisephelps@temorak.com","http://placehold.it/32x32","1997-11-20T21:58:48 -01:00"
...

### Trying it out locally

Check out this repository first and run the following command:

$ cat examples/complex-3.json | ./jsonv id,name,gender,balance,age,company,address,phone,email,picture,registered response.data
1,"Pearlie Hodge","female","$1,347.00",36,"Zappix","371 Abbey Court, Leola, Iowa, 6919","+1 (966) 515-2796","pearliehodge@zappix.com","http://placehold.it/32x32","2004-05-18T01:48:01 -02:00"
2,"Tessa Saunders","female","$1,398.00",24,"Zounds","399 Provost Street, Ironton, Alaska, 4909","+1 (807) 501-3914","tessasaunders@zounds.com","http://placehold.it/32x32","2001-11-27T14:20:43 -01:00"
3,"Clarissa Hawkins","female","$2,974.00",33,"Recrisys","566 Drew Street, Elliston, Maine, 9520","+1 (867) 510-2236","clarissahawkins@recrisys.com","http://placehold.it/32x32","2002-09-12T12:01:35 -02:00"
4,"Lauren Sexton","female","$2,282.00",26,"Lunchpad","461 Lloyd Street, Deercroft, Arkansas, 9022","+1 (937) 509-3538","laurensexton@lunchpad.com","http://placehold.it/32x32","1998-07-01T19:13:55 -02:00"
5,"Hutchinson Ayers","male","$1,697.00",20,"Mangelica","129 Tabor Court, Freeburn, North Dakota, 2921","+1 (823) 542-2366","hutchinsonayers@mangelica.com","http://placehold.it/32x32","1997-11-20T04:39:49 -01:00"
...

In this example, `examples/complex-3.json` contains 19828 objects and is parsed in about 20 seconds.

### Log file

When using `jsonv`, it writes log messages to log file `jsonv.log` located within the same directory as `jsonv` itself.
Expand All @@ -56,10 +70,18 @@ When using `jsonv`, it writes log messages to log file `jsonv.log` located withi

## Credits

`jsonv` heavily makes use of `JSON.sh` created by Dominic Tarr ([@dominictarr](https://twitter.com/dominictarr)):
`jsonv` heavily makes use of `JSON.awk` created by Stepk ([step-](https://github.com/step-)):

[https://github.com/step-/JSON.awk](https://github.com/step-/JSON.awk)

Thanks Dominic Tarr ([@dominictarr](https://twitter.com/dominictarr)) for creating `JSON.sh` on which `JSON.awk` is based on:

[https://github.com/dominictarr/JSON.sh](https://github.com/dominictarr/JSON.sh)

Thanks GNU Project ([http://www.gnu.org](http://www.gnu.org)) for creating `gawk`:

[http://www.gnu.org/software/gawk/](http://www.gnu.org/software/gawk/)

## License

Copyright (c) 2013 Paul Engel, released under the MIT license
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0
0.2.0
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version="0.1.0"
version="0.2.0"

echo "Downloading https://github.com/archan937/jsonv.sh/archive/$version.tar.gz"
curl -L -s https://github.com/archan937/jsonv.sh/archive/$version.tar.gz -o jsonv.sh-$version.tar.gz
Expand Down
6 changes: 4 additions & 2 deletions jsonv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
# jsonv 0.1.0
# jsonv 0.2.0
# A Bash command line tool for converting JSON to CSV
#
# Copyright (c) 2013 Paul Engel, released under the MIT license
Expand Down Expand Up @@ -122,6 +122,8 @@ jsonv () {
echo "=====================" >> $log
}

if [ "$1" != "" ]; then
if [[ "$1" == "-v" || "$1" == "--version" ]]; then
echo "0.2.0"
elif [ "$1" != "" ]; then
jsonv $1 $2
fi

0 comments on commit d29f86c

Please sign in to comment.