Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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 example apps (integrations ship in 0.2)
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 and esf query.

Composite, GraphQL, Bulk API 2.0, files, invocable actions, Apex REST helpers, lead convert and merge, Tooling, UI API, reports, Metadata and Pub/Sub are planned for later 0.x releases; see the documentation. Until then, sf.request() can call any REST resource.

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.1.0rc1

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.1.0rc1
File Size Uploaded Provenance Actions
even_simpler_salesforce-0.1.0rc1.tar.gz 997.0 kB With provenance Details for even_simpler_salesforce-0.1.0rc1.tar.gz

Built distribution (wheel)

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

Total release size: 1.2 MB

Release files / even_simpler_salesforce-0.1.0rc1.tar.gz

Download URL even_simpler_salesforce-0.1.0rc1.tar.gz
Size 997.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b6f83b727391190e1de135f793a0f0bfaa21095a2d3875382a575d4c97cf5311
BLAKE2b-256 checksum
How to use checksums
2628baff92ce52b4e72b00363ae2a2f9d8f74b85f803a1a63423c8bd64320e5e
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 9, 2026.

Transparency log

Release files / even_simpler_salesforce-0.1.0rc1-py3-none-any.whl

Download URL even_simpler_salesforce-0.1.0rc1-py3-none-any.whl
Size 172.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fdd5b68b3d307b0d5a699e576f9a93155451772e4b3ad1abf62e68cfe1510b7e
BLAKE2b-256 checksum
How to use checksums
16f87c8ecef939fee119273077a3383ef22ac954fc913be5a450e1da490b61b4
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 9, 2026.

Transparency log

Security for even-simpler-salesforce 0.1.0rc1

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.1.0rc1.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 9, 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
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