{ "info": { "author": "Alex Hall", "author_email": "alex.mojaki@gmail.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Utilities" ], "description": "``jsonfinder`` lets you find and extract JSON objects and arrays embedded within a string using a simple iterator. For example::\n\n >>> s = 'jack [1,2,3] john'\n >>> for start, end, obj in jsonfinder(s):\n ... print start, ':', end\n ... if obj is None:\n ... print 'String:', repr(s[start:end])\n ... else:\n ... print 'List of length', len(obj)\n 0 : 5\n String: 'jack '\n 5 : 12\n List of length 3\n 12 : 17\n String: ' john'\n >>> assert len(s) == end\n\nTwo other convenience methods are also provided: ``has_json`` and ``only_json``::\n\n >>> has_json('stuff {\"key\": \"value\"} things')\n True\n >>> has_json('stuff only')\n False\n >>> only_json('stuff {\"key\": \"value\"} things')[2]\n {u'key': u'value'}\n >>> only_json('stuff only')\n Traceback (most recent call last):\n ...\n ValueError: No JSON object found in argument.\n >>> only_json('{}{}')\n Traceback (most recent call last):\n ...\n ValueError: More than one JSON object found in the argument.\n\nAll the methods allow a custom JSONDecoder to be passed in for flexibility.\n\nThe library also includes a command-line tool to format JSON and filter out parts of the input based on whether JSON is present.\nIt's like a more flexible version of python's built in ``json.tool``, a ``grep -v`` for JSON, and more. For example::\n\n $ cat cli_example.txt\n This line contains no JSON and will be deleted by the --delete other-lines option.\n On the other hand {\"json\": [\"is\", \"formatted\"] } and text surrounding it is preserved (but can also be removed if desired).\n $ jsonfinder -i cli_example.txt --delete other-lines\n On the other hand {\n \"json\": [\n \"is\",\n \"formatted\"\n ]\n } and text surrounding it is preserved (but can also be removed if desired).\n $ jsonfinder -i cli_example.txt --delete other-lines | jsonfinder --delete context --format tiny\n {\"json\":[\"is\",\"formatted\"]}\n\nSee the ``--help`` option in the command-line for more details.\n\nInstallation is as simple as::\n\n pip install jsonfinder", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/alexmojaki/jsonfinder", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "jsonfinder", "package_url": "https://pypi.org/project/jsonfinder/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/jsonfinder/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/alexmojaki/jsonfinder" }, "release_url": "https://pypi.org/project/jsonfinder/0.4.2/", "requires_dist": null, "requires_python": null, "summary": "Easily handle JSON contained within strings.\nIncludes a command-line tool to format JSON within the input, similar to the builtin json.tool.", "version": "0.4.2" }, "last_serial": 2724111, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "ca2deaba903a72618796c5c2d8834295", "sha256": "ac23509cbf748f36b210083c6175b1b9d1fa1078772b83c15eb234b437e77aa4" }, "downloads": -1, "filename": "jsonfinder-0.1.tar.gz", "has_sig": false, "md5_digest": "ca2deaba903a72618796c5c2d8834295", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1672, "upload_time": "2015-02-27T00:05:01", "url": "https://files.pythonhosted.org/packages/c1/4c/7cc359c665b64976f603676c6678d1d9827f8dc8190569e06fb925d7ca24/jsonfinder-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "fa387f5aa2f2482e60315a398fb3c885", "sha256": "3639cb2c0be67dc52f97b532a329e3be151ce62c7fe11f35194bea04deae2ec3" }, "downloads": -1, "filename": "jsonfinder-0.2.tar.gz", "has_sig": false, "md5_digest": "fa387f5aa2f2482e60315a398fb3c885", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7702, "upload_time": "2015-03-08T22:00:09", "url": "https://files.pythonhosted.org/packages/28/26/91ac9c6439161589c6733f71873a358b0f7516d6d07ef2fa5f2e8be93fce/jsonfinder-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "277b7a9bff927067a28cb325f8c19d7e", "sha256": "d46c7d55e859e0ffe1682ee68cc6b8c73c2b5f873667d83ccddee013fd8093ef" }, "downloads": -1, "filename": "jsonfinder-0.2.1.tar.gz", "has_sig": false, "md5_digest": "277b7a9bff927067a28cb325f8c19d7e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7703, "upload_time": "2015-03-08T22:00:51", "url": "https://files.pythonhosted.org/packages/9c/6b/2aeedd0fbde0054e4e51f744d8b7dc68ae8a0b1b5896de204946848f3253/jsonfinder-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "b5e74190cd2f71fa378e4dfabe2f48c2", "sha256": "3977ac4f2a372bd07166ad1279218c53e41a6fe2a9b9d1e0378c84e55cff7248" }, "downloads": -1, "filename": "jsonfinder-0.3.0.tar.gz", "has_sig": false, "md5_digest": "b5e74190cd2f71fa378e4dfabe2f48c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8627, "upload_time": "2015-03-27T07:48:39", "url": "https://files.pythonhosted.org/packages/34/21/4b2075c5a12bc5a16ecbfbbf0890ce779a0826e485ebec8145aaf00a3bcf/jsonfinder-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "381db3524aeff772e3ba210c91cca023", "sha256": "a60965cee781c43fbde792bdeb5db5f04adc4707269c79a95dde5e11459a172d" }, "downloads": -1, "filename": "jsonfinder-0.4.0.tar.gz", "has_sig": false, "md5_digest": "381db3524aeff772e3ba210c91cca023", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9403, "upload_time": "2015-03-30T12:11:09", "url": "https://files.pythonhosted.org/packages/6f/e6/a6e1ef65226564bdfc0b2a2eced02ce0c06999f5e42a09fd64462a1ff94f/jsonfinder-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "3018d50afb8cca9ae85b06fc23bc8a64", "sha256": "0c4e825fe8b02ff153375303131aa08041c53dd748b280666cb6c4f83403cdc3" }, "downloads": -1, "filename": "jsonfinder-0.4.1.tar.gz", "has_sig": false, "md5_digest": "3018d50afb8cca9ae85b06fc23bc8a64", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9409, "upload_time": "2015-04-07T11:38:58", "url": "https://files.pythonhosted.org/packages/51/78/4a9d3c5f50f99bf7a566f526c1c92d67b4d07881933b6dd4634add3e8088/jsonfinder-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "7ff67d7e0b67a2ce2a430612a4ae71cb", "sha256": "9845ca2d1e54aa007a2a72aaa07dcc90f516587cfe40cb6df214c9cf19bc1f6f" }, "downloads": -1, "filename": "jsonfinder-0.4.2.tar.gz", "has_sig": false, "md5_digest": "7ff67d7e0b67a2ce2a430612a4ae71cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9535, "upload_time": "2017-03-22T19:38:08", "url": "https://files.pythonhosted.org/packages/9b/1b/4590d10d1770f319dd79330cf9cb0feb4a7c4b5ff27c4cfc2d543d291898/jsonfinder-0.4.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7ff67d7e0b67a2ce2a430612a4ae71cb", "sha256": "9845ca2d1e54aa007a2a72aaa07dcc90f516587cfe40cb6df214c9cf19bc1f6f" }, "downloads": -1, "filename": "jsonfinder-0.4.2.tar.gz", "has_sig": false, "md5_digest": "7ff67d7e0b67a2ce2a430612a4ae71cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9535, "upload_time": "2017-03-22T19:38:08", "url": "https://files.pythonhosted.org/packages/9b/1b/4590d10d1770f319dd79330cf9cb0feb4a7c4b5ff27c4cfc2d543d291898/jsonfinder-0.4.2.tar.gz" } ] }