chunkSize = 1000
for i in range(0, len(o), chunkSize):
    with open('file_' + str(i // chunkSize) + '.json', 'w') as outfile:
        json.dump(o[i:i + chunkSize], outfile)
Split 95mb JSON array into smaller chunks?