heroku / salesforce-bulk

Python interface to the Salesforce.com Bulk API
MIT License
207 stars 154 forks source link

Update Bulk Query Example on Readme #56

Open ndanielsen opened 7 years ago

ndanielsen commented 7 years ago

The example in the readme does not work for me on python 3.4.

Here's an example that does work for me -- just sharing.

import codecs

reader = codecs.getreader("utf-8")

for result in bulk.get_all_results_for_query_batch(batch):
    converted_result = IteratorBytesIO(result)
    result_list = json.load(reader(converted_result))
    for row in result_list:
        print(row) # dictionary rows