SFDClib is a Salesforce.com Metadata API and Tooling API client built for Python 3.3 and 3.4.
Project description
SFDClib is a Salesforce.com Metadata API and Tooling API client built for Python 3.3 and 3.4.
Usage
To use API classes one needs to create a session first by instantiating SfdcSession class and passing login details to the constructor.
One method is to pass in the username, password, and token:
from sfdclib import SfdcSession
s = SfdcSession(
'username': 'sfdcadmin@company.com.sandbox',
'password': 'Pa$sw0rd',
'token': 'TOKEN',
'is_sandbox': True
)
s.login()
A second method, if you’ve already logged in elsewhere, is to pass in the instance and session_id. This method does not require calling login().
from sfdclib import SfdcSession
s = SfdcSession(
'session_id': 'thiswillbeaverylongstringofcharactersincludinglettersspacesandsymbols',
'instance': 'custom-sf-site.my'
)
# Notice we are not calling the login() method for this example.
Then create an instance of corresponding API class passing session object.
from sfdclib import SfdcToolingApi
tooling = SfdcToolingApi(s)
r = tooling.anon_query("SELECT Id, Name FROM User LIMIT 10")
Implemented methods
SfdcSession
SfdcMetadataApi
SfdcToolingApi
SfdcBulkApi
License
This package is released under the MIT license.
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.