{"library":"sqlframe","title":"SQLFrame","type":"library","description":"SQLFrame is a Python library that translates PySpark DataFrame API calls into SQL queries for multiple database engines (BigQuery, DuckDB, Postgres, Snowflake, Spark, etc.). Version 4.1.0 requires Python >=3.10 and uses sqlglot for SQL generation. Release cadence is approximately bi-weekly.","language":"python","status":"active","last_verified":"Fri May 01","install":{"commands":["pip install sqlframe","pip install sqlframe[bigquery]","pip install sqlframe[duckdb]","pip install sqlframe[snowflake]","pip install sqlframe[postgres]","pip install sqlframe[spark]"],"cli":null},"imports":["from sqlframe import Session","from sqlframe import DataFrame","from sqlframe import functions as F"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":"https://sqlframe.readthedocs.io","github":"https://github.com/eakmanrq/sqlframe","docs":null,"changelog":null,"pypi":"https://pypi.org/project/sqlframe/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"import os\nfrom sqlframe import Session\n\n# Create a session for DuckDB (no external DB needed)\nengine = \"duckdb\"\nos.environ[\"SQLFRAME_ENGINE\"] = engine  # optional\nsession = Session.builder.config(\"extension\", engine).getOrCreate()\n\n# Create a DataFrame from a list of tuples\ndf = session.createDataFrame([(1, \"Alice\"), (2, \"Bob\")], schema=[\"id\", \"name\"])\ndf.show()\n\n# Apply transformations\ndf_filtered = df.filter(df.name == \"Alice\").select(df.id)\nprint(df_filtered.sql())  # print generated SQL\n","lang":"python","description":"Quickstart using DuckDB engine (no external database needed). Set up a session, create a DataFrame, apply filters, and inspect generated SQL.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}