Name | json-with-comments JSON |
Version |
1.2.10
JSON |
| download |
home_page | None |
Summary | JSON with Comments (jsonc) for Python |
upload_time | 2024-12-10 05:46:37 |
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
[](https://pypi.python.org/project/json-with-comments)
[](https://github.com/n-takumasa/json-with-comments/actions/workflows/test.yml)
[](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/bf/6d/638e8adbb2b92bb0803c092dd8ae6482945961c8545fc7e2f21c48233928/json_with_comments-1.2.10.tar.gz",
"platform": null,
"description": "# JSON with Comments for Python\n[](https://pypi.python.org/project/json-with-comments)\n[](https://github.com/n-takumasa/json-with-comments/actions/workflows/test.yml)\n[](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.10",
"project_urls": {
"Repository": "https://github.com/n-takumasa/json-with-comments"
},
"split_keywords": [
"json with comments",
" jsonc"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "008af67dadb0648f00ac2249d3ef32532f0d5a2e72016f8426290ce6fe575870",
"md5": "7c78bd102578609bb70b4647d715cb16",
"sha256": "d7989c2577b1f8cbba735209f8d388d21017feb42ef30c29c230040f86b42700"
},
"downloads": -1,
"filename": "json_with_comments-1.2.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7c78bd102578609bb70b4647d715cb16",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 6533,
"upload_time": "2024-12-10T05:46:34",
"upload_time_iso_8601": "2024-12-10T05:46:34.856023Z",
"url": "https://files.pythonhosted.org/packages/00/8a/f67dadb0648f00ac2249d3ef32532f0d5a2e72016f8426290ce6fe575870/json_with_comments-1.2.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bf6d638e8adbb2b92bb0803c092dd8ae6482945961c8545fc7e2f21c48233928",
"md5": "cb4aab307eb8256bbc6aeb50e5cf904c",
"sha256": "0020b321cf6c80963c85f95ce985e71332f1797ed49abfd1cd675b3bdee24a28"
},
"downloads": -1,
"filename": "json_with_comments-1.2.10.tar.gz",
"has_sig": false,
"md5_digest": "cb4aab307eb8256bbc6aeb50e5cf904c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 6788,
"upload_time": "2024-12-10T05:46:37",
"upload_time_iso_8601": "2024-12-10T05:46:37.415643Z",
"url": "https://files.pythonhosted.org/packages/bf/6d/638e8adbb2b92bb0803c092dd8ae6482945961c8545fc7e2f21c48233928/json_with_comments-1.2.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-10 05:46:37",
"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"
}