{ "info": { "author": "David Schoonover", "author_email": "dsc@less.ly", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development", "Topic :: Software Development :: Libraries", "Topic :: Utilities" ], "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.\n\n\nExamples\n--------\n\nLet's start with a real-world example.\n\nLet's grab the even tweets from the last 10 pulled from Twitter's JSON feed http://apiwiki.twitter.com/Twitter-REST-API-Method:-statuses-public_timeline ::\n\n $ curl -s 'http://twitter.com/statuses/public_timeline.json' | jsongrep '[02468].text'\n ARGHHHHHH. facebook is being gay\n 5-5 in the darts between Barney and Whitlock. Amazing. #darts\n I wonder if I'm still located on 5th ave?\n Estou de volta a internet .... Essa chuva n para ! Estou de boa com a minha familia .\n\nYeah, that's just about what I expected.\n\nNow suppose you have a JSON document like the one in ``tests/ongz.json`` which looks like this::\n\n {\n \"bah\" : {\n \"feh\" : true,\n \"foo\" : 3,\n \"lah\" : \"songz\"\n },\n \"blah\" : {\n \"lol\" : \"gongz\"\n },\n \"arr\" : [\n \"a\", \"b\", \"c\", \"d\", \"e\", \n \"f\", \"g\", \"h\", \"i\", \"j\", \n \"k\", \"l\", \"m\", \"n\", \"o\", \n \"p\", \"q\", \"r\", \"s\", \"t\", \n \"u\", \"v\", \"w\", \"x\", \"y\", \n \"z\"\n ]\n }\n\njsongrep will let you match structural patterns, where ``.`` (dot) separates nested properties.\n\nLet's glob on property names::\n\n $ jsongrep 'b*.l*' tests/ongz.json\n gongz\n songz\n\nWorks on arrays, too::\n\n $ jsongrep 'arr.?' tests/ongz.json\n a\n b\n c\n d\n e\n f\n g\n h\n i\n j\n\nNote that we're still globbing, even though arrays have numeric indices::\n\n $ jsongrep 'arr.2?' tests/ongz.json\n u\n v\n w\n x\n y\n z\n\nIf you specify a JSON subtree, that's what you get back::\n\n $ jsongrep 'bah' tests/ongz.json\n {\"foo\": 3, \"lah\": \"songz\", \"feh\": true}\n\n\nSyntax\n------\n\njsongrep currently supports normal shell glob patterns within property names::\n\n ? Matches any one character\n * Matches any number of characters within a field\n [seq] Matches any of the characters in seq\n [!seq] Matches any of the characters not in seq\n\nDot is the field separator.\n\n\nUsage\n-----\n\n::\n\n Usage: jsongrep [options] [PATTERN | -e PATTERN [-e PATTERN ...]] [FILE]\n\n Parses JSON data structurally to select a subset of data.\n\n Options:\n --version show program's version number and exit\n -h, --help show this help message and exit\n -e PATTERNS, --pattern=PATTERNS\n Additional patterns to match.\n -D, --detect-encoding\n Attempts to detect the character encoding of input if\n LC_TYPE and file.encoding provide insufficient hints.\n (Slow) [default: False]\n\n\nTODO\n----\n\n* Support star-star (``**``) non-greedy matches of spanning subgraphs\n* Support unicode, escapes in patterns\n* Support extended regexps\n* Support no-pattern-matching lookup\n* Options:\n * Property separator in patterns (. by default)\n * Output separator (newline by default)\n * Quote string values in output?\n * 1/0 vs true/false for bool values in output?\n\n\nFeedback\n--------\n\nOpen a ticket at http://github.com/dsc/jsongrep , or send me an email at dsc@less.ly .", "description_content_type": null, "docs_url": null, "download_url": "http://pypi.python.org/packages/source/j/jsongrep/jsongrep-0.1.1.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://tire.less.ly/hacking/jsongrep", "keywords": "jsongrep,json,grep,search,console,cli,shell", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "jsongrep", "package_url": "https://pypi.org/project/jsongrep/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/jsongrep/", "project_urls": { "Download": "http://pypi.python.org/packages/source/j/jsongrep/jsongrep-0.1.1.tar.gz", "Homepage": "http://tire.less.ly/hacking/jsongrep" }, "release_url": "https://pypi.org/project/jsongrep/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "Search and select bits out of a JSON document.", "version": "0.1.1" }, "last_serial": 793821, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "6d77fe5a1f5388fd96c2fcb7581fe968", "sha256": "8412de2a69788c28f4fa6f0310a885563b328925ea21b66baffb78a866be4521" }, "downloads": -1, "filename": "jsongrep-0.1.1.tar.gz", "has_sig": false, "md5_digest": "6d77fe5a1f5388fd96c2fcb7581fe968", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10942, "upload_time": "2010-01-28T19:13:43", "url": "https://files.pythonhosted.org/packages/90/14/00913ddcd459b8d4e51e881608b708c6bb7abcb9ee9362cb15b9b80024df/jsongrep-0.1.1.tar.gz" }, { "comment_text": "", "digests": { "md5": "86b84ee5b0fefcbf182831fa42ce12e1", "sha256": "5a2c7eb4c4f85aea5cb1ab3963747264d2262abdf9b9454d7eb377a7d2b377ce" }, "downloads": -1, "filename": "jsongrep-0.1.1.zip", "has_sig": false, "md5_digest": "86b84ee5b0fefcbf182831fa42ce12e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17759, "upload_time": "2010-01-28T19:13:42", "url": "https://files.pythonhosted.org/packages/bd/7b/df1163a4b56ecc698b118c4e359b9fc773d69628067eba188b6fb281d575/jsongrep-0.1.1.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6d77fe5a1f5388fd96c2fcb7581fe968", "sha256": "8412de2a69788c28f4fa6f0310a885563b328925ea21b66baffb78a866be4521" }, "downloads": -1, "filename": "jsongrep-0.1.1.tar.gz", "has_sig": false, "md5_digest": "6d77fe5a1f5388fd96c2fcb7581fe968", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10942, "upload_time": "2010-01-28T19:13:43", "url": "https://files.pythonhosted.org/packages/90/14/00913ddcd459b8d4e51e881608b708c6bb7abcb9ee9362cb15b9b80024df/jsongrep-0.1.1.tar.gz" }, { "comment_text": "", "digests": { "md5": "86b84ee5b0fefcbf182831fa42ce12e1", "sha256": "5a2c7eb4c4f85aea5cb1ab3963747264d2262abdf9b9454d7eb377a7d2b377ce" }, "downloads": -1, "filename": "jsongrep-0.1.1.zip", "has_sig": false, "md5_digest": "86b84ee5b0fefcbf182831fa42ce12e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17759, "upload_time": "2010-01-28T19:13:42", "url": "https://files.pythonhosted.org/packages/bd/7b/df1163a4b56ecc698b118c4e359b9fc773d69628067eba188b6fb281d575/jsongrep-0.1.1.zip" } ] }