Simple Salesforce is a Python package that speaks to Salesforce.com REST, Bulk, and Metadata APIs. It returns parsed JSON for records, SOQL, SOSL, and metadata operations.
Overview
Simple Salesforce targets Python 3.9 through 3.13 and provides a thin wrapper over Salesforce REST resources and Apex-related access patterns. Call results are ordinary Python dictionaries mirroring Salesforce JSON responses, aligned with the vendor’s REST API reference.
You can connect with an instance URL plus session ID, or authenticate with username and password combinations using a security token, organization ID for IP-filtered login, JWT with a private key, or connected-app consumer key and secret. Sandbox access uses a test domain flag, and optional client IDs label traffic in Salesforce logs.
Record helpers cover create, read, update, delete, upsert, and bulk retrieval of changed or deleted rows on standard objects such as Contact, Account, and Lead. Query support includes SOQL with parent relationship fields, paginated query_more and query_all helpers, iterators, and formatters to escape SOQL and SOSL values safely.
A metadata API surface exposes typed helpers to create, read, update, delete, rename, and describe custom metadata components, with validation that raises exceptions when Salesforce reports failure.
Key features
- REST API record CRUD
- Multiple login methods
- SOQL and SOSL queries
- Query pagination helpers
- Metadata API operations
- Custom requests Session support
Use cases
- Salesforce data automation
- CRM integration scripts
- Metadata deployment tooling