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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

json_with_comments-1.3.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

json_with_comments-1.3.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file json_with_comments-1.3.0.tar.gz.

File metadata

  • Download URL: json_with_comments-1.3.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for json_with_comments-1.3.0.tar.gz
Algorithm Hash digest
SHA256 8e9668f9aaa9f50cb546828da958c606e45f3866daceb51f16b0ee61985c0677
MD5 5f38573d55963cd375ed2b0e95245f61
BLAKE2b-256 638d08b696af5b68210999c8f9f4ba1729ccbd4ae2bbf535f547a9d07ca36ce7

See more details on using hashes here.

Provenance

The following attestation bundles were made for json_with_comments-1.3.0.tar.gz:

Publisher: publish.yml on n-takumasa/json-with-comments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file json_with_comments-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for json_with_comments-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc96215e8960687180a6e60db8567c806ba40fb56187b2b8cf60ccc0bdfeb81e
MD5 76ffb486bbb779d49e3a4e76f7a2373d
BLAKE2b-256 cf7279259c11af4c22f187d0da18411982883428c2e915b2f9eb43bcd20d81fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for json_with_comments-1.3.0-py3-none-any.whl:

Publisher: publish.yml on n-takumasa/json-with-comments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 files

1.2.10

2 files

1.2.9

2 files

1.2.8

2 files

1.2.7

2 files

1.2.6

2 files

1.2.5

2 files

1.2.4

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.1

2 files

1.1.0

2 files

1.0.1

2 files

1.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page