Skip to main content

Python Connector for Snowflake

Python Connector for Snowflake is a connectivity solution for accessing the Snowflake data cloud from Python applications. It fully implements the Python DB API 2.0 specification. The connector is distributed as a wheel package for Windows and Windows Server.

Connecting

To establish a connection to Snowflake, import the connector and authenticate using basic, OAuth 2.0, or key pair authentication.

Import the Snowflake connector module.

import devart.snowflake as snowflake

Connect to your Snowflake environment using the connect() module method and obtain a connection object. You can connect to Snowflake using either basic authentication, OAuth 2.0 authentication, or key pair authentication.

Basic authentication

For basic authentication, provide the Snowflake server URL, user name, and password.

my_connection = snowflake.connect(
    Domain="<your_server_url>",
    UserId="<your_username>",
    Password="<your_password>",
    Database="<your_database>"
)

OAuth 2.0 authentication

For OAuth 2.0 authentication, provide the Snowflake server URL and your OAuth client ID and client secret.

response = snowflake.signin(
    Domain="<your_server_url>",
    ClientId="<your_client_id>",
    ClientSecret="<your_client_secret>"
)
my_connection = snowflake.connect(
    Domain="<your_server_url>",
    Authentication="OAuth",
    ClientId="<your_client_id>",
    ClientSecret="<your_client_secret>",
    RefreshToken=response["Refresh Token"],
    Database="<your_database>"
)

Key pair authentication

For key pair authentication, provide the Snowflake server URL, user name, and private key (with its passphrase, if the key is encrypted).

my_connection = snowflake.connect(
    Authentication="KeyPair",
    Domain="<your_server_url>",
    UserId="<your_username>",
    Database="<your_database>",
    Passphrase="<your_passphrase>",
    PrivateKey="<your_private_key>"
)

Querying data

Once connected, you can execute SQL queries to retrieve data from your Snowflake database.

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:

for row in my_cursor.fetchall(): 
    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/snowflake/ordering.html

To activate the license, follow the instructions in the documentation:
https://docs.devart.com/python/snowflake/activate-a-license.htm

What's new

Python Connector for Snowflake 1.4

  • Added support for Python 3.15
  • Added support for the OAuth authentication
  • Added support for the key-pair authentication

Metadata

Release files for devart-snowflake-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)

Table of built distributions (wheels) for devart-snowflake-connector 1.4.0
File Actions
devart_snowflake_connector-1.4.0-cp315-cp315-win_amd64.whl CPython 3.15 CPython 3.15 Windows x86-64 Details for devart_snowflake_connector-1.4.0-cp315-cp315-win_amd64.whl
devart_snowflake_connector-1.4.0-cp315-cp315-win32.whl CPython 3.15 CPython 3.15 Windows x86-32 Details for devart_snowflake_connector-1.4.0-cp315-cp315-win32.whl
devart_snowflake_connector-1.4.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for devart_snowflake_connector-1.4.0-cp314-cp314-win_amd64.whl
devart_snowflake_connector-1.4.0-cp314-cp314-win32.whl CPython 3.14 CPython 3.14 Windows x86-32 Details for devart_snowflake_connector-1.4.0-cp314-cp314-win32.whl
devart_snowflake_connector-1.4.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for devart_snowflake_connector-1.4.0-cp313-cp313-win_amd64.whl
devart_snowflake_connector-1.4.0-cp313-cp313-win32.whl CPython 3.13 CPython 3.13 Windows x86-32 Details for devart_snowflake_connector-1.4.0-cp313-cp313-win32.whl
devart_snowflake_connector-1.4.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for devart_snowflake_connector-1.4.0-cp312-cp312-win_amd64.whl
devart_snowflake_connector-1.4.0-cp312-cp312-win32.whl CPython 3.12 CPython 3.12 Windows x86-32 Details for devart_snowflake_connector-1.4.0-cp312-cp312-win32.whl
devart_snowflake_connector-1.4.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for devart_snowflake_connector-1.4.0-cp311-cp311-win_amd64.whl
devart_snowflake_connector-1.4.0-cp311-cp311-win32.whl CPython 3.11 CPython 3.11 Windows x86-32 Details for devart_snowflake_connector-1.4.0-cp311-cp311-win32.whl
devart_snowflake_connector-1.4.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for devart_snowflake_connector-1.4.0-cp310-cp310-win_amd64.whl
devart_snowflake_connector-1.4.0-cp310-cp310-win32.whl CPython 3.10 CPython 3.10 Windows x86-32 Details for devart_snowflake_connector-1.4.0-cp310-cp310-win32.whl

Total release size: 115.2 MB

Release files / devart_snowflake_connector-1.4.0-cp315-cp315-win_amd64.whl

Download URL devart_snowflake_connector-1.4.0-cp315-cp315-win_amd64.whl
Size 9.8 MB
Tags CPython 3.15 Windows x86-64
SHA-256 checksum
How to use checksums
9df806f08b4fec3a1e0457184ca20e909bb4cdf429073ec3476340fa90d7d7a6
BLAKE2b-256 checksum
How to use checksums
2b83e65174c63821a517f8302e8c30e716c40b5ceae7f1ede2e51d0ff08eb240
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Release files / devart_snowflake_connector-1.4.0-cp315-cp315-win32.whl

Download URL devart_snowflake_connector-1.4.0-cp315-cp315-win32.whl
Size 9.5 MB
Tags CPython 3.15 Windows x86-32
SHA-256 checksum
How to use checksums
a991730fda2d0b7dad572c235e6f79fe4d86f29af63252c6806063b3abffdce6
BLAKE2b-256 checksum
How to use checksums
c6d77993e19cebb217b591517ca532d0e2f99fbbd8e30e8c6fa548d533576de0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Release files / devart_snowflake_connector-1.4.0-cp314-cp314-win_amd64.whl

Download URL devart_snowflake_connector-1.4.0-cp314-cp314-win_amd64.whl
Size 9.8 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
077c6afabff6f8ce9d8104f8f09303aab21f515d17fca7f6993427e09f34f553
BLAKE2b-256 checksum
How to use checksums
1bb65d4f7e036b5293f6c30b8f6fd1da9fb46309af2d9d79a1951a72aae3e4a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Release files / devart_snowflake_connector-1.4.0-cp314-cp314-win32.whl

Download URL devart_snowflake_connector-1.4.0-cp314-cp314-win32.whl
Size 9.5 MB
Tags CPython 3.14 Windows x86-32
SHA-256 checksum
How to use checksums
d5e5bb6b9a3f626143c741cc3fd8c39b303e3823939993c7011dfff392dca733
BLAKE2b-256 checksum
How to use checksums
10924b7cde79bb403cd7e9a404c512c61cae1ecd3d2f1abd58ac2dcdf74bb188
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Release files / devart_snowflake_connector-1.4.0-cp313-cp313-win_amd64.whl

Download URL devart_snowflake_connector-1.4.0-cp313-cp313-win_amd64.whl
Size 9.7 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
396cddcd8e827265e213b8b7221b7af271b9535c2e6049f7d2679cd999320ebb
BLAKE2b-256 checksum
How to use checksums
f0cba80a0279ec519b1fcf341d9a2718e8657f8511918baf5c67799daf5bc9b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Release files / devart_snowflake_connector-1.4.0-cp313-cp313-win32.whl

Download URL devart_snowflake_connector-1.4.0-cp313-cp313-win32.whl
Size 9.5 MB
Tags CPython 3.13 Windows x86-32
SHA-256 checksum
How to use checksums
8b8b2d262293ba6f240ef0ea69491d59624e385e1fbe42991efcfb6496c73cdf
BLAKE2b-256 checksum
How to use checksums
cda62baf68722db98fa68d903ea8e8b3009ed77559e75deee4d23b44282c742f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Release files / devart_snowflake_connector-1.4.0-cp312-cp312-win_amd64.whl

Download URL devart_snowflake_connector-1.4.0-cp312-cp312-win_amd64.whl
Size 9.7 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
06b5b0d03bc37304b6b2c7e3553658189f4796610172821aae0cfd212949fe06
BLAKE2b-256 checksum
How to use checksums
a8764d96bd86b67932fe12587a192945a598c7b2c0756d4c093f6365adc6b520
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Release files / devart_snowflake_connector-1.4.0-cp312-cp312-win32.whl

Download URL devart_snowflake_connector-1.4.0-cp312-cp312-win32.whl
Size 9.5 MB
Tags CPython 3.12 Windows x86-32
SHA-256 checksum
How to use checksums
9fce71ebd0abbbd7de8e17093b71d8123299236de7c00504405ccffd9d4ffa40
BLAKE2b-256 checksum
How to use checksums
311f5e4e89734e4b72ee156aa79b6f00d4e1e9640b17eeb129e3546b19a775c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Release files / devart_snowflake_connector-1.4.0-cp311-cp311-win_amd64.whl

Download URL devart_snowflake_connector-1.4.0-cp311-cp311-win_amd64.whl
Size 9.7 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
011a0c17ed2bbbe8abbdd70049e018b3719b832c9b9a905d52e89b5ae84693bb
BLAKE2b-256 checksum
How to use checksums
ec0d1180196afb77b2b30b0f095661505d19099148e927ab7db7a2c8626077b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Release files / devart_snowflake_connector-1.4.0-cp311-cp311-win32.whl

Download URL devart_snowflake_connector-1.4.0-cp311-cp311-win32.whl
Size 9.5 MB
Tags CPython 3.11 Windows x86-32
SHA-256 checksum
How to use checksums
765d0bc703def18896f825c03a59587bb308c5170be1915d6bdbe548a4ef7e46
BLAKE2b-256 checksum
How to use checksums
98ed22f263989889aad16c12e2336099f75cf0b7d4ef3b515fbb3cd7441db4c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Release files / devart_snowflake_connector-1.4.0-cp310-cp310-win_amd64.whl

Download URL devart_snowflake_connector-1.4.0-cp310-cp310-win_amd64.whl
Size 9.7 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
1c9bf29be3520d039eb9cf034b99ba32c6d6a55d3b8a3b9c8f60031b011ede4f
BLAKE2b-256 checksum
How to use checksums
3cd1d7bf8b2514595cab60751dd252fa6adf1e83c8325410ec5c85e102ce6e9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Release files / devart_snowflake_connector-1.4.0-cp310-cp310-win32.whl

Download URL devart_snowflake_connector-1.4.0-cp310-cp310-win32.whl
Size 9.5 MB
Tags CPython 3.10 Windows x86-32
SHA-256 checksum
How to use checksums
bfb65bd2e54231c2da313e7d94296e7c02480ef05a4777fdb456176735f45c64
BLAKE2b-256 checksum
How to use checksums
4ec2eb0c2a445df99d86b8057e429e275ba1f3e3002d117521c158ab802551e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Security for devart-snowflake-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.

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