Skip to content

localstack/snowflake-connector-python

This branch is 1 commit ahead of, 83 commits behind snowflakedb/snowflake-connector-python:main.

Folders and files

NameName
Last commit message
Last commit date
Mar 21, 2025
Mar 8, 2022
Sep 13, 2024
Jul 10, 2023
Dec 5, 2024
Mar 21, 2025
Dec 4, 2024
Jan 17, 2024
Oct 6, 2021
Nov 15, 2023
Jun 4, 2024
Jul 20, 2023
Dec 5, 2024
Jan 4, 2024
Mar 17, 2023
Jan 17, 2024
Jan 5, 2021
Oct 30, 2024
Nov 28, 2022
Mar 17, 2023
Feb 10, 2023
Nov 10, 2023
Mar 21, 2025
Jan 26, 2024
Mar 21, 2025

Repository files navigation

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.8.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 Python 3.8.0 or higher. Clone the Snowflake Connector for Python repository, then run the following commands to create a wheel package using PEP-517 build:

git clone git@github.com: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.8 3.9"

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

NOTE

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.

Releases

No releases published

Packages

No packages published

Languages

  • Python 50.3%
  • C 45.6%
  • C++ 3.3%
  • Shell 0.4%
  • Cython 0.2%
  • Dockerfile 0.1%
  • Other 0.1%