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
=andINconditions; server-sideORDER BYandLIMIT - 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
shillelaghCLI, 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file shillelagh_gristapi-0.2.0.tar.gz.
File metadata
- Download URL: shillelagh_gristapi-0.2.0.tar.gz
- Upload date:
- Size: 24.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4b61190952d052fce5bd42e681a21219a5f65e33bcc9d5f6f8d13375fdebaf8
|
|
| MD5 |
6f6dbb7aace1a4091924f3c3d516567a
|
|
| BLAKE2b-256 |
c9dc2edda3dff9815443d9c478a117f4898265a5d16250ba3128dc671861ed35
|
Provenance
The following attestation bundles were made for shillelagh_gristapi-0.2.0.tar.gz:
Publisher:
pypi.yml on qleroy/shillelagh-gristapi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shillelagh_gristapi-0.2.0.tar.gz -
Subject digest:
a4b61190952d052fce5bd42e681a21219a5f65e33bcc9d5f6f8d13375fdebaf8 - Sigstore transparency entry: 1560656062
- Sigstore integration time:
-
Permalink:
qleroy/shillelagh-gristapi@4a9064df72e846d4beac73108596a06ed864a6b5 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/qleroy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@4a9064df72e846d4beac73108596a06ed864a6b5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file shillelagh_gristapi-0.2.0-py3-none-any.whl.
File metadata
- Download URL: shillelagh_gristapi-0.2.0-py3-none-any.whl
- Upload date:
- Size: 19.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e0e0108dc12487c42bc6fb78cc3e0cd72f40852a0d9758744c01fdda7cc37b1
|
|
| MD5 |
b40204781c6d4d5a0b9b3f694824bb38
|
|
| BLAKE2b-256 |
c8088793a8aa0941346d127f7fcf367a9ff21225b262726c2500142bddd095bb
|
Provenance
The following attestation bundles were made for shillelagh_gristapi-0.2.0-py3-none-any.whl:
Publisher:
pypi.yml on qleroy/shillelagh-gristapi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shillelagh_gristapi-0.2.0-py3-none-any.whl -
Subject digest:
0e0e0108dc12487c42bc6fb78cc3e0cd72f40852a0d9758744c01fdda7cc37b1 - Sigstore transparency entry: 1560656262
- Sigstore integration time:
-
Permalink:
qleroy/shillelagh-gristapi@4a9064df72e846d4beac73108596a06ed864a6b5 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/qleroy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@4a9064df72e846d4beac73108596a06ed864a6b5 -
Trigger Event:
push
-
Statement type: