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.10.0

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.10.0
File Size Uploaded Provenance Actions
sqlframe-4.10.0.tar.gz 17.7 MB With provenance Details for sqlframe-4.10.0.tar.gz

Built distribution (wheel)

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

Total release size: 17.9 MB

Release files / sqlframe-4.10.0.tar.gz

Download URL sqlframe-4.10.0.tar.gz
Size 17.7 MB
Tags Source
SHA-256 checksum
How to use checksums
081446711d3c784d0492f676afa1c2974a3f1dabf9a72410087ab10c78080153
BLAKE2b-256 checksum
How to use checksums
9dd844aa38f65bfc9574d004ac881feb7bab124b26c11b329dd6d3572ba75eb3
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 5, 2026.

Transparency log

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

Download URL sqlframe-4.10.0-py3-none-any.whl
Size 257.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b9b4d95f8738838ca1178ad0b217a0fe7543b15a0b0d9818902856e4dd8ea1cc
BLAKE2b-256 checksum
How to use checksums
7e93d55a34b2f12f7eedc081dcdc3ed78ee73f14cf0fee8f31d2f787a992a592
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 5, 2026.

Transparency log

Security for sqlframe 4.10.0

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.10.0.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 5, 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.10.0 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