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]                                           │
│ --user-agent          -u                TEXT                             Set custom User-Agent header for HTTP requests [default: None]                           │
│ --user-agent-random                                                      Use a random User-Agent header                                                           │
│ --timeout             -t                INTEGER                          Timeout in seconds for HTTP requests [default: 30]                                       │
│ --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-1.0.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gronpy-1.0.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file gronpy-1.0.0.tar.gz.

File metadata

  • Download URL: gronpy-1.0.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.10.16 Linux/6.8.0-1021-azure

File hashes

Hashes for gronpy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1b133b3ffe9830c5d9b12d4671c31c34607b378dc89a0f797bd6f535260026f5
MD5 fc782626183998f1cf993379309c3104
BLAKE2b-256 5d84566147d887df8ede4d71ee30365ea46d64273f0385a11a9605f43ff2f223

See more details on using hashes here.

File details

Details for the file gronpy-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: gronpy-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.10.16 Linux/6.8.0-1021-azure

File hashes

Hashes for gronpy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 31e3637b3e9f1cc5b0f6d9330ebd41a529dcbc0a7a00fa8ee306b6aa942dd588
MD5 4b9445d520e050f886a6c36d2de06980
BLAKE2b-256 b338528355c0e0c754dd93c6322d0f59adf75e3f37c1e635a80e7a23a742dd70

See more details on using hashes here.

Supported by

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