Name | json-with-comments JSON |
Version |
1.2.9
JSON |
| download |
home_page | None |
Summary | JSON with Comments (jsonc) for Python |
upload_time | 2024-09-24 03:55:55 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.7 |
license | MIT |
keywords |
json with comments
jsonc
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# JSON with Comments for Python
[![pypi version](https://img.shields.io/pypi/v/json-with-comments.svg)](https://pypi.python.org/project/json-with-comments)
[![Python package](https://github.com/n-takumasa/json-with-comments/actions/workflows/test.yml/badge.svg)](https://github.com/n-takumasa/json-with-comments/actions/workflows/test.yml)
[![Python Versions](https://img.shields.io/pypi/pyversions/json-with-comments.svg)](https://pypi.org/project/json-with-comments/)
## Features
* `load()`, `loads()`
* Remove single line (`//`) and block comments (`/* */`)
* Remove trailing commas from arrays and objects
* `dump()`, `dumps()`
* Add comments
* Add trailing commas
## Usage
```sh
pip install json-with-comments
```
```py
>>> import jsonc
>>> jsonc.loads("{// comment \n}")
{}
>>> jsonc.loads("{/* comment */}")
{}
>>> jsonc.loads('{"spam": "ham // egg" /* comment */}')
{'spam': 'ham // egg'}
>>> jsonc.loads('{"spam": /* comment */"ham /* egg */"}')
{'spam': 'ham /* egg */'}
```
And just like `json` module
Raw data
{
"_id": null,
"home_page": null,
"name": "json-with-comments",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "json with comments, jsonc",
"author": null,
"author_email": "Takumasa Nakamura <n.takumasa@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/ca/bb/3e940bde66d75fa5438dfe20d21b04f99daf025b27d9a1101172f7df8bb4/json_with_comments-1.2.9.tar.gz",
"platform": null,
"description": "# JSON with Comments for Python\n[![pypi version](https://img.shields.io/pypi/v/json-with-comments.svg)](https://pypi.python.org/project/json-with-comments)\n[![Python package](https://github.com/n-takumasa/json-with-comments/actions/workflows/test.yml/badge.svg)](https://github.com/n-takumasa/json-with-comments/actions/workflows/test.yml)\n[![Python Versions](https://img.shields.io/pypi/pyversions/json-with-comments.svg)](https://pypi.org/project/json-with-comments/)\n\n## Features\n* `load()`, `loads()`\n * Remove single line (`//`) and block comments (`/* */`)\n * Remove trailing commas from arrays and objects\n* `dump()`, `dumps()`\n * Add comments\n * Add trailing commas\n\n## Usage\n\n```sh\npip install json-with-comments\n```\n\n```py\n>>> import jsonc\n>>> jsonc.loads(\"{// comment \\n}\")\n{}\n>>> jsonc.loads(\"{/* comment */}\")\n{}\n>>> jsonc.loads('{\"spam\": \"ham // egg\" /* comment */}')\n{'spam': 'ham // egg'}\n>>> jsonc.loads('{\"spam\": /* comment */\"ham /* egg */\"}')\n{'spam': 'ham /* egg */'}\n\n```\n\nAnd just like `json` module\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "JSON with Comments (jsonc) for Python",
"version": "1.2.9",
"project_urls": {
"Repository": "https://github.com/n-takumasa/json-with-comments"
},
"split_keywords": [
"json with comments",
" jsonc"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "52bae92ad9d8b68cdf60fca7b1e78f432514201d1c3f02fc0f4ce4226d529f9e",
"md5": "3753906214a326577d1cbadcbe1e6711",
"sha256": "48ac9909ca8036737d9742025adb5598c3b80548f04ae1718e61bf6b879b91b7"
},
"downloads": -1,
"filename": "json_with_comments-1.2.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3753906214a326577d1cbadcbe1e6711",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 6539,
"upload_time": "2024-09-24T03:55:54",
"upload_time_iso_8601": "2024-09-24T03:55:54.428778Z",
"url": "https://files.pythonhosted.org/packages/52/ba/e92ad9d8b68cdf60fca7b1e78f432514201d1c3f02fc0f4ce4226d529f9e/json_with_comments-1.2.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cabb3e940bde66d75fa5438dfe20d21b04f99daf025b27d9a1101172f7df8bb4",
"md5": "c67da131c7ab0085f7ffa871d979d331",
"sha256": "6be24161c206b9b2b3f6ba37cefaf40e10a941bba59b63aa234dc809a1f0b41b"
},
"downloads": -1,
"filename": "json_with_comments-1.2.9.tar.gz",
"has_sig": false,
"md5_digest": "c67da131c7ab0085f7ffa871d979d331",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 6788,
"upload_time": "2024-09-24T03:55:55",
"upload_time_iso_8601": "2024-09-24T03:55:55.732796Z",
"url": "https://files.pythonhosted.org/packages/ca/bb/3e940bde66d75fa5438dfe20d21b04f99daf025b27d9a1101172f7df8bb4/json_with_comments-1.2.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-24 03:55:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "n-takumasa",
"github_project": "json-with-comments",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "json-with-comments"
}