json-with-comments


Namejson-with-comments JSON
Version 1.2.10 PyPI version JSON
download
home_pageNone
SummaryJSON with Comments (jsonc) for Python
upload_time2024-12-10 05:46:37
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseMIT
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/bf/6d/638e8adbb2b92bb0803c092dd8ae6482945961c8545fc7e2f21c48233928/json_with_comments-1.2.10.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.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"
}
        
Elapsed time: 1.34862s