import json, re
from bson import json_util
with open('data.tengenjson', 'rb') as f:
    bsondata = f.read()
jsondata = re.sub('ObjectId\\s*\\(\\s*\\"(\\S+)\\"\\s*\\)',
    '{"$oid": "\\1"}', bsondata)
jsondata = re.sub('Date\\s*\\(\\s*(\\S+)\\s*\\)', '{"$date": \\1}', jsondata)
data = json.loads(jsondata, object_hook=json_util.object_hook)
print(data)
print(type(data))
print(json_util.dumps(data))
How can I use Python to transform MongoDB's bsondump into JSON?