Metadata-Version: 2.1
Name: json-with-comments
Version: 1.2.4
Summary: JSON with Comments for Python
Home-page: https://github.com/n-takumasa/json-with-comments
License: MIT
Author: Takumasa Nakamura
Author-email: n.takumasa@gmail.com
Requires-Python: >=3.7
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Project-URL: Repository, https://github.com/n-takumasa/json-with-comments
Description-Content-Type: text/markdown

# 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/python-package.yml/badge.svg)](https://github.com/n-takumasa/json-with-comments/actions/workflows/python-package.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

