how to read json object in python

You should pass the file contents (i.e. a string) to json.loads(), not the file object itself. Try this: There’s also the json.load() function which accepts a file object and does the f.read() part for you under the hood.