{ "info": { "author": "Vlad-George Ardelean", "author_email": "vlad.george.ardelean@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "=============\nDescribe JSON\n=============\n\n\n.. image:: https://img.shields.io/pypi/v/describe_json.svg\n :target: https://pypi.python.org/pypi/describe_json\n\n.. image:: https://img.shields.io/travis/vladiibine/describe_json.svg\n :target: https://travis-ci.org/vladiibine/describe_json\n\n.. image:: https://readthedocs.org/projects/describe-json/badge/?version=latest\n :target: https://describe-json.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n\nTired of looking at JSON objects that contain long arrays? Fear no more!\ndescribe_json basically displays your JSON, replacing any arrays with a dictionary that just describes the array.\n\n\n\n* Free software: MIT license\n* Documentation: https://describe-json.readthedocs.io.\n\n\nInstallation\n------------\n$ pip install describe_json\n\n\nFeatures\n--------\nThis library does 2 things\n\n* Shortens strings. It also displays their length and a md5 hash, so you can know whether multiple strings are equal\n* Displays the length of arrays, and only 1 element, as an example. If arrays have differing elements, too bad, it only displays one element, so you'll never know what the others look like. You can use the `-r` flag, to get a random array element though.\n\nUsage\n-----\nFirst of all, the tool plays really nicely with `jq`. Use `jq` to format the output of describe_json\n\n::\n\n $ describe_json '{\"my\": [\"json\", \"object\"]}'|jq .\n {\n \"my\": [\n \"length: 2; example:\",\n \"json\"\n ]\n }\n\nOutputting jq full paths for later inspection\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nIf you took a look at your JSON, and found the data you were looking for, \nbut getting to it with jq will now require a lot of incremental approaches such as \nthe following, you might as well just make `describe_json` help you with that.\nIt can automatically calculate the `jq` path, so you don't have to scroll up anymore!\n\n::\n\n $ echo '{\"a\": {\"b\": [{\"c\": 1}]}}' | jq '.a'\n $ echo '{\"a\": {\"b\": [{\"c\": 1}]}}' | jq '.a.b'\n $ echo '{\"a\": {\"b\": [{\"c\": 1}]}}' | jq '.a.b[0]'\n $ echo '{\"a\": {\"b\": [{\"c\": 1}]}}' | jq '.a.b[0].c'\n\n\nInstead of the above, just use the -j flag, and you'll see full paths for all dict keys\n\n::\n\n $ describe_json '{\"a\": {\"b\": [{\"c\": 1}]}}' -j\n {'.a': {'.a.b': [{'.a.b[0].c': 1}]}}\n\n\n\nBasic piping\n^^^^^^^^^^^^\n\n::\n\n $ echo '{\"a\": [1, 2, 3, 4]}' | describe_json\n {\"a\": [\"length: 4; example:\", 1]}\n\nBasic array shortening\n^^^^^^^^^^^^^^^^^^^^^^\n\n::\n\n $ describe_json '{\"a\": [1, 2, 3, 4]}'\n {\"a\": [\"length: 4; example:\", 1]}\n\n\nDo you have some super long strings?\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n::\n\n $ describe_json '{\"key\": \"suuuuuuuuuuuuuper long string\"}'\n {\"key\": \"suuuuuuuuu... len: 29, md5: b7d562a2bcec0a8a346b5f32c59f257f\"}\n\n...ok, in this case the output is longer than the string. But you'll be happier when the string is 50K long\n\nUse a .json file\n^^^^^^^^^^^^^^^^^^^^^\n::\n\n $ cat example.json \n {\"key1\": [\"a\", \"b\", \"c\"]}\n $ describe_json -f example.json \n {\"key1\": [\"length: 3; example:\", \"a\"]}\n\n\nUse a random array element\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nBy default, the first element of an array is displayed. Use a random one?\n\n::\n\n $ describe_json -r {\"key1\": [\"a\", \"b\", \"c\"]}\n {\"key1\": [\"length: 3; example:\", \"b\"]}\n\nSpecify a maximum array length\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nBy default, only one element is displayed from an array. Specify the maximum size of arrays, after which, they are displayed as shortened\n\n::\n\n $ describe_json -a 3 '{\"key1\": [\"a\", \"b\", \"c\"]}'\n {\"key1\": [\"a\", \"b\", \"c\"]}\n\nSpecify a maximum string length\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nBy default, strings longer than 10 characters are truncated, and their md5 hash is shown (so you can see whether multiple strings that begin with the same characters are equal or not). Specify a maximum length for strings\n\n::\n\n $ describe_json -s 30 '{\"key\": \"qwertyuiopasdfghjklzxcvbnm\"}\n {\"key\": \"qwertyuiopasdfghjklzxcvbnm\"}\n\n\nand that's about it! :)\n\nTesting it in development mode\n------------------------------\nThere are only doctests for the moment. They will be ran as 1 unit test, but don't worry, there are more than just 1 test.\n\n::\n\n $ python setup.py test\n\n\n\nCredits\n-------\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n\n\n=======\nHistory\n=======\n\n0.1.0 (2019-03-31)\n------------------\n\n* First release on PyPI.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/vladiibine/describe_json", "keywords": "describe_json", "license": "MIT license", "maintainer": "", "maintainer_email": "", "name": "describe-json", "package_url": "https://pypi.org/project/describe-json/", "platform": "", "project_url": "https://pypi.org/project/describe-json/", "project_urls": { "Homepage": "https://github.com/vladiibine/describe_json" }, "release_url": "https://pypi.org/project/describe-json/0.1.5/", "requires_dist": null, "requires_python": "", "summary": "Tired of looking at JSON objects that contain long arrays? Fear no more!", "version": "0.1.5" }, "last_serial": 5256167, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "3586e7bf96fc1d0b00ce2d99995d232b", "sha256": "ec3940850d1703d6d541805a0ddfc6f79b1a54d3433552aa65dfd0b8a0883a3a" }, "downloads": -1, "filename": "describe_json-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "3586e7bf96fc1d0b00ce2d99995d232b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3815, "upload_time": "2019-03-31T17:10:46", "url": "https://files.pythonhosted.org/packages/4f/8e/caf624d85ce837405f21e1c7d12011cf73484203f6f1039bdd9b9e2cda63/describe_json-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c7c59b3aad672f18175deddf13cca312", "sha256": "fdefb929c4fc7bf1ee15055177c5fcb04752d85b5cba8c4f2f0142f0f9c2fcf7" }, "downloads": -1, "filename": "describe_json-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c7c59b3aad672f18175deddf13cca312", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8064, "upload_time": "2019-03-31T17:10:48", "url": "https://files.pythonhosted.org/packages/ab/f7/b16ba99171ba297c20770a6457451b692e2dd918551c3bb40e6082524817/describe_json-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "879db64c9608cc6ecadf9f31a3f3f450", "sha256": "b5bee0fa06ab2c76a52f4215a1928b9f80ebfbe3c60aaa72c60dafb9aa190b81" }, "downloads": -1, "filename": "describe_json-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "879db64c9608cc6ecadf9f31a3f3f450", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5374, "upload_time": "2019-03-31T17:17:38", "url": "https://files.pythonhosted.org/packages/4b/cd/a525d4ff156d9a7bd8b6077779e7dddfe1824e0d66db29527845bf62cd35/describe_json-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "170b0368ca51cf234e649a941c42b9cc", "sha256": "e27dfa93e5801e5bba0f20352ef9fa41aa3998448dc5e77e46be880e40b54a02" }, "downloads": -1, "filename": "describe_json-0.1.1.tar.gz", "has_sig": false, "md5_digest": "170b0368ca51cf234e649a941c42b9cc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9383, "upload_time": "2019-03-31T17:17:40", "url": "https://files.pythonhosted.org/packages/9e/56/459a38f35e27b5b4df404f6e166b9e9d95c14c8390943597ef0240890c12/describe_json-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "b0b589995dda8df1f83d15c845535f50", "sha256": "fba038b9d48b5c865850851d3633ab79cc2b63e5caab00fe35e9d60c40aaf636" }, "downloads": -1, "filename": "describe_json-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b0b589995dda8df1f83d15c845535f50", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6220, "upload_time": "2019-04-02T05:36:42", "url": "https://files.pythonhosted.org/packages/68/b7/62c7bdc926519ff9c509c0637ecf0b77b8c37485b9e41772b087cff0c91c/describe_json-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e7c6aa4a3ea09df69a954bc3cab6611e", "sha256": "cadad2bfc4cbe184692f21a1e42ef42dc9120dda7c5164cec82ef93fd2b5f316" }, "downloads": -1, "filename": "describe_json-0.1.2.tar.gz", "has_sig": false, "md5_digest": "e7c6aa4a3ea09df69a954bc3cab6611e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9913, "upload_time": "2019-04-02T05:36:43", "url": "https://files.pythonhosted.org/packages/0a/47/8af8ae2b1a1843f91cf462ff9aa4df0bb5000e3a11c0df7447df8d40e1a1/describe_json-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "f70a61a9211976d64fc4b15b3c90a838", "sha256": "9f455aae1ca3d15044c1abbace5c6588d05397831ab19c2b2c04c37da5ccaab9" }, "downloads": -1, "filename": "describe_json-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f70a61a9211976d64fc4b15b3c90a838", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5587, "upload_time": "2019-04-02T20:22:53", "url": "https://files.pythonhosted.org/packages/3b/9c/27fd7db5e8405142286493605f17aa9ecc07566a1ae66123951e9f7d634d/describe_json-0.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "30de494e638ec54edb16be14303f75e4", "sha256": "5cd4f83a9fab12477d9abc7be97393e274b278dc8b179efd6e718c2af0a310e0" }, "downloads": -1, "filename": "describe_json-0.1.3.tar.gz", "has_sig": false, "md5_digest": "30de494e638ec54edb16be14303f75e4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11041, "upload_time": "2019-04-02T20:22:54", "url": "https://files.pythonhosted.org/packages/27/40/a740e3c39204a8e1960a3272827da1385a08c75ec7fff8cc865a690ce70e/describe_json-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "5078359e225ad7c408bceaee1845a60b", "sha256": "09bf44fb777b68188803571995271c4d618042acc73ec4dca7ea90971137f930" }, "downloads": -1, "filename": "describe_json-0.1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5078359e225ad7c408bceaee1845a60b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5997, "upload_time": "2019-04-02T21:05:12", "url": "https://files.pythonhosted.org/packages/d7/d2/e05aa173364c52d4ec4ea2f2828b8e359de0cb2f2d01ca8e6d3be4502377/describe_json-0.1.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2976ef37baf277eae154d57ed286f751", "sha256": "c32ebd04da41345a11670d5b04f42b225fb9e36b4b2814dd178bde25bdd30d4f" }, "downloads": -1, "filename": "describe_json-0.1.4.tar.gz", "has_sig": false, "md5_digest": "2976ef37baf277eae154d57ed286f751", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11436, "upload_time": "2019-04-02T21:05:14", "url": "https://files.pythonhosted.org/packages/89/65/5ff42f811ca6aff76cb9508291498a2ff2dee383f46babc98cdae6157f00/describe_json-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "701f789c1c548925e2f3df93d8039edc", "sha256": "a6c2db624392680d11750eecb53723ea0a3c47bcd55ee93411e6bf1441045057" }, "downloads": -1, "filename": "describe_json-0.1.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "701f789c1c548925e2f3df93d8039edc", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7920, "upload_time": "2019-05-11T14:02:38", "url": "https://files.pythonhosted.org/packages/b4/71/960aac96f1d51d0ad50d7db9d4629faf560e833859d4e98cfd2e19bef0f9/describe_json-0.1.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a0170291079c403366c830c6ec9f7e19", "sha256": "0dc0f793eebb72859049ea480ac85b53ecf8014b771eccc727e968e73722ce57" }, "downloads": -1, "filename": "describe_json-0.1.5.tar.gz", "has_sig": false, "md5_digest": "a0170291079c403366c830c6ec9f7e19", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11758, "upload_time": "2019-05-11T14:02:40", "url": "https://files.pythonhosted.org/packages/48/03/d13ff7c5a4730df2079fc3fbc510164590807a49c1ff04c1117416b770c4/describe_json-0.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "701f789c1c548925e2f3df93d8039edc", "sha256": "a6c2db624392680d11750eecb53723ea0a3c47bcd55ee93411e6bf1441045057" }, "downloads": -1, "filename": "describe_json-0.1.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "701f789c1c548925e2f3df93d8039edc", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7920, "upload_time": "2019-05-11T14:02:38", "url": "https://files.pythonhosted.org/packages/b4/71/960aac96f1d51d0ad50d7db9d4629faf560e833859d4e98cfd2e19bef0f9/describe_json-0.1.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a0170291079c403366c830c6ec9f7e19", "sha256": "0dc0f793eebb72859049ea480ac85b53ecf8014b771eccc727e968e73722ce57" }, "downloads": -1, "filename": "describe_json-0.1.5.tar.gz", "has_sig": false, "md5_digest": "a0170291079c403366c830c6ec9f7e19", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11758, "upload_time": "2019-05-11T14:02:40", "url": "https://files.pythonhosted.org/packages/48/03/d13ff7c5a4730df2079fc3fbc510164590807a49c1ff04c1117416b770c4/describe_json-0.1.5.tar.gz" } ] }