You can use the following using gzip
:
with gzip.open(json_file_name, 'wt', encoding='UTF-8') as zipfile:
json.dump(data, zipfile)
This will save the json
file in gzip format. So call is before passing to the S3 buckt.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…