I want to convert Amazon Ion file from S3 bucket to JSON format.
I am trying following code
import json
import boto3
s3 = boto3.resource('s3')
bucket = s3.Bucket('some/path/')
ion_body = bucket.Object('xxxxxxxxxxxxxx.ion').get()['Body'].read().decode("utf-8")
json.loads(ion_body)
But I am getting following JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 3 (char 2)
error. Because in Ion file keys are declared without quotes.
Amazon Ion document says we can down convert Ion to Json. But I didn't get any way. Please help me. Thanks!