I'm trying to get some python scripts working that will go out and pull a specific Salesforce report as a csv, and then take a sum of column 6 and put that value into a new workbook. I would also like to be able to define the file name of the new workbook file. Thanks for your time! Code below:
Pull report from Salesforce:
from simple_salesforce import Salesforce
import requests
import base64
import json
import sys
sf = Salesforce(username="userid"
,password="password"
,security_token="token")
#print "get sid " + str(sf.session_id)
sid = str(sf.session_id)
urlin = "https://na52.salesforce.com/" + sys.argv[1] + "?
view=d&snip&export=1&enc=UTF-8&xf=csv"
response = requests.get(urlin,
headers = sf.headers, cookies = {'sid' : sid})
#response.contents
print response.content