You must convert json to dict and then the labels are the same as the keys.
import json
a = json.dumps({"Name": "Robert",
"Date" : "January 17th, 2017",
"Address" : "Jakarta"})
for key in json.loads(a):
print(key)
output:
Name
Date
Address
Optional:
If you want to access the values of each item
import json
a = json.dumps({"Name": "Robert",
"Date" : "January 17th, 2017",
"Address" : "Jakarta"})
d = json.loads(a)
for key in d:
print("key: {}, value: {}".format(key, d[key]))
Python2
for key, value in json.loads(a).iteritems():
print("key: {}, value: {}".format(key, value))
Python3
for key, value in json.loads(a).items():
print("key: {}, value: {}".format(key, value))
Output:
key: Name, value: Robert
key: Date, value: January 17th, 2017
key: Address, value: Jakarta