A set of helper functions for CSV to Salesforce procedures, with reporting in AWS S3, based in a Django project
Project description
Overview
A set of helper functions for CSV to Salesforce procedures, with reporting in AWS S3, based in a Django project. The use case is extremely specific, but the helpers should be modular so they can be cherry-picked.
Typical use case:
- Receive an S3 event
- Download the S3 object
- Serialize the file into JSON
- Bulk upsert the JSON data to Salesforce
- Parse the results of the upsert for errors
- Construct a CSV error report
- Move the triggering S3 object to an archive folder
- Push the error report to an error folder in the same bucket
- Push an object to Salesforce that details information about the above execution
Example
from django_s3_csv_2_sfdc.csv_helpers import create_error_report
from django_s3_csv_2_sfdc.s3_helpers import download_file, respond_to_s3_event, upload_file
from django_s3_csv_2_sfdc.sfdc_helpers import extract_errors_from_results
# handler for listening to s3 events
def handler(event, context):
respond_to_s3_event(event, download_and_process)
def download_and_process(s3_object_key, bucket_name):
download_path = download_file(s3_object_key, bucket_name)
# This function contains your own biz logic; does not come from this library
results = serialize_and_push_to_sfdc(download_path)
sucesses, errors = parse_bulk_upsert_results(results)
report_path, errors_count = create_error_report([errors])
upload_file(report_path, bucket_name)
Just take what'cha need!
Project details
Release history Release notifications | RSS feed
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 django-s3-csv-2-sfdc-0.2.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92cd0a52f5a076e90419bef14014db06584e1af0f5bc1f6d3f7cb739bc7da09c |
|
MD5 | 8e038b1f76c570ce30293341d5c0ccf9 |
|
BLAKE2b-256 | 2e3de4dce1ef0815931e75898126b64644055eb5f8bb3b74b7752080d4e9b541 |
Close
Hashes for django_s3_csv_2_sfdc-0.2.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54dc29305d7bba77533b719cd2bb23369c181dc6fdff43daea6aa66237f58269 |
|
MD5 | 5cb2b8b8fb477c3e2e2544b0c299d35a |
|
BLAKE2b-256 | 7bf61866c1074c00c459fc357afb4512c1173425e16e4795e2c7275fcd87e8c8 |