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]"
Databricks pip install "sqlframe[databricks]"
Spark pip install "sqlframe[spark]"
Standalone pip install sqlframe

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

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.8.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.8.0
File Size Uploaded Provenance Actions
sqlframe-4.8.0.tar.gz 29.8 MB With provenance Details for sqlframe-4.8.0.tar.gz

Built distribution (wheel)

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

Total release size: 30.0 MB

Release files / sqlframe-4.8.0.tar.gz

Download URL sqlframe-4.8.0.tar.gz
Size 29.8 MB
Tags Source
SHA-256 checksum
How to use checksums
666f0dedc2ea1112384d5374e24ac4f072801771ba6640a3b442a5a6a437f3d2
BLAKE2b-256 checksum
How to use checksums
56a2b8f7a688da2db5ab216f845d44c82e59d777b519d487d538f99d6d98de6c
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 Oct 26, 2026.

Transparency log

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

Download URL sqlframe-4.8.0-py3-none-any.whl
Size 228.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c672db9f45189ae2ee547f757eb9ddd3d343d124241d3f4a6acc6871b3c15067
BLAKE2b-256 checksum
How to use checksums
dcb4ff9bc8fdce004c53a31e14b58552375d5dfcee1b116380a06f5b2b0620ac
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 Oct 26, 2026.

Transparency log

Security for sqlframe 4.8.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.8.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 Oct 26, 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.8.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