SalesPyForce Documentation#
SalesPyForce is a Python package for working with Salesforce APIs through a single, high-level client. This documentation covers setup, authentication patterns, query workflows, error handling, and the complete API reference.
At A Glance#
Purpose: Simplify Salesforce REST API interactions in Python
Primary interface:
salespyforce.SalesforceSupported Python versions: 3.9+
License: MIT
What You Can Do#
With SalesPyForce, you can:
Authenticate against Salesforce using direct credentials or a helper file
Run SOQL and SOSL queries
Create, retrieve, update, and delete Salesforce object records
Access org metadata, REST resources, and API version details
Work with Salesforce Chatter and Knowledge features
Installation#
pip install --upgrade salespyforce
Quick Example#
from salespyforce import Salesforce
sfdc = Salesforce(helper="/path/to/helper.yml")
query = """
SELECT Id, Name
FROM Account
ORDER BY LastModifiedDate DESC
LIMIT 5
"""
result = sfdc.soql_query(query)
print(result.get("totalSize", 0))
For a complete walkthrough, see the Quickstart page.
Documentation Map#
Getting Started#
Overview: Package capabilities and requirements
Installation: Installation and environment setup
Quickstart: Minimal end-to-end usage example
Guides#
Authentication: Credential patterns and helper-file usage
Querying Data: SOQL and SOSL examples and best practices
Error Handling: Exceptions, diagnostics, and recovery patterns
Testing: Running tests from
tests/unit/andtests/integration/
API Reference#
Client API:
Salesforceclass and client-facing modulesUtilities: Utility functions and helpers
Exceptions: Exception classes and error helpers
Project Information#
Changelog: Release history and notable changes
Project Links#
Source code: jeffshurtliff/salespyforce
Package index: https://pypi.org/project/salespyforce/
Issue tracker: jeffshurtliff/salespyforce#issues
Disclaimer#
SalesPyForce is an unofficial package and is not endorsed or supported by Salesforce Inc.
Note
Previous documentation has been preserved in docs_legacy/ for historical
reference.