Back to directory
snowflakedb avatar

snowflake-connector-python

Snowflake Connector for Python. Read more below about its uses, features, and usage.

Clone repository

git clone https://github.com/snowflakedb/snowflake-connector-python.git

725

Stars

573

Forks

39

Watchers

Apache-2.0

License

Snowflake Connector for Python

Build and Test codecov PyPi License Apache-2.0 Codestyle Black

This package includes the Snowflake Connector for Python, which conforms to the Python DB API 2.0 specification.

The Snowflake Connector for Python provides an interface for developing Python applications that can connect to Snowflake and perform all standard operations. It provides a programming alternative to developing applications in Java or C/C++ using the Snowflake JDBC or ODBC drivers.

The connector has no dependencies on JDBC or ODBC. It can be installed using pip on Linux, Mac OSX, and Windows platforms where Python 3.10.0 (or higher) is installed.

Snowflake Documentation is available at: https://docs.snowflake.com/

Feel free to file an issue or submit a PR here for general cases. For official support, contact Snowflake support at: https://community.snowflake.com/s/article/How-To-Submit-a-Support-Case-in-Snowflake-Lodge

How to build

Locally

Install a supported Python version. Clone the Snowflake Connector for Python repository, then run the following commands to create a wheel package using PEP-517 build:

git clone [email protected]:snowflakedb/snowflake-connector-python.git
cd snowflake-connector-python
python -m pip install -U pip setuptools wheel build
python -m build --wheel .

Find the snowflake_connector_python*.whl package in the ./dist directory.

In Docker

Or use our Dockerized build script ci/build_docker.sh and find the built wheel files in dist/repaired_wheels.

Note: ci/build_docker.sh can be used to compile only certain versions, like this: ci/build_docker.sh "3.10 3.11"

Code hygiene and other utilities

These tools are integrated into tox to allow us to easily set them up universally on any computer.

  • fix_lint: Runs pre-commit to check for a bunch of lint issues. This can be installed to run upon each time a commit is created locally, keep an eye out for the hint that this environment prints upon succeeding.
  • coverage: Runs coverage.py to combine generated coverage data files. Useful when multiple categories were run and we would like to have an overall coverage data file created for them.
  • flake8: (Deprecated) Similar to fix_lint, but only runs flake8 checks.

Disable telemetry

By default, the Snowflake Connector for Python collects telemetry data to improve the product. You can disable the telemetry data collection by setting the session parameter CLIENT_TELEMETRY_ENABLED to False when connecting to Snowflake:

import snowflake.connector
conn = snowflake.connector.connect(
    user='XXXX',
    password='XXXX',
    account='XXXX',
    session_parameters={
      "CLIENT_TELEMETRY_ENABLED": False,
    }
)

Alternatively, you can disable the telemetry data collection by setting the telemetry_enabled property to False on the SnowflakeConnection object:

import snowflake.connector
conn = snowflake.connector.connect(
    user='XXXX',
    password='XXXX',
    account='XXXX',
)
conn.telemetry_enabled = False

Verifying Package Signatures

To ensure the authenticity and integrity of the Python package, follow the steps below to verify the package signature using cosign.

Steps to verify the signature:

Notes

This library currently does not support GCP regional endpoints. Please ensure that any workloads using through this library do not require support for regional endpoints on GCP. If you have questions about this, please contact Snowflake Support.

The driver uses Rust library called sf_mini_core, you can find its source code here

Releases

Aug 7, 2026

4.7.2

Download .zip

v4.7.2(Aug 6,2026)

Fixed a thread leak in the file transfer agent by properly shutting down ThreadPoolExecutors after PUT/GET transfers (SNOW-3556240, #2878). Fixed split_statements treating // as SQ...

Jul 15, 2026

3.18.1

Download .zip

v3.18.1(July 15,2026)

Improved verification of TLS connections (SNOW-3675579). Fixed FIPS environments md5 hash issues with multipart upload on Azure. Fixed a bug where Azure GET commands would incor...

Jul 15, 2026

4.7.1

Download .zip

v4.7.1(Jul 15,2026)

Added support for Python 3.14t (free-threaded).

Note: Python 3.14t CI testing excludes win_arm64 (no cryptography wheels available) and mitmproxy proxy tests on all platforms (tr...

Jul 2, 2026

4.7.0

Download .zip

v4.7.0(Jul 2,2026)

Fixed python-connector.log not rotating on Windows, and every record being logged twice, when easy logging is enabled via config.toml (SNOW-3680325).

Note: As part of this fix, ea...

May 28, 2026

4.6.0

Download .zip

v4.6.0(May 28,2026)

Dropped support for Python 3.9. The minimum supported version is now Python 3.10. Fixed sdist to only install the minicore binary matching the current platform (SNOW-3526469). Pre...