{ "info": { "author": "Fabien Fleutot", "author_email": "fleutot+jsview@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2" ], "description": "Copyright (c) 2016-2018 Fabien Fleutot.\n\nThis software is made available under the\n[MIT public license](https://opensource.org/licenses/MIT).\n\n(Kind-of) smart JSON formatter.\n\nEvery JSON formatter I've found inserts newline + indent at every\nlist item and every object pair. As a result, instead of being\nunreadable because it's too large (in a single line), the resulting\nJSON is unreadable because too tall (too many newlines), especially\nwhen dealing with formats like GeoJSON where long lists of\ncoordinates are handled.\n\nThis formatter works with a page width in mind, by default 80, and\ntries to optimize screen space usage in both width and height.\n\n# Installation\n\n pip install jsview\n\n# Usage\n\n```\njsview.py [-h] [-w WIDTH] [-i INDENT] [-o OUTPUT] [-l] [-u] [-r] filename\n\nFormat JSON inputs with smart line-returns and indendation.\n\npositional arguments:\n filename Input file; use '-' to read from stdin\n\noptional arguments:\n -h, --help show this help message and exit\n -w WIDTH, --width WIDTH\n Set the ideal width of the output text; if unspecified,\n try to fit the terminal's width as returned by stty.\n -i INDENT, --indent INDENT\n Indentation, in number of space characters; default=2\n -o OUTPUT, --output OUTPUT\n Output file; defaults to stdout\n -l, --close-on-same-line\n When set, further lines are saved by closing lists and\n objects on the same line as the last element.\n -u, --utf8-output Output strings as UTF8 rather than ASCII 7 bits\n -r, --reformat When set, file content is replaced by a reformatted\n version. File must not be '-'.\n```\n\n# Example\n\nBelow is the result of formatting a non-trivial JSON input to 80 characters wide:\n\n```\n{\n \"crs\": {\"type\": \"name\", \"properties\": {\"name\": \"urn:ogc:def:crs:EPSG::4326\"}},\n \"totalFeatures\": 116570,\n \"type\": \"FeatureCollection\",\n \"features\": [\n {\n \"geometry\": {\n \"type\": \"Polygon\",\n \"coordinates\": [\n [[-3.59, 48.28], [-3.57, 48.28], [-3.54, 48.28], [-3.53, 48.26],\n [-3.51, 48.25], [-3.49, 48.24], [-3.47, 48.22], [-3.48, 48.21],\n [-3.5, 48.2], [-3.5, 48.18], [-3.48, 48.17], [-3.49, 48.15],\n [-3.52, 48.15], [-3.53, 48.14], [-3.56, 48.14], [-3.58, 48.14],\n [-3.59, 48.15], [-3.58, 48.17], [-3.58, 48.19], [-3.57, 48.21],\n [-3.57, 48.23], [-3.58, 48.25], [-3.6, 48.26], [-3.59, 48.28],\n [-3.59, 48.28]]]\n },\n \"properties\": {\n \"lastrevision\": \"2016-02-17T15:40:00Z\",\n \"probability\": 0,\n \"convectiontype\": \"ASPOC3D\",\n \"directiontowards\": 90.06896,\n \"top\": 310,\n \"phasetype\": null,\n \"convectioncelltopvariation\": \"CONSTANT\",\n \"intensity\": \"LIGHT\",\n \"base\": 0,\n \"identifier\": \"OPIC_RADAR.1.201602171540000060_310\",\n \"speed\": 9.1,\n \"obsorfcsttime\": \"2016-02-17T16:40:00Z\"\n },\n \"type\": \"Feature\",\n \"id\": \"convectionAirm.3449590\",\n \"geometry_name\": \"extent\"\n }\n ]\n}\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/fab13n/jsview", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "jsview", "package_url": "https://pypi.org/project/jsview/", "platform": "", "project_url": "https://pypi.org/project/jsview/", "project_urls": { "Homepage": "https://github.com/fab13n/jsview" }, "release_url": "https://pypi.org/project/jsview/1.1/", "requires_dist": null, "requires_python": "", "summary": "A smarter JSON indenter", "version": "1.1" }, "last_serial": 4406700, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "e75e1d1fa0f2997a87a96dfd92b6285e", "sha256": "485208869f7c8e02538eda7f1c9567032a7195abf4283e1e4392e8f13355e5e3" }, "downloads": -1, "filename": "jsview-1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "e75e1d1fa0f2997a87a96dfd92b6285e", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 9535, "upload_time": "2018-06-12T13:22:43", "url": "https://files.pythonhosted.org/packages/45/e5/b86d5b70bd8afeb6bf7a98d218034d0d9b6615990a5c63f48d1523666b39/jsview-1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "50733a0b62671fde2a9332d0e27fbe71", "sha256": "d64441baf5ee54357adeb11d3b0997a4abb1b0ad4040ddc255f3e360b1585abd" }, "downloads": -1, "filename": "jsview-1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "50733a0b62671fde2a9332d0e27fbe71", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9535, "upload_time": "2018-06-12T13:28:00", "url": "https://files.pythonhosted.org/packages/de/6f/3ebdc446ccabe2730a93889c7bef9271274f90cc59b054290d0178ffdd8c/jsview-1.0-py3-none-any.whl" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "016eaff4f2ac6834bcef6ce8deb02c77", "sha256": "a44bcd42c158ce5cab67b4c0adfbc918a36f96c8054c6f1ead3ddbf1394074af" }, "downloads": -1, "filename": "jsview-1.1.tar.gz", "has_sig": false, "md5_digest": "016eaff4f2ac6834bcef6ce8deb02c77", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6597, "upload_time": "2018-10-23T14:38:35", "url": "https://files.pythonhosted.org/packages/a3/d5/03cb183e8ce51ac61d72468caac971f6d7816113267b10cabb84bdfddb63/jsview-1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "016eaff4f2ac6834bcef6ce8deb02c77", "sha256": "a44bcd42c158ce5cab67b4c0adfbc918a36f96c8054c6f1ead3ddbf1394074af" }, "downloads": -1, "filename": "jsview-1.1.tar.gz", "has_sig": false, "md5_digest": "016eaff4f2ac6834bcef6ce8deb02c77", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6597, "upload_time": "2018-10-23T14:38:35", "url": "https://files.pythonhosted.org/packages/a3/d5/03cb183e8ce51ac61d72468caac971f6d7816113267b10cabb84bdfddb63/jsview-1.1.tar.gz" } ] }