data = s3client.get_object(Bucket='', Key='')
data1 = data['Body']
data2 = json.load(data1)
data2 = json_normalize(data=data2)
data2 = sor.explode('header.head')
data2 = data2.to_dict('records')
data2 = json_normalize(data2)
I am using the above code for json files to unnest complex jsons and analyse data. How can I do the same to stream text files and view the contents.
data = s3client.get_object(Bucket='', Key='')
data1 = data['Body']
with open(data1) as sample:
for line in sample:
print(line.rstrip())
I am getting the following error
TypeError: expected str, bytes or os.PathLike object, not StreamingBody