This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

jsongrep is a shell tool for extracting values from JSON documents. It supports shell-like globbing for property names, and emits the matched values separated by newlines.


Let’s start with a real-world example.

Let’s grab the even tweets from the last 10 pulled from Twitter’s JSON feed

$ curl -s '' | jsongrep '[02468].text'
ARGHHHHHH. facebook is being gay
5-5 in the darts between Barney and Whitlock. Amazing. #darts
I wonder if I'm still located on 5th ave?
Estou de volta  a internet .... Essa chuva n para !   Estou de boa com a minha familia .

Yeah, that’s just about what I expected.

Now suppose you have a JSON document like the one in tests/ongz.json which looks like this:

    "bah" : {
        "feh" : true,
        "foo" : 3,
        "lah" : "songz"
    "blah" : {
        "lol" : "gongz"
    "arr" : [
        "a", "b", "c", "d", "e",
        "f", "g", "h", "i", "j",
        "k", "l", "m", "n", "o",
        "p", "q", "r", "s", "t",
        "u", "v", "w", "x", "y",

jsongrep will let you match structural patterns, where . (dot) separates nested properties.

Let’s glob on property names:

$ jsongrep 'b*.l*' tests/ongz.json

Works on arrays, too:

$ jsongrep 'arr.?' tests/ongz.json

Note that we’re still globbing, even though arrays have numeric indices:

$ jsongrep 'arr.2?' tests/ongz.json

If you specify a JSON subtree, that’s what you get back:

$ jsongrep 'bah' tests/ongz.json
{"foo": 3, "lah": "songz", "feh": true}


jsongrep currently supports normal shell glob patterns within property names:

?       Matches any one character
*       Matches any number of characters within a field
[seq]   Matches any of the characters in seq
[!seq]  Matches any of the characters not in seq

Dot is the field separator.


Usage: jsongrep [options] [PATTERN | -e PATTERN [-e PATTERN ...]] [FILE]

Parses JSON data structurally to select a subset of data.

  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -e PATTERNS, --pattern=PATTERNS
                        Additional patterns to match.
  -D, --detect-encoding
                        Attempts to detect the character encoding of input if
                        LC_TYPE and file.encoding provide insufficient hints.
                        (Slow) [default: False]


  • Support star-star (**) non-greedy matches of spanning subgraphs
  • Support unicode, escapes in patterns
  • Support extended regexps
  • Support no-pattern-matching lookup
  • Options:
    • Property separator in patterns (. by default)
    • Output separator (newline by default)
    • Quote string values in output?
    • 1/0 vs true/false for bool values in output?


Open a ticket at , or send me an email at .

Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
jsongrep-0.1.1.tar.gz (10.9 kB) Copy SHA256 Checksum SHA256 Source Jan 28, 2010 (17.8 kB) Copy SHA256 Checksum SHA256 Source Jan 28, 2010

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting