Installing salesforce python toolkit

Installing salesforce python toolkit on a debian machine in order to access the Salesforce API. Follow the 3 steps:

1. Download the toolkit from https://code.google.com/p/salesforce-python-toolkit/

2. Install Suds (Python SOAP Client):

sudo apt-get install python-setuptools

3. Install the salesforce python toolkit using the setup.py provided in the tar:

sudo python setup.py install

Installation is now complete. Execute the following test script to validate the setup and salesforce connectivity:

#!/etc/bin/python

from sforce.enterprise import SforceEnterpriseClient
h = SforceEnterpriseClient('Company_Enterprise_Sandbox.wsdl.xml')
h.login('salesforce_login@domain.com', 'account_password', 'xxxxSecurityTokenxxxx')
result = h.query('SELECT ID,Name,Customer_Number__c FROM Account LIMIT 10')
print type(result)
for record in result.records:
    print record.Id, record.Customer_Number__c, record.Name

PS: The PHP toolkit can be installed and configured easily as well. Refer to the documentation here: http://wiki.developerforce.com/page/Force.com_Toolkit_for_PHP

Advertisements

One thought on “Installing salesforce python toolkit

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s