Skip to main content
SQLFrame

Your PySpark code. Your database.

Run the PySpark DataFrame API directly on your database.
No Spark cluster required.

Quickstart · Documentation · Report an issue

Why SQLFrame?

  • Familiar API. Write transformations with PySpark DataFrame operations, joins, and window functions.
  • Direct execution. Run your transformations on your database engine.
  • Visible SQL. Inspect, debug, and share the queries behind your DataFrame code.

Try it locally

Install SQLFrame with DuckDB. You need Python 3.10 or later; no cloud account or Spark installation is required.

pip install "sqlframe[duckdb]"
from sqlframe.duckdb import DuckDBSession

session = DuckDBSession()
df = session.createDataFrame(
    [("US", 120), ("UK", 80), ("US", 30)],
    ["country", "revenue"],
)
df.groupBy("country").sum("revenue").orderBy("country").show()
+---------+--------------+
| country | sum(revenue) |
+---------+--------------+
|    UK   |      80      |
|    US   |     150      |
+---------+--------------+

To inspect a transformation's SQL, call df.sql(optimize=True). Follow the quickstart for a complete walkthrough.

Choose your engine

Engine Install
DuckDB pip install "sqlframe[duckdb]"
BigQuery pip install "sqlframe[bigquery]"
Snowflake pip install "sqlframe[snowflake]"
Postgres pip install "sqlframe[postgres]"
ClickHouse (preview) pip install "sqlframe[clickhouse]"
Databricks pip install "sqlframe[databricks]"
Spark pip install "sqlframe[spark]"
Standalone pip install sqlframe
Trino (preview) pip install "sqlframe[trino]"

Standalone sessions generate SQL without a database connection. For local Parquet support, install sqlframe[standalone].

ClickHouse and Trino are preview integrations; see their guides for supported workflows and limits.

Community integrations: GizmoSQL · Redshift (pip install "sqlframe[redshift]").

SQLFrame is also available on conda-forge: conda install -c conda-forge sqlframe.

Already using PySpark?

Activate SQLFrame before importing PySpark to run supported transformations on another engine.

from sqlframe import activate

activate("duckdb")

from pyspark.sql import SparkSession

session = SparkSession.builder.getOrCreate()

You can also import SQLFrame directly, as shown in the quickstart. See the activation guide and your engine's API compatibility reference for details.

Keep exploring

SQLFrame is open source under the MIT license.

Metadata

Release files for sqlframe 4.11.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sqlframe 4.11.1
File Size Uploaded Provenance Actions
sqlframe-4.11.1.tar.gz 17.7 MB With provenance Details for sqlframe-4.11.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sqlframe 4.11.1
File Interpreter ABI Platform Actions
sqlframe-4.11.1-py3-none-any.whl Python 3 none any Details for sqlframe-4.11.1-py3-none-any.whl

Total release size: 17.9 MB

Release files / sqlframe-4.11.1.tar.gz

Download URL sqlframe-4.11.1.tar.gz
Size 17.7 MB
Tags Source
SHA-256 checksum
How to use checksums
c8e05b2981c32c31ea4a58e4aaa673242352ab11c4c1f79a35c9ede95c9bb83d
BLAKE2b-256 checksum
How to use checksums
6fbc54acb22952a78301197483a9e48180497a691af4a1b788c1315c64d68953
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Release files / sqlframe-4.11.1-py3-none-any.whl

Download URL sqlframe-4.11.1-py3-none-any.whl
Size 258.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
106c2bfbbe62b92a0e8b20f13109eba5f1531a86c59c5f19e66c6f9c1a059c3c
BLAKE2b-256 checksum
How to use checksums
b74c876ef7cb71081f948ff9bff850a9b11646095fb24250ead0d81bcfc828f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Security for sqlframe 4.11.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sqlframe-4.11.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

4.11.1 This release

2 release files Full provenance

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