3

I am working on the salesforce api and came across the Bulk Upload API. I want to upload some data from a database into salesforce using the Bulk Upload API with python. I am currently using BeatBox as the library. Any pointers on how can I proceed using BeatBox? or are there ways to go about it. I have already done with half of the solution where in the data is queries from SQL and made into csv file. But how do I go about it after this for the BULK upload? Pointers would be of great help.

2 Answers 2

3

Found this package a few days ago:

https://pypi.python.org/pypi/salesforce-bulk/1.0.1

Seems like is what you're looking for:

from salesforce_bulk import CsvDictsAdapter

job = bulk.create_insert_job("Account", contentType='CSV')

accounts = [dict(Name="Account%d" % idx) for idx in xrange(5)]    
csv_iter = CsvDictsAdapter(iter(accounts))    
batch = bulk.post_bulk_batch(job, csv_iter)    
bulk.wait_for_batch(job, batch)    
bulk.close_job(job)    
print "Done. Accounts uploaded."
Sign up to request clarification or add additional context in comments.

Comments

0

I learned almost everything I know from this site. Really great examples:

http://tomhayden3.com/2013/08/04/salesforce-python/

http://tomhayden3.com/2013/09/05/salesforce-beatbox-multi/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.