Getting Started with Salesforce Data Analysis in Python

pip install https://github.com/simple-salesforce/simple-salesforce/archive/master.zip
from simple_salesforce import Salesforcesf = Salesforce(username='you@company.com', password='$ecret', security_token='SfheSnvrWjd2SnFHE')

Pulling Data

SELECT Id, Name
FROM Account
WHERE Name = ‘Sandy’
from sf import sf # assuming you put the authentication code in a 
# separate file called sf.py
data = sf.query_all(SOQL_HERE) # sf is the object we created earlier

Using Pandas

pip install pandas
import pandas as pddf_data = pd.DataFrame(data['records']).drop(column='attributes')

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store