Skip to main content

Shillelagh adapter to query Grist documents and tables via SQL.

Project description

shillelagh-gristapi

A Shillelagh adapter that exposes the Grist REST API as SQL-queryable virtual tables via SQLite/SQLAlchemy.

Features

  • Query Grist documents, tables, and records with SQL
  • Filter pushdown for = and IN conditions; server-side ORDER BY and LIMIT
  • Discovery queries: list organizations, workspaces, documents, and tables via grist:// URIs
  • Column metadata introspection via grist://<doc_id>/<table_id>/__columns__
  • Built-in TTL caching (SQLite or in-memory) to reduce API calls
  • Enforces Grist access rules — your API key permissions apply automatically
  • Works with Apache Superset, the shillelagh CLI, and any SQLAlchemy-compatible tool

Installation

pip install shillelagh-gristapi

For the interactive CLI:

pip install 'shillelagh[console]'

For source installation, see docs/getting-started.md.

Quickstart

from shillelagh.backends.apsw.db import connect
import os

conn = connect(
    ":memory:",
    adapter_kwargs={"gristapi": {"grist_cfg": {
        "server": os.environ["GRIST_SERVER"],
        "org_id": int(os.environ["GRIST_ORG_ID"]),
        "api_key": os.environ["GRIST_API_KEY"],
    }}},
)
cursor = conn.cursor()
rows = cursor.execute('SELECT * FROM "grist://<DOC_ID>/<TABLE_ID>" LIMIT 10').fetchall()

Documentation

Document Description
docs/getting-started.md Prerequisites, install, step-by-step first queries
docs/uri-reference.md All grist:// URI patterns and their column schemas
docs/configuration.md CLI, Python, and Superset configuration reference
docs/type-mapping.md Grist column types to SQL/Shillelagh field mapping
docs/superset.md Apache Superset integration guide
docs/limitations.md Known restrictions and performance notes

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shillelagh_gristapi-0.2.1.tar.gz (25.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shillelagh_gristapi-0.2.1-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file shillelagh_gristapi-0.2.1.tar.gz.

File metadata

  • Download URL: shillelagh_gristapi-0.2.1.tar.gz
  • Upload date:
  • Size: 25.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for shillelagh_gristapi-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e813511009ab177ced9705bc42dbabe00b38d1eca95b68ef99e5ee7418cdc5ad
MD5 94e4dc012118362fc15b8ecb2bcce5f1
BLAKE2b-256 ce1d3ad3df85995427e4c2751b1596396594dadece2211165719f63d2196624d

See more details on using hashes here.

Provenance

The following attestation bundles were made for shillelagh_gristapi-0.2.1.tar.gz:

Publisher: pypi.yml on qleroy/shillelagh-gristapi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shillelagh_gristapi-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for shillelagh_gristapi-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 91b2771e26fd71894017305424155e0bf3051071fdd3861b42bc7fdbe0e2a8f1
MD5 1e9dc5f69bc528fd4fa677cca2ee3592
BLAKE2b-256 d0b7b568977d2955b71f4d5927f370fc1f753f1399f4db2ac04dde4cfe4bacbb

See more details on using hashes here.

Provenance

The following attestation bundles were made for shillelagh_gristapi-0.2.1-py3-none-any.whl:

Publisher: pypi.yml on qleroy/shillelagh-gristapi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page