Skip to main content

JSON with Comments for Python

pypi version Python package Python Versions

Features

  • load(), loads()
    • Remove single line (//) and block comments (/* */)
    • Remove trailing commas from arrays and objects
  • dump(), dumps()
    • Add comments
    • Add trailing commas

Usage

pip install json-with-comments
>>> 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

Metadata

Release files for json-with-comments 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for json-with-comments 1.3.0
File Size Uploaded
json_with_comments-1.3.0.tar.gz 7.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for json-with-comments 1.3.0
File Interpreter ABI Platform
json_with_comments-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.7 kB

Release files / json_with_comments-1.3.0.tar.gz

Download URL json_with_comments-1.3.0.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8e9668f9aaa9f50cb546828da958c606e45f3866daceb51f16b0ee61985c0677
BLAKE2b-256 checksum
How to use checksums
638d08b696af5b68210999c8f9f4ba1729ccbd4ae2bbf535f547a9d07ca36ce7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.

Transparency log

Release files / json_with_comments-1.3.0-py3-none-any.whl

Download URL json_with_comments-1.3.0-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc96215e8960687180a6e60db8567c806ba40fb56187b2b8cf60ccc0bdfeb81e
BLAKE2b-256 checksum
How to use checksums
cf7279259c11af4c22f187d0da18411982883428c2e915b2f9eb43bcd20d81fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.10

2 release files

1.2.9

2 release files

1.2.7

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page