Skip to main content

A Salesforce API Adapter for Python

Project description

Salesforce Toolkit for Python

A modern, Pythonic interface to Salesforce APIs.

Features

  • Clean, intuitive API design
  • Both synchronous and asynchronous client support
  • Simple SObject modeling using Python classes
  • Powerful query builder for SOQL queries
  • Efficient batch operations
  • Automatic session management and token refresh

Installation

pip install sf-toolkit

Quick Start

from sf_toolkit import SalesforceClient, SObject, cli_login
from sf_toolkit.data.fields import IdField, TextField

# Define a Salesforce object model
class Account(SObject, api_name="Account"):
    Id = IdField()
    Name = TextField()
    Industry = TextField()
    Description = TextField()

# Connect to Salesforce using the CLI authentication
with SalesforceClient(login=cli_login()) as sf:
    # Create a new account
    account = Account(Name="Acme Corp", Industry="Technology")
    account.save()

    # Query accounts
    query = SoqlSelect(Account)
    results = query.query()

    for acc in results.records:
        print(f"{acc.Name} ({acc.Industry})")

Documentation

View the full documentation on github.io.

Building the documentation

You can build the documentation locally with:

# One-time build
python -m sphinx -b html docs/source docs/build/html

# Or with auto-reload during development
sphinx-autobuild docs/source docs/build/html

The documentation is automatically built from docstrings in the code, so make sure to write comprehensive docstrings for all public classes and methods.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sf_toolkit-0.1.1.tar.gz (28.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sf_toolkit-0.1.1-py3-none-any.whl (34.8 kB view details)

Uploaded Python 3

File details

Details for the file sf_toolkit-0.1.1.tar.gz.

File metadata

  • Download URL: sf_toolkit-0.1.1.tar.gz
  • Upload date:
  • Size: 28.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for sf_toolkit-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3b5967a10c35bdeea846edfbc07bfe2843b28e0f5d89b31cd3fd8b101a8ec5b5
MD5 ffb13a15cfe95698e9a6e6e2d1a38da3
BLAKE2b-256 41c39c3a4946313a676da336f5f8e5b2a9817860ec9f36fd618ad3c1d777bed0

See more details on using hashes here.

Provenance

The following attestation bundles were made for sf_toolkit-0.1.1.tar.gz:

Publisher: pypi-publish.yml on AndroxxTraxxon/python-sf-toolkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sf_toolkit-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: sf_toolkit-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 34.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for sf_toolkit-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e2f02505fd5d517374cf91676b60ce15459a570dbc4a99f1bc8a61c2b322fae8
MD5 53f814f412bdfd216180e0b3e2e3f7a2
BLAKE2b-256 dea86416b97fec7c3f0a15ee445e704529fc3a731472464a0155b4718120a53d

See more details on using hashes here.

Provenance

The following attestation bundles were made for sf_toolkit-0.1.1-py3-none-any.whl:

Publisher: pypi-publish.yml on AndroxxTraxxon/python-sf-toolkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page