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 is still in early stages of development. 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-0.2.5.tar.gz (14.8 kB view hashes)

Uploaded Source

Built Distribution

json_five-0.2.5-py3-none-any.whl (15.8 kB view hashes)

Uploaded Python 3

Supported by

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