Skip to main content

A Python port of `gron`

Project description

Gronpy

A Python port of gron to make JSON greppable.

Installation

The recommended way to install is to use pipx:

pipx install gronpy

Usage

 % gronpy --help

 Usage: gronpy [OPTIONS] [INPUT_PATH]

╭─ Arguments ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│   input_path      [INPUT_PATH]  Input file path or URL. If not specified uses stdin. [default: (stdin)]                                                           │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --gron                    --ungron                                       Transform JSON into GRON or back again [default: gron]                                   │
│ --color                   --no-color                                     Enable colouring in terminal. [default: color]                                           │
│ --version             -v                                                                                                                                          │
│ --install-completion                    [bash|zsh|fish|powershell|pwsh]  Install completion for the specified shell. [default: None]                              │
│ --show-completion                       [bash|zsh|fish|powershell|pwsh]  Show completion for the specified shell, to copy it or customize the installation.       │
│                                                                          [default: None]                                                                          │
│ --help                                                                   Show this message and exit.                                                              │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Example

% gronpy "https://api.tvmaze.com/schedule?country=GB" | grep "show.name" | grep -i "news"
json[34].show.name = "Newsround";
json[40].show.name = "Channel 4 News Summary";
json[43].show.name = "BBC News at One";
json[44].show.name = "ITV Lunchtime News";
json[45].show.name = "5 News Lunchtime";
json[53].show.name = "5 News";
json[56].show.name = "BBC News at Six";
json[58].show.name = "ITV Evening News";
json[59].show.name = "Channel 4 News";
json[76].show.name = "ITV News at Ten";
json[77].show.name = "Newsnight";

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

gronpy-0.1.2.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

gronpy-0.1.2-py3-none-any.whl (4.7 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