Skip to content

Python script to download Salesforce Files (aka ContentDocument)

Notifications You must be signed in to change notification settings

501Commons/salesforce-files-download

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

salesforce-files-download

Python script to download Salesforce Files (aka ContentDocument). It's using ProcessPoolExecutor to run downloads in parallell which makes the experience nicer if you have a large number of files.

In a very non scientific test 1614 files (3.23 GB) were downloaded in under 6 minutes.

Getting Started

Download the script, satisfy requirements.txt and you're good to go!

Prerequisites

simple-salesforce (https://github.com/simple-salesforce/simple-salesforce)

Usage

  1. Copy download.ini.template to download.ini and fill it out
  2. Launch the script
usage: download.py [-h] -q query

Export ContentVersion (Files) from Salesforce

optional arguments:
  -h, --help            show this help message and exit
  -q query, --query query
                        SOQL to limit the valid ContentDocumentIds. Must
                        return the Id of related/parent objects.

Example

python download.py -q 
"SELECT Id FROM Custom_Object__c WHERE Status__c = 'Approved'"

Bug free software?

This was a small implementation for a customer that I decided to clean up and put on GitHub, I guess there are tons of bugs in here so please feel free to contact me if you find any of those.

About

Python script to download Salesforce Files (aka ContentDocument)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%