Python Connector for Salesforce
Python Connector for Salesforce is a connectivity solution for accessing Salesforce from Python applications to read and update data. It fully implements the Python DB API 2.0 specification. The connector is distributed as a wheel package for Windows, macOS, and Linux.
Standard SQL syntax
The connector fully supports the ANSI SQL standard and lets you execute SQL statements against your Salesforce data just like you would normally work with relational databases. Simple queries are directly converted to Salesforce API calls and executed on the Salesforce side. Complex queries are transformed into simpler queries, which are then converted to Salesforce API calls. The embedded SQL engine then processes the results in the local cache and applies advanced SQL features from the original complex query.
Connecting
To establish a connection to Salesforce, import the connector and authenticate using basic or OAuth 2.0 authentication.
Import the connector
First, import the Salesforce connector module:
import devart.salesforce as salesforce
Establish a connection
Connect to your Salesforce org using the connect() module method and obtain a connection object:
You can connect to Salesforce using either basic authentication or OAuth 2.0 authentication.
Basic authentication
For basic authentication, provide your Salesforce credentials and security token:
my_connection = salesforce.connect(
Authentication="Basic",
Host="login.salesforce.com",
UserId="your_username",
UserPassword="your_password",
SecurityToken="your_token"
)
Replace the example values with your actual connection values.
OAuth 2.0 authentication
For OAuth 2.0 authentication, first obtain a refresh token, then use it to establish the connection:
response = salesforce.signin(Host="login.salesforce.com")
my_connection = salesforce.connect(
Authentication="OAuth",
Host="login.salesforce.com",
RefreshToken=response["Refresh Token"]
)
Replace the example values with your actual connection values.
Server-to-server authentication
For server-to-server authentication using OAuth 2.0 with client credentials, provide your consumer key and secret:
my_connection = salesforce.connect(
Authentication="ServerToServer",
Host="your_host",
ConsumerKey="your_consumer_key",
ConsumerSecret="your_consumer_secret"
)
Replace the example values with your actual connection values.
? 2022-2026 Devart. All Rights Reserved. Request Support Python Connectors Forum Provide Feedback hljs.tabReplace = ' '; hljs.initHighlighting();
Querying data
Once connected to Salesforce, you can execute SQL queries to retrieve data from your Salesforce org.
Execute a query
Create a cursor object using the cursor() connection method.
my_cursor = my_connection.cursor()
Execute a SQL query using the execute() cursor method.
my_cursor.execute("SELECT * FROM employees")
Retrieve results using one of the fetch*() methods.
for row in my_cursor.fetchall():
print(row)
Parameterized queries
You can use parameterized queries to pass variable values to your SQL statements. This allows you to reuse the same query with different data and helps to prevent SQL injection attacks.
Pass parameters as a list or tuple to the
execute()
method:
query = "SELECT Id, Name FROM Contact WHERE Name = ? AND Email = ?"
params = ["Jordan Sanders", "jordansanders@example.com"]
my_cursor.execute(query, params)
results = my_cursor.fetchall()
for row in results:
print(row)
Each placeholder ? in the query is replaced with a corresponding value from the parameter list.
Ordering and activating the license
You can purchase a license for the connector on the ordering page:
https://www.devart.com/python/salesforce/ordering.html
To activate the license, follow the instructions in the documentation:
https://docs.devart.com/python/salesforce/activate-a-license.htm
What's new
Python Connector for Salesforce 1.4
- Added support for Python 3.15
- Added support for the Server-to-Server authorization
Metadata
Release files for devart-salesforce-connector 1.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 1.1 GB
Release files / devart_salesforce_connector-1.4.0-cp315-cp315-win_amd64.whl
| Download URL | devart_salesforce_connector-1.4.0-cp315-cp315-win_amd64.whl |
|---|---|
| Size | 39.6 MB |
| Tags | CPython 3.15 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f2201bb166b0a54f6b15c2430c5b1edfc23b55c775a03f6dac28c63fa3ffe332
|
|
BLAKE2b-256 checksum How to use checksums |
24210b56945e206d61abe7c22ef3cb9f1c8ece99be96d703a4b2229b3f1bb366
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_salesforce_connector-1.4.0-cp315-cp315-win32.whl
| Download URL | devart_salesforce_connector-1.4.0-cp315-cp315-win32.whl |
|---|---|
| Size | 36.2 MB |
| Tags | CPython 3.15 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
581db2aaf825f55df21bf5c491106ae48e90d0df1ac960ecf4ea3c260d4deb27
|
|
BLAKE2b-256 checksum How to use checksums |
b9e96c1896662679f7f7b48e9ea67dfc5cbf4901b2873a76af117a1dd376e6b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_salesforce_connector-1.4.0-cp315-cp315-manylinux_2_34_x86_64.whl
| Download URL | devart_salesforce_connector-1.4.0-cp315-cp315-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 37.3 MB |
| Tags | CPython 3.15 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
875368f253f3b73300b585a849e1641a8259e05b972c440dcd2da763c0198f13
|
|
BLAKE2b-256 checksum How to use checksums |
387f15df39ef0d28b9e0fe059ee48dc19d2e0e1e534e16afa7c2db3dbaf5058b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_salesforce_connector-1.4.0-cp315-cp315-macosx_10_9_universal2.whl
| Download URL | devart_salesforce_connector-1.4.0-cp315-cp315-macosx_10_9_universal2.whl |
|---|---|
| Size | 71.9 MB |
| Tags | CPython 3.15 macOS 10.9+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
b5b0c793164b58f2203a5a5b1bcc20f4109a0cbcd6f92fe90f03591b76ce1797
|
|
BLAKE2b-256 checksum How to use checksums |
4c77e4b2c9cbfe1c090cad607ccd5056dcb31f1cebca79760daa37e076e6122c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_salesforce_connector-1.4.0-cp314-cp314-win_amd64.whl
| Download URL | devart_salesforce_connector-1.4.0-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 39.6 MB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
2bb19f04e9937cbe20e44c3f8b9717612836b07529573dbd273acc59a9162406
|
|
BLAKE2b-256 checksum How to use checksums |
312640511449c4399c658163c3b778e206b76fcba6216cfbcfc946fd886e139e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_salesforce_connector-1.4.0-cp314-cp314-win32.whl
| Download URL | devart_salesforce_connector-1.4.0-cp314-cp314-win32.whl |
|---|---|
| Size | 36.2 MB |
| Tags | CPython 3.14 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
6b7330f3a1df6387a7025059b205e7a563469cf5d8dd7741341333874149bd09
|
|
BLAKE2b-256 checksum How to use checksums |
37bf7592302c1ca2323261ee343e8b6859d3b8f58359c42e57c0e9c7727e9f65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_salesforce_connector-1.4.0-cp314-cp314-manylinux_2_34_x86_64.whl
| Download URL | devart_salesforce_connector-1.4.0-cp314-cp314-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 37.3 MB |
| Tags | CPython 3.14 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
c0df38a39e5355c2d324909325e747622d8a510393868bfe048fb4734d338b9b
|
|
BLAKE2b-256 checksum How to use checksums |
1dfc40cae2803c68add844928bf02cad3fc4f42ad39a464c2d81d71ac8eec3ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_salesforce_connector-1.4.0-cp314-cp314-macosx_10_9_universal2.whl
| Download URL | devart_salesforce_connector-1.4.0-cp314-cp314-macosx_10_9_universal2.whl |
|---|---|
| Size | 71.9 MB |
| Tags | CPython 3.14 macOS 10.9+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
6583f950bd3d6f42b64a32a7eec71b55c3b7fb5a3eed4b2748db6aad847b5d78
|
|
BLAKE2b-256 checksum How to use checksums |
bc492a7f0c1fefe9a322a4219ca4611d48298a15c5636b3be45144b4fbef1498
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_salesforce_connector-1.4.0-cp313-cp313-win_amd64.whl
| Download URL | devart_salesforce_connector-1.4.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 38.5 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
ffc93d3aa5677b25a8e678eea0614ce59b925ad5845ef9cebc9850aca49170ea
|
|
BLAKE2b-256 checksum How to use checksums |
53739f2c49708db8d440de959742521f540961308e5c023a5ddc2bad0ba3c121
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_salesforce_connector-1.4.0-cp313-cp313-win32.whl
| Download URL | devart_salesforce_connector-1.4.0-cp313-cp313-win32.whl |
|---|---|
| Size | 35.3 MB |
| Tags | CPython 3.13 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
0cba8d235716dff14832ec351c96db65d32255f34927ead97c4bbe6746783abf
|
|
BLAKE2b-256 checksum How to use checksums |
7cf96aa7e1772491bf91cd429641da565cb73324fc2282884b233c56c4c9b0ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_salesforce_connector-1.4.0-cp313-cp313-manylinux_2_34_x86_64.whl
| Download URL | devart_salesforce_connector-1.4.0-cp313-cp313-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 37.3 MB |
| Tags | CPython 3.13 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
b6327798869b86fe560646bf0ca283921dcc4606862ce883848dbb449fffbdef
|
|
BLAKE2b-256 checksum How to use checksums |
1e460c971eb59b5505829846ff57d923ee1d64acf15f06fb94fe4752960ae14c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_salesforce_connector-1.4.0-cp313-cp313-macosx_10_9_universal2.whl
| Download URL | devart_salesforce_connector-1.4.0-cp313-cp313-macosx_10_9_universal2.whl |
|---|---|
| Size | 71.9 MB |
| Tags | CPython 3.13 macOS 10.9+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
1f473eceb4ffe77e0ab1260476df0cb1d4d1ff2560b0c911e4e238ce5bcab1d4
|
|
BLAKE2b-256 checksum How to use checksums |
20b84d86b83e84359a17ef6a2bf100359cf039f528b074a442a0400f434a4645
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_salesforce_connector-1.4.0-cp312-cp312-win_amd64.whl
| Download URL | devart_salesforce_connector-1.4.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 38.5 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
827a455cab6e653f605a2793cd1d07b3639ad2cedf05c9a449eae57d9298bdb2
|
|
BLAKE2b-256 checksum How to use checksums |
36faf8d7656ae6947408ad584e10e557298eab712895e919c2d90a1a7618d57f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_salesforce_connector-1.4.0-cp312-cp312-win32.whl
| Download URL | devart_salesforce_connector-1.4.0-cp312-cp312-win32.whl |
|---|---|
| Size | 35.3 MB |
| Tags | CPython 3.12 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
a5e44265ed1e26a510f61678a4a453d66eca39faa64d6b30cba4f4251f4dc8d2
|
|
BLAKE2b-256 checksum How to use checksums |
e206fba369e6cc493fcb74eb6e426c88488c68c5f06d51e99840a0bf6e5ccfe1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_salesforce_connector-1.4.0-cp312-cp312-manylinux_2_34_x86_64.whl
| Download URL | devart_salesforce_connector-1.4.0-cp312-cp312-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 37.3 MB |
| Tags | CPython 3.12 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
33c45ad13ef83abbd801133c76dfb3339c020d51c17bbf22284c45636a01c72f
|
|
BLAKE2b-256 checksum How to use checksums |
59aa5a469fb73f90f079535d3d1ef9ece62c31e46c17b08b26f35692c32b6b1e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_salesforce_connector-1.4.0-cp312-cp312-macosx_10_9_universal2.whl
| Download URL | devart_salesforce_connector-1.4.0-cp312-cp312-macosx_10_9_universal2.whl |
|---|---|
| Size | 71.9 MB |
| Tags | CPython 3.12 macOS 10.9+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
61987672948fa705b7d540efd3ed9b9e8c9247a7473d698ddcaa898029eb109b
|
|
BLAKE2b-256 checksum How to use checksums |
90070ec0260cf95a05e91eb6d2ee8a1a46300c8e976f100abf20a4db94e85760
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_salesforce_connector-1.4.0-cp311-cp311-win_amd64.whl
| Download URL | devart_salesforce_connector-1.4.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 38.5 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
6c8c21d917db50fe06d0fb8cb4a01413d58d188a834c2897145a88f7c94bfff8
|
|
BLAKE2b-256 checksum How to use checksums |
796f81f2ab0ca935a4cbb5ae0c2765a928f35e08f964b692df4322cca6dea30c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_salesforce_connector-1.4.0-cp311-cp311-win32.whl
| Download URL | devart_salesforce_connector-1.4.0-cp311-cp311-win32.whl |
|---|---|
| Size | 35.3 MB |
| Tags | CPython 3.11 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
090945cea440bb434d07cdbd0e5d56e0c66e44030634618db8a70db36f5a5681
|
|
BLAKE2b-256 checksum How to use checksums |
329c61bba660e9dabfc507efdf8cc2cebe2fcfaea59c03e551a1b8c7324ab280
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_salesforce_connector-1.4.0-cp311-cp311-manylinux_2_34_x86_64.whl
| Download URL | devart_salesforce_connector-1.4.0-cp311-cp311-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 37.3 MB |
| Tags | CPython 3.11 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
dca881cdfafd3733be326ccd2177c547fa8619e801bfa32dfd10f7b6fd13d148
|
|
BLAKE2b-256 checksum How to use checksums |
236dd5dee3adfd6c6258463262868dbf1c9952c92a26957a63fb63d775ce89f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_salesforce_connector-1.4.0-cp311-cp311-macosx_10_9_universal2.whl
| Download URL | devart_salesforce_connector-1.4.0-cp311-cp311-macosx_10_9_universal2.whl |
|---|---|
| Size | 71.9 MB |
| Tags | CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
3aab1683c50e913a87e860d8fc753ed2fee838165c02e95bc5cf54b9e2fe2302
|
|
BLAKE2b-256 checksum How to use checksums |
4efabdc31da2e64ba075cc3f76b3cfd18703dbe38a6f5e203ade567a1bf58b74
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_salesforce_connector-1.4.0-cp310-cp310-win_amd64.whl
| Download URL | devart_salesforce_connector-1.4.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 38.5 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
9bd359479a7e2a04f5e4463ccb69d9b62d8f0ce98f890af36aee8045d61fc699
|
|
BLAKE2b-256 checksum How to use checksums |
63025966ec2fafe0106e772d6cd1001fb8ca04dec35324b6eba4714ee49a294d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_salesforce_connector-1.4.0-cp310-cp310-win32.whl
| Download URL | devart_salesforce_connector-1.4.0-cp310-cp310-win32.whl |
|---|---|
| Size | 35.3 MB |
| Tags | CPython 3.10 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
47c2e0c6dcb7573640d5e3f2bc325b16fe47eab3ee84d6033b0b8e7433a900cb
|
|
BLAKE2b-256 checksum How to use checksums |
7626db5e5d0e408a6159a42a41ad7cb65b006739d170848de4741914957798d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_salesforce_connector-1.4.0-cp310-cp310-manylinux_2_34_x86_64.whl
| Download URL | devart_salesforce_connector-1.4.0-cp310-cp310-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 37.3 MB |
| Tags | CPython 3.10 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
b73a17a14206d6617eeb541626df1846f14ec7a7a31c845ff0af6e03c12cee1f
|
|
BLAKE2b-256 checksum How to use checksums |
543cbdf21fb58424bed1f2ad826e4080a759c57b576eedce1af31b487a136c11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_salesforce_connector-1.4.0-cp310-cp310-macosx_10_9_universal2.whl
| Download URL | devart_salesforce_connector-1.4.0-cp310-cp310-macosx_10_9_universal2.whl |
|---|---|
| Size | 71.9 MB |
| Tags | CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
48ffd88941ec542fed8a35faf38dc8ca40133a1681a2098af57a33e973994cdf
|
|
BLAKE2b-256 checksum How to use checksums |
06a957dd4afab3e241cb47ad04a759584f31dc2483ebbddd98bcdaa21fa13df4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Security for devart-salesforce-connector 1.4.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.