Extending Simple Salesforce to support Pandas exports and more.
Project description
simpler-sf
Extending the low-level Salesforce API client Simple Salesforce to support exports in Pandas, and other features.
Usage
Install
pip install simpler-sf
Import
import simpler_sf
simpler_sf.simple_salesforce()
import simple_salesforce
Query
Simpler-sf adds the smart_query()
method to the simple_salesforce.Salesforce
class.
The advantages over the existing methods are:
- Un-nesting of results for relationship queries (aka the infamous
'attributes'
field) (not just for one level) - Query results in
pd.Dataframe
format - No limit on the number of output rows as in
simple_salesforce.Salesforce.query()
and at the same time... - No need to use a different class for each Salesforce object as in
sf.bulk.Account.query(query)
- The option to filter dynamically, on large amounts of values without a limit on the number of characters
Example
sf = simple_salesforce.Salesforce(username=username, password=password, security_token=token)
df = sf.smart_query('SELECT Contact.Id, Contact.FirstName, Contact.Account.Name, Campaign.Name FROM CampaignMember')
print(df)
Output:
Contact.Id Contact.FirstName Contact.Account.Name Campaign.Name
0 0032400000QZbmtAAD Emily Amazon CampaignA_2023Q2
1 0032400000eGqdZAAS Jasmine Amazon CampaignA_2023Q2
2 00324036u9QZbnGAAT Míng Microsoft CampaignB_2022Q4
3 0032400000QZbygAAX Magdalena Google CampaignC_2023Q1
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
simpler_sf-1.0.3.tar.gz
(4.7 kB
view details)
Built Distribution
File details
Details for the file simpler_sf-1.0.3.tar.gz
.
File metadata
- Download URL: simpler_sf-1.0.3.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23cd6248ac7f5135a5030291788e1bad089d1fade8651280c194360106293b4d |
|
MD5 | 07411b18258fe6925618e1152149550f |
|
BLAKE2b-256 | d4715956eb5aa02c92e8c2cefbb301d7aa40618a3b9e5ec4bdc9235a1fcf38ac |
File details
Details for the file simpler_sf-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: simpler_sf-1.0.3-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd09911e0c5eb9575f9b4b6f1903bb062c81549c0e515e759260e28e7511d737 |
|
MD5 | 3590499ef9c57e43b947ea9402e32e60 |
|
BLAKE2b-256 | 839b1c0eb42f0f094da3cf746dbad07a32840eda34e525b999aa4807a90e5e08 |