PYPI PACKAGE AUDIT v1.0.2 Enterprise Healthy

thunderduck-sqlalchemy

SQLAlchemy dialect and DBAPI for thunderduck.ai — query your lakehouse from Superset, Airflow, pandas and friends.

PyPkgScore thunderduck-sqlalchemy
Methodology & Criteria ♥ Donate
870 / 1000
Quick Install
pip install thunderduck-sqlalchemy
1. Governance
150/200
2. PEP Metadata
200/200
3. Security
200/200
4. Docs & SEO
155/200
5. CI Engineering
165/200
📣 Share Audit: Share this report and visual preview in the current language
Advertisement
PYPI TELEMETRY

Downloads & Community Adoption

Last 30 days (without mirrors)
Last 7 days
107
Last 30 days
157
Total (180 days)
417
Metric / Ecosystem Status / Value Source
Downloads (30d / 180d) — PyPI Stats (without mirrors)
Trusted Publishing (PEP 740) ✓ Verified OIDC PyPI Integrity / Sigstore
Django Packages — djangopackages.org
PyTech / PyPkgScore 870 / 1000 PyPkgScore Engine

Health & Engineering Analysis (5 Pillars)

1. Governance & Community150 / 200 ▾
LICENSE✓ 50 pts
SECURITY.md✓ 50 pts
CONTRIBUTING.md✓ 50 pts
CODE_OF_CONDUCT.md✕ 0 pts
2. PEP Metadata & Packaging200 / 200 ▾
Wheel (.whl)✓ 50 pts
pyproject.toml✓ 50 pts
Project URLs✓ 50 pts
Trove Classifiers✓ 50 pts
3. Security & Supply Chain200 / 200 ▾
Zero CVEs (OSV)✓ 60 pts
Trusted Publishing (OIDC)✓ 50 pts
Snyk / Audit Link✓ 40 pts
HTTPS Repository✓ 50 pts
4. Documentation, SEO & Ecosystem155 / 200 ▾
Structured README✓ 60 pts
Read the Docs✓ 50 pts
Django Packages✕ 0 pts
Website / Technical Articles✓ 45 pts
5. Engineering, CI & Quality165 / 200 ▾
Automated Tests✓ 65 pts
GitHub Actions CI✓ 65 pts
CHANGELOG.md✕ 0 pts
Env & Lockfile (uv/rye/poetry/pdm/hatch)✓ 35 pts
Advertisement
README & DOCS

Official Documentation & Usage Guide — thunderduck-sqlalchemy

PyPI Metadata v1.0.2
Show full original documentation (English README) ▾

thunderduck-sqlalchemy

A SQLAlchemy dialect and PEP 249 DBAPI for thunderduck. Query your lakehouse from anything that speaks SQLAlchemy — Superset, Airflow, Dagster, Redash, pandas, Jupyter, Streamlit.

pip install thunderduck-sqlalchemy

Works with SQLAlchemy 1.4 and 2.x, on Python 3.10+ — so it installs cleanly into Apache Superset (which pins SQLAlchemy 1.4) as well as modern Airflow, Dagster and pandas environments.

Source on GitHub · Documentation · PyPI

Connect

Create an API token in the thunderduck console (Settings → API Tokens; it starts with tdk_ and is shown once), then:

from sqlalchemy import create_engine, text
from sqlalchemy.pool import NullPool

engine = create_engine(
    "thunderduck://:[email protected]/",
    poolclass=NullPool,
)

with engine.connect() as conn:
    for row in conn.execute(
        text('SELECT * FROM "tndr_postgres_demo"."ecommerce"."orders" LIMIT 10')
    ):
        print(row)

pandas works directly:

import pandas as pd

df = pd.read_sql('SELECT * FROM "thunder_duck_demo"."iris"', engine)

URL options

Option Default Meaning
password / ?token= — Required. Your tdk_… API token.
?ssl=false true Use plain HTTP instead of HTTPS. Only for a server that does not terminate TLS itself.
?poll_ms= 1000 How often to poll for completion.
?timeout_ms= 300000 How long to wait for a query.
?arraysize= 1000 Rows fetched per page.

Table names

thunderduck names are catalog.schema.table (flat-file catalogs) or catalog.table (Iceberg/Nessie catalogs). SQLAlchemy models two levels, so the schema is the whole dotted prefix:

from sqlalchemy import MetaData, Table

md = MetaData()
orders = Table("orders", md, schema="tndr_postgres_demo.ecommerce", autoload_with=engine)  # 3-level
iris = Table("iris", md, schema="tndr_glue_demo", autoload_with=engine)  # 2-level

Reflection (inspect(engine).get_schema_names() etc.) reads thunderduck's catalog API rather than issuing SQL, so browsing schemas is fast and free.

Apache Superset

Installing the package is all that is needed — it registers a Superset DB engine spec automatically. Add a database of type Other with:

thunderduck://:[email protected]/

Superset's stop button genuinely cancels the running query.

How it works, and what follows from that

Every statement is submitted to thunderduck's REST API, which runs it as an isolated Kubernetes Job; results are then paged back over HTTP. That model has consequences worth knowing up front:

  • Latency. Expect seconds, not milliseconds, before the first row. Built for analytics and BI, not for tight interactive loops.
  • Read-only. No DML, no DDL, no transactions. commit() and rollback() are no-ops.
  • Use NullPool. A connection holds no server-side state, so pooling buys nothing. The driver also never issues a SELECT 1 health check, because that would start a whole Job.
  • Parameters are rendered client-side. thunderduck's API accepts SQL only, so this driver renders bound parameters into the statement, escaping them strictly and refusing types it does not recognise. Always pass untrusted values as parameters — never build SQL by string concatenation. The paramstyle is pyformat, so — as with psycopg2 — a literal percent sign in hand-written SQL must be escaped as %% when you pass parameters.
  • Row ceiling. The server caps how many rows one page returns and how many a result set stores. Very large result sets are truncated; aggregate in SQL rather than pulling raw rows.

Also available

For JVM tools (DBeaver, DataGrip) there is a JDBC driver, and for .NET there is Thunderduck.Data.

Development

uv sync --dev
uv run pytest
uv run ruff check . && uv run ruff format --check .

One gotcha: the committed uv.lock resolves SQLAlchemy 2.x, so a plain uv run pytest only exercises one of the two supported majors. Apache Superset pins sqlalchemy<2, so check that combination too before releasing:

uv venv --python 3.10 .sa14
uv pip install --python .sa14 -e . "sqlalchemy<2" pytest
.sa14/bin/python -c "import sqlalchemy; print('SQLALCHEMY', sqlalchemy.__version__)"
.sa14/bin/pytest -q

CI runs both legs on every push.

License

Apache-2.0. See LICENSE.

This repository is a mirror of Thunderduck's internal source; see CONTRIBUTING.md for how issues and pull requests are handled, and SECURITY.md to report a vulnerability.