Python Simple Salesforce Select All Fields
How should I extract the field names into a string list from the Ordered Dictionary shown below?
I've extended your code to include the solution
from simple_salesforce import Salesforce
#(credentials hidden)
sf = Salesforce(username=username, password=password,
security_token=security_token, sandbox=True,
client_id='mwheeler App')
desc = sf.Account.describe()
# Below is what you need
field_names = [field['name'] for field in desc['fields']]
soql = "SELECT {} FROM Account".format(','.join(field_names))
results = sf.query_all(soql)
# Alternative method to retrieve results
# I don't have any recommendation which to use
results = sf.bulk.Account.query(soql)
I realize the question was posted a while ago, just want it to have a complete solution.