Name | prettify-json JSON |
Version |
0.1.1
JSON |
| download |
home_page | None |
Summary | make pretty json |
upload_time | 2024-07-01 16:51:45 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.6 |
license | None |
keywords |
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
prettify-json
===========
make pretty json.
Documentation: https://github.com/VeritasXu/prettify-json
Installation
------------
```
pip install prettify-json
```
Usage
-----
```python
import json
import prettify_json as pj
# raw contents for json
boxes = [[1, 2, 3, 4],
[2, 3, 1, 4]]
sample = {'id': 1}
# wrap data that want to indent = 0
sample['boxes'] = pj.NoIndent(boxes)
# dumps
json_data = pj.dumps(sample, indent=2)
print(json_data)
# write json
pj.write_json(sample, './tmp.json', indent=2)
# compare with raw
sample['boxes'] = boxes
raw_json = json.dumps(sample, indent=2)
print(raw_json)
```
**See default sample**
```python
from prettify_json import sample
raw, new = sample()
print('+++++++++ old +++++++++')
print(raw)
print('+++++++++ pretty +++++++++')
print(new)
```
**With Prettify**

**Without Prettify**

Authors
-------
See contributors section on GitHub.
Raw data
{
"_id": null,
"home_page": null,
"name": "prettify-json",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "jinjin xu <jinxu95@outlook.com>",
"download_url": "https://files.pythonhosted.org/packages/67/be/6b7286b2f51b24111a29f4be25ba3c7593df79b0dcaa204447bc12145fb7/prettify_json-0.1.1.tar.gz",
"platform": null,
"description": "prettify-json\r\n===========\r\n\r\nmake pretty json.\r\n\r\nDocumentation: https://github.com/VeritasXu/prettify-json\r\n\r\n\r\nInstallation\r\n------------\r\n\r\n```\r\npip install prettify-json\r\n```\r\n\r\n\r\nUsage\r\n-----\r\n\r\n```python\r\nimport json\r\nimport prettify_json as pj\r\n\r\n\r\n# raw contents for json\r\nboxes = [[1, 2, 3, 4],\r\n [2, 3, 1, 4]]\r\n\r\nsample = {'id': 1}\r\n\r\n# wrap data that want to indent = 0\r\nsample['boxes'] = pj.NoIndent(boxes)\r\n\r\n# dumps\r\njson_data = pj.dumps(sample, indent=2)\r\nprint(json_data)\r\n\r\n# write json\r\npj.write_json(sample, './tmp.json', indent=2)\r\n\r\n# compare with raw\r\nsample['boxes'] = boxes\r\nraw_json = json.dumps(sample, indent=2)\r\nprint(raw_json)\r\n```\r\n\r\n \r\n\r\n**See default sample**\r\n\r\n```python\r\nfrom prettify_json import sample\r\nraw, new = sample()\r\n\r\nprint('+++++++++ old +++++++++')\r\nprint(raw)\r\n\r\nprint('+++++++++ pretty +++++++++')\r\nprint(new)\r\n```\r\n\r\n**With Prettify**\r\n\r\n\r\n\r\n\r\n\r\n**Without Prettify**\r\n\r\n\r\n\r\n\r\nAuthors\r\n-------\r\n\r\nSee contributors section on GitHub.\r\n",
"bugtrack_url": null,
"license": null,
"summary": "make pretty json",
"version": "0.1.1",
"project_urls": {
"Homepage": "https://github.com/VeritasXu/prettify-json",
"Issues": "https://github.com/VeritasXu/prettify-json/issues"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "32819f1d89e4edfe4bd7ab3bd3397bcb16cec41d7de2ff945ac359cc4e0d3bce",
"md5": "e1eb11914a6110cb0b7f2cc9b9c87ffe",
"sha256": "362c987ade161f0c3ed3efed549e1a08c0cede58b4c723e6e55c02601a2263aa"
},
"downloads": -1,
"filename": "prettify_json-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e1eb11914a6110cb0b7f2cc9b9c87ffe",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 3613,
"upload_time": "2024-07-01T16:51:43",
"upload_time_iso_8601": "2024-07-01T16:51:43.534717Z",
"url": "https://files.pythonhosted.org/packages/32/81/9f1d89e4edfe4bd7ab3bd3397bcb16cec41d7de2ff945ac359cc4e0d3bce/prettify_json-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "67be6b7286b2f51b24111a29f4be25ba3c7593df79b0dcaa204447bc12145fb7",
"md5": "064b626076739b53a4d1b06985e7c8ea",
"sha256": "1eb811e2ab7103b8d50142fcbdabb6dd051c66a461be8c95ed4740898ec859e5"
},
"downloads": -1,
"filename": "prettify_json-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "064b626076739b53a4d1b06985e7c8ea",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 3238,
"upload_time": "2024-07-01T16:51:45",
"upload_time_iso_8601": "2024-07-01T16:51:45.061173Z",
"url": "https://files.pythonhosted.org/packages/67/be/6b7286b2f51b24111a29f4be25ba3c7593df79b0dcaa204447bc12145fb7/prettify_json-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-01 16:51:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "VeritasXu",
"github_project": "prettify-json",
"github_not_found": true,
"lcname": "prettify-json"
}