pip install json-five

Basic Usage

Suppose you have a JSON5 compliant file my-json-file.json

// This is a JSON5 file!
{'foo': 'bar'}

You can load this file to Python like so:

import json5
with open('my-json-file.json') as f:
    data = json5.load(f)

You can also work directly with strings

import json5
json_string = '{json5 /* identifiers dont need quotes */: "values do though"}'
data = json5.loads(json_string)

Want to do more? Check out Extending json-five to dive deeper!