Skip to content

Instantly share code, notes, and snippets.

@elliottcordo
Created May 22, 2015 15:40
Show Gist options
  • Save elliottcordo/71a4cbe3e08a772d19ac to your computer and use it in GitHub Desktop.
Save elliottcordo/71a4cbe3e08a772d19ac to your computer and use it in GitHub Desktop.
salesforce export
import beatbox
import csv
svc = beatbox.PythonClient()
svc.login('[email protected]', '*********pHCt4OfKqxtGlnLXM25TotCRv')
records = svc.query("SELECT Id, FirstName, LastName FROM Contact")
with open('contacts.csv', 'w') as outfile:
fp = csv.DictWriter(outfile, records[0].keys())
fp.writeheader()
fp.writerows(records)
outfile.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment