Skip to main content
jsontool
========

`jsontool` is utility to fighting with JSON files using CLI

Current stable version
----------------------

0.2.1

How to use it
-------------

cat data1.json data2.json | jsontool --sort-by='timestamp'

jsontool --color=always < data.json | less -R

More
----

% jsontool -h
usage: jsontool [-h] [-f SORT_BY] [-r] [-g GREP] [-v] [--sort-keys]
[--indent INDENT] [--color {auto,always,never}]

optional arguments:
-h, --help show this help message and exit
-f SORT_BY, --sort-by SORT_BY
sort given list of JSONs by this field
-r, --sort-reversed sort in reverse order
-g GREP, --grep GREP filter list of JSONs using this rules (can be added
more then once)
-v, --version show version and exit
--sort-keys sort keys in printed JSONs (default: not sorted)
--indent INDENT indent JSONs with INDENT spaces
--color {auto,always,never}
manipulate colorizing of JSONs (default: auto)

Argument to --grep option should be in format:
field:value:modifier
Where:
- "field" must be in all JSONs.
- "value" is value to search
- "modifier" is optional, and say how to treat "value": allowed
options are: s (string - default), b (boolean), i (integer), f (float)

Installation
------------

`jsontool` should work on any platform where [Python](http://python.org) is available, it means Linux, Windows, MacOS X etc. There is no required dependencies, plain Python power :)

To install, simply use `pip`:

pip install jsontool

If you do not want to use `pip` tool, then go to [GitHub releases](https://github.com/mysz/jsontool/releases), download newest release, unpack and put somewhere in `PATH` (ie. `~/bin` or `/usr/local/bin`).

If You want to install newest unstable version, then just copy file to your PATH, for example:

curl https://raw.github.com/mysz/jsontool/master/jsontool.py > /usr/local/bin/jsontool

or:

wget https://raw.github.com/mysz/jsontool/master/jsontool.py -O /usr/local/bin/jsontool

Voila!

Authors
-------

Marcin Sztolcman <marcin@urzenia.net>

Contact
-------

If you like or dislike this software, please do not hesitate to tell me about this me via email (marcin@urzenia.net).

If you find bug or have an idea to enhance this tool, please use GitHub's [issues](https://github.com/mysz/jsontool/issues).

License
-------

The MIT License (MIT)

Copyright (c) 2014 Marcin Sztolcman

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.

ChangeLog
---------

### v0.2.0

* renamed --field argument to --sort-by
* more formatting options (--sort-keys, --indent)
* allow to disable colorizing
* allow to not sort at all
* allow to sort reversed
* documentation and help added

### v0.1.0

* initial version

Metadata

Release files for jsontool 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jsontool 0.2.1
File Size Uploaded
jsontool-0.2.1.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jsontool 0.2.1
File Interpreter ABI Platform
jsontool-0.2.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 13.0 kB

Release files / jsontool-0.2.1.tar.gz

Download URL jsontool-0.2.1.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
efd31350f842f5139ce062768ed7faeed0df8636c5688d0b961e848978a9252f
BLAKE2b-256 checksum
How to use checksums
8ed2edbeaf269e54a45f14fb61f5beeb962700a375f9d858fcdb06b07796b2c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / jsontool-0.2.1-py2.py3-none-any.whl

Download URL jsontool-0.2.1-py2.py3-none-any.whl
Size 8.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
42c49ea0d3abc1d173725f6e3e181b7c9c8c5c0098a4680701b05e0f2c7334ec
BLAKE2b-256 checksum
How to use checksums
f3ebc22e08278629dd84e368402f81fed31054e625fd3ab89727409c2a4e308a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page