I am reading a file that contains JSON separated by commas. So for example
{
...JSON
},
{
...JSON
},
{
...JSON
}
I know for sure they are separated by commas but not sure it they are separated by newlines. This JSON can potentially all be on one line. But for sure they are separated by commas. I have not received that data yet. I am wondering how I can parse each JSON object and append it to a list.
pseudo code:
def source_parse(source_file):
json_list = []
with open(source_file) as source:
json_source = source.readlines()
# parse json_source
json_list.append(json_obj)