Skip to main content

even-simpler-salesforce: async-first Salesforce on httpx. Skip the boilerplate.

Documentation · PyPI · Getting started · Changelog

PyPI version Python 3.10 to 3.14 CI Docs License: Apache-2.0

A typed Salesforce client for Python built on httpx. It is async-first, and a sync client with the same methods is generated from the async code. OAuth refresh applies to every call, failures raise specific exception classes, each call produces one structured log event with its API usage, and SOQL values are quoted for you. You pick a login flow (client credentials, JWT bearer, web server with PKCE, or an existing token). The client then handles tokens, retries, pagination, chunking and error mapping.

Install

pip install even-simpler-salesforce

The only required dependency is httpx. Extras add optional features:

Extra Adds Needed for
jwt PyJWT, cryptography esf.JwtBearer
pydantic Pydantic 2 model= with Pydantic models
speed orjson faster JSON encoding and decoding
http2 httpx[http2] http2=True
otel opentelemetry-api esf.observability.OpenTelemetry
structlog structlog esf.observability.Structlog
testing pytest, respx the esf.testing helpers and pytest plugin
fastapi, flask the framework the even_simpler_salesforce.contrib.fastapi and .contrib.flask integrations
all everything above
pip install "even-simpler-salesforce[jwt,speed]"

Quick start

import asyncio
import os

import even_simpler_salesforce as esf

auth = esf.ClientCredentials(
    domain=os.environ["SF_DOMAIN"],  # https://<your-domain>.my.salesforce.com
    client_id=os.environ["SF_CLIENT_ID"],
    client_secret=os.environ["SF_CLIENT_SECRET"],
)


async def main() -> None:
    async with esf.AsyncSalesforce(auth) as sf:
        lead_id = await sf.sobject("Lead").create({"LastName": "Lovelace", "Company": "Engines"})
        page = await sf.query("SELECT Id, Name FROM Lead WHERE Id = {}", lead_id)
        print(page.records[0]["Name"], sf.usage.snapshot().api_used)


asyncio.run(main())

The sync client has the same methods, without await:

with esf.Salesforce(auth) as sf:
    lead_id = sf.sobject("Lead").create({"LastName": "Hopper", "Company": "Navy"})
    for lead in sf.query_iter("SELECT Id, Name FROM Lead WHERE Status = {}", "Open"):
        print(lead["Name"])

What 0.1 includes

  • Clients: AsyncSalesforce and the generated Salesforce. with_auth() and tagged() return child clients that share the connection pool, caches and usage counters.
  • Login flows: ClientCredentials, JwtBearer, WebServerFlow (PKCE, code exchange, revoke, userinfo, introspection) and StaticToken. A refresh runs once even when many concurrent calls need it, and a rotated refresh token is saved before the new access token is used. Durable token stores use compare-and-swap, and a reusable contract test suite checks your own store.
  • Records: get, get by external id, create, update, upsert, delete, describe (cached and revalidated), updated/deleted windows, and conditional requests.
  • Query and search: pass values after the SOQL (sf.query("... WHERE Email = {}", email)) and they're quoted for you. query_one / query_first, pages with opaque cursors you can sign, query_iter (optionally following child subqueries), count, explain (query plans), esf.flatten for CSV/DataFrame export, SOSL search and parameterized_search.
  • sObject Collections: create, update, upsert, delete and retrieve, chunked (200 rows per write, 2,000 ids per read) and run concurrently. Results keep the input order, and a failure in one chunk raises PartialFailure with every row's result.
  • Raw requests: sf.request() sends any REST call through the same auth, retry, error and logging pipeline.
  • Errors: one exception hierarchy for REST, OAuth and Collections errors, with opt-in custom error classes matched on [TAG] prefixes in validation-rule messages.
  • Usage and budgets: API usage read from the Sforce-Limit-Info header of every response, counters by operation, sObject and caller, threshold events and a guard for low-priority calls.
  • Logging: one sf.request event per call with secrets redacted, observers for stdlib logging, structlog and OpenTelemetry, a capture() summary per unit of work, and readable ESF_DEBUG=1 output.
  • Testing: FakeSalesforce / AsyncFakeSalesforce, a recorder and replayer for redacted traffic, and a pytest plugin.
  • CLI: esf whoami, esf limits, esf query, esf describe, esf request, esf generate models and esf generate actions.
  • More API areas: Files (streamed uploads and downloads), invocable actions and Apex REST, lead convert and merge, platform events, Bulk API 2.0, Tooling (including anonymous Apex), GraphQL, Composite, UI API, reports and dashboards, the Metadata API, and Pub/Sub subscriptions with Change Data Capture decoding ([pubsub] extra).
  • Integrations: FastAPI and Flask ([fastapi], [flask] extras).

For anything else, sf.request() can call any REST resource. See the documentation for each area.

Documentation

https://uttsavv.github.io/even-simpler-salesforce/ covers getting started, Salesforce setup (External Client Apps), each login flow, the guides, errors, logging, testing and the API reference.

Contributing

See CONTRIBUTING.md and AGENTS.md. Commits need a DCO sign-off.

Licence

Apache License 2.0; see LICENSE and NOTICE.

Not affiliated with or endorsed by Salesforce, Inc. "Salesforce" is a trademark of Salesforce, Inc.

Metadata

Release files for even-simpler-salesforce 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for even-simpler-salesforce 0.5.0
File Size Uploaded Provenance Actions
even_simpler_salesforce-0.5.0.tar.gz 1.5 MB With provenance Details for even_simpler_salesforce-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for even-simpler-salesforce 0.5.0
File Interpreter ABI Platform Actions
even_simpler_salesforce-0.5.0-py3-none-any.whl Python 3 none any Details for even_simpler_salesforce-0.5.0-py3-none-any.whl

Total release size: 2.0 MB

Release files / even_simpler_salesforce-0.5.0.tar.gz

Download URL even_simpler_salesforce-0.5.0.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
f68517ce94a741d2d594781ae924c28c71a7ab03b618d0ceda1fc465d702b7b3
BLAKE2b-256 checksum
How to use checksums
d4a1f0b349c279cd8f6eef87170807a642497422b767ec0b20bfcc5b974c1c79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Release files / even_simpler_salesforce-0.5.0-py3-none-any.whl

Download URL even_simpler_salesforce-0.5.0-py3-none-any.whl
Size 494.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d618d8c6edfc6388a54af9bea956b68c2ca889da8b86f56a7e4ddbf47a87e11c
BLAKE2b-256 checksum
How to use checksums
5efad80676d536851d5a38e42a7cba6ac3110ce60547ea3c3f7cf98ef0c731c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Security for even-simpler-salesforce 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for even_simpler_salesforce-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page