Get > 2000 records from Salesforce reports with python.
Project description
Salesforce Reporting - Chunk Style
Get > 2000 rows from your date-sortable Salesforce reports via python using the Analytics API (pdf link), by salesforce-reporting
and some date-trickery.
salesforce-reporting-chunks
is a wrapper around cghall's salesforce-reporting
module. The Salesforce API limits output to 2000 rows for a given report. salesforce-reporting-chunks
works around this by returning a generator that simply pulls a date range from your report a given number of days at a time.
Install
pip install force-retrieve-chunked
Documentation
Documentation at readthedocs
Usage
from salesforce_reporting_chunked import chunk_report_by_date
CONFIG = {
"security_token": "REPLACE WITH YOUR TOKEN",
"username": "REPLACE WITH YOUR USERNAME",
"password": "REPLACE WITH YOUR PASSWORD",
"api_version": "v38.0"
}
FIELDNAMES = [
"First Name",
"Last Name",
"Date Column", # this is the magic column use for chunking.
"Corhuscorrated Plethanth",
"Other Column",
]
REPORT_ID = "YOURREPORTID"
>>> data = chunk_report_by_date(
CONFIG,
REPORT_ID,
FIELDNAMES,
date_fieldname="Date Column",
start_date="2018-01-01",
start_date="2019-01-31",
)
>>> next(data)
OrderedDict([('First Name', 'Fred'),('Last Name', 'Garvin'),('DATE_COLUMN_NAME', '2018-01-01'),('Corhuscorrated Plethanth', True),('Other Column': 'Yep. Another')])
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
Close
Hashes for salesforce-reporting-chunked-0.1.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5c69f5a1173c3da71a7cfb34497f9c556815a8e27e883de92034830da3caa72 |
|
MD5 | 804f30cfa2cd4b20f7111e515d8ac4c8 |
|
BLAKE2b-256 | 7e3a902f1bb8f1dda492407a2b4dc0e0d1a18a404dd7edb3da36fcad7d0c62a5 |
Close
Hashes for salesforce_reporting_chunked-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6075a228aa80e04ec72ff13b80dc44153726b0c3f0375e3b9be43cd9b719f2f |
|
MD5 | 1d0724d5921ee1621ff723d617d2f2b7 |
|
BLAKE2b-256 | f84117b70f385aa4536dedf372382924f016acee874cd18cf905fec902549c21 |