Skip to main content

Filtering JSON dict keys from STDOUT

Project description

json-grep

Description

Simple tool for filtering JSON dict keys from STDOUT

Usage

json-grep --help
usage: json-grep [-h] [-e EXCLUDE_KEYS] [-m] [-v] [-l HIGHLIGHT] [-i IHIGHLIGHT] [-s] [-f INPUT_FILE] filter_keys [filter_keys ...]

JSON GREP v1.3.2 is utility for filtering selected keys from json string piped from STDOUT

positional arguments:
  filter_keys           List of keys which you want to filter from json dict. If key is in deeper level of tree structure use '.' separator to specify how deep is key in dict tree structure. You can also use '*' at the end of key name to filter keys as 'beginning with'. You can also specify value of item which you want to pass only by operator '=' or
                        '~'. '~' means that value is somewhere in string.

options:
  -h, --help            show this help message and exit
  -e EXCLUDE_KEYS, --exclude EXCLUDE_KEYS
                        Exclude lines contains key or key=value combination
  -m, --multiline-output
                        Use multiline output for filtered result
  -v, --values_only     Show only values without keys description
  -l HIGHLIGHT, --hl HIGHLIGHT
                        Highlight case sensitively words in filtered results
  -i IHIGHLIGHT, --ihl IHIGHLIGHT
                        Highlight case insensitively words in filtered results
  -s, --show-errors     Show errors caused by json decode
  -p, --pass-non-json   Pass non json lines into stdout
  -f INPUT_FILE, --file INPUT_FILE
                        Input file instead of PIPE

Installation

wget https://gitlab.com/alda78/json-grep/-/archive/master/json-grep-master.tar && \
tar -xf json-grep-master.tar && \
cd json-grep-master/ && \
sudo python3 setup.py install && \
cd ../ &&  \
sudo rm -rf json-grep-master

or simply

pip3 install json-grep

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

json-grep-1.3.3.tar.gz (5.7 kB view hashes)

Uploaded Source

Built Distribution

json_grep-1.3.3-py3-none-any.whl (6.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page