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.Dataframeformat - 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simpler_sf-1.0.4.tar.gz.
File metadata
- Download URL: simpler_sf-1.0.4.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccf40c67a5c38d945261c5a043ce7b0d5b722635ffed6f0a0b3c8ce1c2fe3dce
|
|
| MD5 |
380ef7812fdabee1c1e2bd8eba5393bb
|
|
| BLAKE2b-256 |
f6d7626869be36aaede353715758ac9b0c91d37180a8503d859e72342aedc591
|
File details
Details for the file simpler_sf-1.0.4-py3-none-any.whl.
File metadata
- Download URL: simpler_sf-1.0.4-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99bf309b5ada99826639d4fa71cbfd0884cd9f4eff56e044bfbad9f90f049e81
|
|
| MD5 |
41778f1488c706e66ec7d312bf7da656
|
|
| BLAKE2b-256 |
cbab556652790705aad173ed9f12addd9e2111457f4d7907a7270381c5de0b4b
|