Snowflake Connector for Python
The Snowflake Connector for Python enables Python applications to connect to Snowflake, a cloud-based data warehousing service. It conforms to the Python DB API 2.0 specification and is actively maintained, with the latest release being version 4.4.0 on March 24, 2026. The connector is compatible with Python versions 3.9 and above, including the newly supported Python 3.14. It follows a regular release cadence, with updates addressing security vulnerabilities, performance improvements, and new features.
Warnings
- breaking Configuration files with group or other write permissions now raise a ConfigSourceError to prevent potential credential tampering.
- deprecated Support for custom revocation error classes in OCSP response cache deserialization is deprecated.
Install
-
pip install snowflake-connector-python
Imports
- connect
from snowflake.connector import connect
Quickstart
import os
from snowflake.connector import connect
# Establish a connection using environment variables for credentials
conn = connect(
user=os.environ.get('SNOWFLAKE_USER', ''),
password=os.environ.get('SNOWFLAKE_PASSWORD', ''),
account=os.environ.get('SNOWFLAKE_ACCOUNT', ''),
warehouse=os.environ.get('SNOWFLAKE_WAREHOUSE', ''),
database=os.environ.get('SNOWFLAKE_DATABASE', ''),
schema=os.environ.get('SNOWFLAKE_SCHEMA', '')
)
# Create a cursor object
cur = conn.cursor()
# Execute a simple query
cur.execute('SELECT CURRENT_VERSION()')
# Fetch the result
result = cur.fetchone()
print(f'Snowflake version: {result[0]}')
# Close the cursor and connection
cur.close()
conn.close()