Last active
July 16, 2017 19:47
-
-
Save matyasfodor/2798a54ca3a6b1ac9abd8edfe000b71c to your computer and use it in GitHub Desktop.
This is how to parse JSON as object (recursively)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from collections import namedtuple | |
x = json.loads(data, object_hook=lambda d: namedtuple('X', d.keys())(*d.values())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment