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.Salesforce

  • Supported 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#

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/ and tests/integration/

API Reference#

  • Client API: Salesforce class and client-facing modules

  • Utilities: Utility functions and helpers

  • Exceptions: Exception classes and error helpers

Project Information#

  • Changelog: Release history and notable changes

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.