I am reading a file that contains JSON separated by commas. So for example
{
...JSON
},
{
...JSON
},
{
...JSON
}
I know for sure they are
you can parse the data to dict by following this link. Parsing values from a JSON file using Python?
and convert the dict to list by the
.items()
function to the parsed dictionary.
Hope this one solves the problem. Good luck.
That's not valid JSON, it is missing the [...]
brackets to make it a list.
You could add those manually:
with open(source_file) as source:
json_source = source.read()
data = json.loads('[{}]'.format(json_source))