Select Page

Parsing JSON

import json
data = json.loads(json_string)

Dumping complex structures

import json
print json.dumps(something)

Convert YAML to JSON

import yaml, json

with open('./file.yaml') as f:
  print(json.dumps(yaml.load(f)))