snowflake-snowpark-python 1.54.0


pip install snowflake-snowpark-python

  Latest version

Released: Jul 29, 2026


Meta
Author: Snowflake, Inc
Requires Python: >=3.10, <3.15

Classifiers

Development Status
  • 5 - Production/Stable

Environment
  • Console
  • Other Environment

Intended Audience
  • Developers
  • Education
  • Information Technology
  • System Administrators

License
  • OSI Approved :: Apache Software License

Operating System
  • OS Independent

Programming Language
  • SQL
  • Python :: 3 :: Only
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13

Topic
  • Database
  • Software Development
  • Software Development :: Libraries
  • Software Development :: Libraries :: Application Frameworks
  • Software Development :: Libraries :: Python Modules
  • Scientific/Engineering :: Information Analysis

Snowflake Snowpark Python and Snowpark pandas APIs

Build and Test codecov PyPi License Apache-2.0 Codestyle Black

The Snowpark library provides intuitive APIs for querying and processing data in a data pipeline. Using this library, you can build applications that process data in Snowflake without having to move data to the system where your application code runs.

Source code | Snowpark Python developer guide | Snowpark Python API reference | Snowpark pandas developer guide | Snowpark pandas API reference | Product documentation | Samples

Getting started

Have your Snowflake account ready

If you don't have a Snowflake account yet, you can sign up for a 30-day free trial account.

Create a Python virtual environment

You can use miniconda, anaconda, or virtualenv to create a Python 3.10, 3.11, 3.12 or 3.13 virtual environment.

For Snowpark pandas, only Python 3.10 or 3.11 is supported.

To have the best experience when using it with UDFs, creating a local conda environment with the Snowflake channel is recommended.

Install the library to the Python virtual environment

pip install snowflake-snowpark-python

To use the Snowpark pandas API, you can optionally install the following, which installs modin in the same environment. The Snowpark pandas API provides a familiar interface for pandas users to query and process data directly in Snowflake.

pip install "snowflake-snowpark-python[modin]"

Create a session and use the Snowpark Python API

from snowflake.snowpark import Session

connection_parameters = {
  "account": "<your snowflake account>",
  "user": "<your snowflake user>",
  "password": "<your snowflake password>",
  "role": "<snowflake user role>",
  "warehouse": "<snowflake warehouse>",
  "database": "<snowflake database>",
  "schema": "<snowflake schema>"
}

session = Session.builder.configs(connection_parameters).create()
# Create a Snowpark dataframe from input data
df = session.create_dataframe([[1, 2], [3, 4]], schema=["a", "b"]) 
df = df.filter(df.a > 1)
result = df.collect()
df.show()

# -------------
# |"A"  |"B"  |
# -------------
# |3    |4    |
# -------------

Create a session and use the Snowpark pandas API

import modin.pandas as pd
import snowflake.snowpark.modin.plugin
from snowflake.snowpark import Session

CONNECTION_PARAMETERS = {
    'account': '<myaccount>',
    'user': '<myuser>',
    'password': '<mypassword>',
    'role': '<myrole>',
    'database': '<mydatabase>',
    'schema': '<myschema>',
    'warehouse': '<mywarehouse>',
}
session = Session.builder.configs(CONNECTION_PARAMETERS).create()

# Create a Snowpark pandas dataframe from input data
df = pd.DataFrame([['a', 2.0, 1],['b', 4.0, 2],['c', 6.0, None]], columns=["COL_STR", "COL_FLOAT", "COL_INT"])
df
#   COL_STR  COL_FLOAT  COL_INT
# 0       a        2.0      1.0
# 1       b        4.0      2.0
# 2       c        6.0      NaN

df.shape
# (3, 3)

df.head(2)
#   COL_STR  COL_FLOAT  COL_INT
# 0       a        2.0        1
# 1       b        4.0        2

df.dropna(subset=["COL_INT"], inplace=True)

df
#   COL_STR  COL_FLOAT  COL_INT
# 0       a        2.0        1
# 1       b        4.0        2

df.shape
# (2, 3)

df.head(2)
#   COL_STR  COL_FLOAT  COL_INT
# 0       a        2.0        1
# 1       b        4.0        2

# Save the result back to Snowflake with a row_pos column.
df.reset_index(drop=True).to_snowflake('pandas_test2', index=True, index_label=['row_pos'])

Samples

The Snowpark Python developer guide, Snowpark Python API references, Snowpark pandas developer guide, and Snowpark pandas api references have basic sample code. Snowflake-Labs has more curated demos.

Logging

Configure logging level for snowflake.snowpark for Snowpark Python API logs. Snowpark uses the Snowflake Python Connector. So you may also want to configure the logging level for snowflake.connector when the error is in the Python Connector. For instance,

import logging
for logger_name in ('snowflake.snowpark', 'snowflake.connector'):
    logger = logging.getLogger(logger_name)
    logger.setLevel(logging.DEBUG)
    ch = logging.StreamHandler()
    ch.setLevel(logging.DEBUG)
    ch.setFormatter(logging.Formatter('%(asctime)s - %(threadName)s %(filename)s:%(lineno)d - %(funcName)s() - %(levelname)s - %(message)s'))
    logger.addHandler(ch)

Reading and writing to pandas DataFrame

Snowpark Python API supports reading from and writing to a pandas DataFrame via the to_pandas and write_pandas commands.

To use these operations, ensure that pandas is installed in the same environment. You can install pandas alongside Snowpark Python by executing the following command:

pip install "snowflake-snowpark-python[pandas]"

Once pandas is installed, you can convert between a Snowpark DataFrame and pandas DataFrame as follows:

df = session.create_dataframe([[1, 2], [3, 4]], schema=["a", "b"])
# Convert Snowpark DataFrame to pandas DataFrame
pandas_df = df.to_pandas() 
# Write pandas DataFrame to a Snowflake table and return Snowpark DataFrame
snowpark_df = session.write_pandas(pandas_df, "new_table", auto_create_table=True)

Snowpark pandas API also supports writing to pandas:

import modin.pandas as pd
df = pd.DataFrame([[1, 2], [3, 4]], columns=["a", "b"])
# Convert Snowpark pandas DataFrame to pandas DataFrame
pandas_df = df.to_pandas() 

Note that the above Snowpark pandas commands will work if Snowpark is installed with the [modin] option, the additional [pandas] installation is not required.

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:

  • Install cosign:
  • Download the file from the repository like pypi:
  • Download the signature files from the release tag, replace the version number with the version you are verifying:
  • Verify signature:
    # replace the version number with the version you are verifying
    ./cosign verify-blob snowflake_snowpark_python-1.22.1-py3-none-any.whl  \
    --certificate snowflake_snowpark_python-1.22.1-py3-none-any.whl.crt \
    --certificate-identity https://github.com/snowflakedb/snowpark-python/.github/workflows/python-publish.yml@refs/tags/v1.22.1 \
    --certificate-oidc-issuer https://token.actions.githubusercontent.com \
    --signature snowflake_snowpark_python-1.22.1-py3-none-any.whl.sig
    Verified OK
    

Contributing

Please refer to CONTRIBUTING.md.

1.54.0 Jul 29, 2026
1.53.1 Jul 15, 2026
1.53.0 Jul 09, 2026
1.52.0 Jun 10, 2026
1.51.1 May 28, 2026
1.51.0 May 18, 2026
1.50.1 May 06, 2026
1.50.0 Apr 23, 2026
1.49.0 Apr 13, 2026
1.48.1 Mar 31, 2026
1.48.0 Mar 23, 2026
1.47.0 Mar 05, 2026
1.46.0 Feb 25, 2026
1.45.0 Feb 02, 2026
1.44.0 Dec 15, 2025
1.43.0 Dec 03, 2025
1.42.0 Oct 28, 2025
1.41.0 Oct 23, 2025
1.40.0 Oct 06, 2025
1.39.1 Sep 26, 2025
1.39.0 Sep 17, 2025
1.38.0 Sep 04, 2025
1.37.0 Aug 18, 2025
1.36.0 Aug 07, 2025
1.35.0 Jul 24, 2025
1.34.0 Jul 15, 2025
1.33.0 Jun 19, 2025
1.32.0 May 15, 2025
1.31.1 May 05, 2025
1.31.0 Apr 24, 2025
1.30.0 Mar 27, 2025
1.29.1 Mar 12, 2025
1.29.0 Mar 06, 2025
1.28.0 Feb 20, 2025
1.27.0 Feb 04, 2025
1.26.0 Dec 05, 2024
1.25.0 Nov 14, 2024
1.24.0 Oct 28, 2024
1.23.0 Oct 10, 2024
1.22.1 Sep 12, 2024
1.22.0 Sep 11, 2024
1.21.1 Sep 05, 2024
1.21.0 Aug 19, 2024
1.20.0 Jul 17, 2024
1.19.0 Jun 26, 2024
1.18.0 May 28, 2024
1.17.0 May 21, 2024
1.16.0 May 08, 2024
1.15.0 Apr 24, 2024
1.14.0 Mar 21, 2024
1.13.0 Feb 27, 2024
1.12.1 Feb 08, 2024
1.12.0 Jan 31, 2024
1.11.1 Dec 07, 2023
1.11.0 Dec 07, 2023
1.10.0 Nov 03, 2023
1.9.0 Oct 16, 2023
1.8.0 Sep 15, 2023
1.7.0 Aug 28, 2023
1.6.1 Aug 03, 2023
1.6.0 Jul 31, 2023
1.5.1 Jun 21, 2023
1.5.0 Jun 13, 2023
1.4.0 Apr 24, 2023
1.3.0 Mar 29, 2023
1.2.0 Mar 03, 2023
1.1.0 Jan 27, 2023
1.0.0 Nov 01, 2022
0.12.0 Oct 14, 2022
0.11.0 Sep 29, 2022
0.10.0 Sep 16, 2022
0.9.0 Aug 31, 2022
0.8.0 Jul 25, 2022
0.7.0 Jun 07, 2022
0.6.0 Jun 07, 2022
Extras:
Dependencies:
setuptools (>=40.6.0)
wheel
snowflake-connector-python (<5.0.0,>=3.17.0)
typing-extensions (<5.0.0,>=4.1.0)
pyyaml
cloudpickle (!=2.1.0,!=2.2.0,<=3.1.1,>=1.6.0)
protobuf (<6.34,>=3.20)
protobuf (<6.34,>=5.29.0)
python-dateutil
tzlocal