Skip to main content

A JSON5 parser that, among other features, supports round-trip preservation of comments

Project description

json-five

JSON5 for Python

Documentation Status Build Status version pyversion Coverage

Installation

pip install json-five

This project requires Python 3.6 or newer.

Usage

NOTE: the import name is different from the install name (sorry, many were taken already)

>>> import json5
>>> json_text = """{ // This is a JSON5 comment
"foo": "bar" /* this is a JSON5 block
comment that can span lines /*
"bacon": "eggs"
}
"""
>>> json5.loads(json_text)
{"foo": "bar", "bacon": "eggs"}

See also the full documentation

Key features

  • Supports the JSON5 spec
  • Supports similar interfaces to stdlib json module
  • Supports round-trip preservation of comments
  • Tries to find all syntax errors at once (instead of raising on the first error encountered)

Status

This project currently fully supports the JSON5 spec but is still undergoing active development, particularly for round-trip support and model-level edits. Additional features are still being added. Check the issues page to see known bugs and unimplemented features.

Project details


Download files

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

Source Distribution

json-five-1.0.0.tar.gz (23.5 kB view details)

Uploaded Source

Built Distribution

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

json_five-1.0.0-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file json-five-1.0.0.tar.gz.

File metadata

  • Download URL: json-five-1.0.0.tar.gz
  • Upload date:
  • Size: 23.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for json-five-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d76f618667615f416350701be0c8f872f486819ebde55a38332b7dd3cb6637e2
MD5 345d438c0b50aae6c0f1e973e402bd15
BLAKE2b-256 fece0124d676f2ba0b9a88332e8c01306c9ea04211ca7b1b9be6af183c1eea3a

See more details on using hashes here.

File details

Details for the file json_five-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: json_five-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for json_five-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b68cd88c875b9053fb88d3def80ae2dd6f7d56e198b1381774a6cd327267ffd4
MD5 f19b8bc3c61fe52ce6f6dd28081ffcef
BLAKE2b-256 1eaf623870f67c3ff969bc8651e29950e10c816cdf1e5291914c588888bcda49

See more details on using hashes here.

Supported by

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