Skip to main content

Jupyter kernel for ggsql - SQL extension for declarative data visualization

Project description

ggsql Jupyter Kernel

A Jupyter kernel for executing ggsql queries with rich inline Vega-Lite visualizations.

Overview

The ggsql Jupyter kernel enables you to run ggsql queries directly in Jupyter notebooks, with automatic rendering of visualizations using Vega-Lite. It maintains a persistent DuckDB session across cells, allowing you to build up datasets and create visualizations interactively.

Features

  • Execute ggsql queries in Jupyter notebooks
  • Rich visualizations with Vega-Lite rendered inline
  • Persistent DuckDB session across cells
  • Pure SQL support with HTML table output
  • Grammar of Graphics syntax for declarative visualization

Installation

Prerequisites

  • Jupyter Lab or Notebook installed

Option 1: Install from PyPI (Recommended)

The easiest way to install the ggsql kernel is from PyPI. This provides pre-built binaries for Linux, macOS, and Windows.

Using pip:

pip install ggsql-jupyter
ggsql-jupyter --install

Using uv:

uv tool install ggsql-jupyter
ggsql-jupyter --install

The --install flag registers the kernel with Jupyter. It automatically detects and respects your current environment (virtualenv, conda, uv, etc.).

Option 2: Install from crates.io

Requires a Rust toolchain:

cargo install ggsql-jupyter
ggsql-jupyter --install

Option 3: Download Pre-built Binary

Pre-built binaries are available from GitHub Releases:

Platform Binary
Linux (x86_64) ggsql-jupyter-linux-x64
Linux (ARM64) ggsql-jupyter-linux-arm64
macOS (Intel) ggsql-jupyter-macos-x64
macOS (Apple Silicon) ggsql-jupyter-macos-arm64
Windows (x64) ggsql-jupyter-windows-x64.exe

After downloading, make it executable and install:

chmod +x ggsql-jupyter-*
./ggsql-jupyter-linux-x64 --install

On Windows (PowerShell):

.\ggsql-jupyter-windows-x64.exe --install

Option 4: Build from Source

Requires a Rust toolchain. From the workspace root:

cargo build --release --package ggsql-jupyter
./target/release/ggsql-jupyter --install

Installation Flags

  • --install: Install the kernel (default: user install)
  • --install --user: Explicitly install for current user
  • --install --sys-prefix: Install into sys.prefix (for conda envs)

Verify Installation

jupyter kernelspec list

You should see ggsql in the list of available kernels.

Usage

Start Jupyter

jupyter lab
# or
jupyter notebook

Create a ggsql Notebook

  1. In Jupyter, click "New" and select "ggsql" from the dropdown
  2. Start writing ggsql queries!

Example Queries

Simple Point Plot

SELECT 1 as x, 2 as y, 'A' as category
UNION ALL
SELECT 2, 4, 'A'
UNION ALL
SELECT 3, 3, 'B'

VISUALISE x, y, category AS color
DRAW point

Time Series

SELECT
    '2024-01-01'::DATE + INTERVAL (n) DAY as date,
    n * 10 as revenue
FROM generate_series(0, 30) as t(n)

VISUALISE date AS x, revenue AS y
DRAW line
SCALE x
  SETTING type => 'date'
LABEL title => 'Revenue Growth', x => 'Date', y => 'Revenue ($)'

Multi-Layer Plot with Global Mapping

SELECT x, x*x as y, x*x*x as z
FROM generate_series(1, 10) as t(x)

VISUALISE x AS x
DRAW line
  MAPPING y AS y
DRAW line
  MAPPING z AS y
LABEL title => 'Polynomial Functions'

Pure SQL (Data Tables)

SELECT * FROM (VALUES (1, 'a'), (2, 'b'), (3, 'c')) AS t(id, name)

This will display as an HTML table without visualization.

Building Up Data Across Cells

Cell 1:

CREATE TABLE products AS
SELECT * FROM (VALUES
  (1, 'Widget', 10.99),
  (2, 'Gadget', 24.99),
  (3, 'Doohickey', 5.99)
) AS t(id, name, price)

Cell 2:

SELECT * FROM products
VISUALISE name AS x, price AS y
DRAW bar
LABEL title => 'Product Prices', y => 'Price ($)'

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

ggsql_jupyter-0.2.6.tar.gz (900.8 kB view details)

Uploaded Source

Built Distributions

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

ggsql_jupyter-0.2.6-py3-none-win_amd64.whl (35.7 MB view details)

Uploaded Python 3Windows x86-64

ggsql_jupyter-0.2.6-py3-none-manylinux_2_28_x86_64.whl (43.4 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

ggsql_jupyter-0.2.6-py3-none-manylinux_2_28_aarch64.whl (42.6 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

ggsql_jupyter-0.2.6-py3-none-macosx_11_0_arm64.whl (38.2 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

ggsql_jupyter-0.2.6-py3-none-macosx_10_12_x86_64.whl (41.9 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file ggsql_jupyter-0.2.6.tar.gz.

File metadata

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

File hashes

Hashes for ggsql_jupyter-0.2.6.tar.gz
Algorithm Hash digest
SHA256 180591cb45587772d20c65a18fb92d62a78e5ff9b4f5bd396096463c096426df
MD5 e9e62197a806ee257e3751b140688027
BLAKE2b-256 49ce3dbb8589c9576c94c8b49bf4196fc17133363949bdaf2a387458b0370fbd

See more details on using hashes here.

Provenance

The following attestation bundles were made for ggsql_jupyter-0.2.6.tar.gz:

Publisher: release-jupyter.yml on posit-dev/ggsql

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

File details

Details for the file ggsql_jupyter-0.2.6-py3-none-win_amd64.whl.

File metadata

  • Download URL: ggsql_jupyter-0.2.6-py3-none-win_amd64.whl
  • Upload date:
  • Size: 35.7 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ggsql_jupyter-0.2.6-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 4276f71f1bc6637307bedf9b751d0272c82132917583c5971349446de2657187
MD5 cdf4510c4425334cba805dde701efcaf
BLAKE2b-256 83d4d5135b15675f5382abe042ddad0d4bc61d4debc2fa9a43e38ab079f65e30

See more details on using hashes here.

Provenance

The following attestation bundles were made for ggsql_jupyter-0.2.6-py3-none-win_amd64.whl:

Publisher: release-jupyter.yml on posit-dev/ggsql

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

File details

Details for the file ggsql_jupyter-0.2.6-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ggsql_jupyter-0.2.6-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8a08e56338eb1da06bb7d322d5b7dc867ff6b5d12784daa0fc10f6772b2a78a4
MD5 50a04fdbea81964169a9512c62e4fa9e
BLAKE2b-256 976ce10bbbac738ade0e617fee47041a9362da9e7dddbaa0804b9e9b94915e50

See more details on using hashes here.

Provenance

The following attestation bundles were made for ggsql_jupyter-0.2.6-py3-none-manylinux_2_28_x86_64.whl:

Publisher: release-jupyter.yml on posit-dev/ggsql

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

File details

Details for the file ggsql_jupyter-0.2.6-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for ggsql_jupyter-0.2.6-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9f34a53d8a23e8847c441d242efa52de8d41916872cefb80ba5a9c8693c29722
MD5 9b8c1d6cea4d29588452b2e3d3e428f5
BLAKE2b-256 df8009c7b74c00126d0761f7c89f4c777fb85bc35201c9370d49f415089c8ce2

See more details on using hashes here.

Provenance

The following attestation bundles were made for ggsql_jupyter-0.2.6-py3-none-manylinux_2_28_aarch64.whl:

Publisher: release-jupyter.yml on posit-dev/ggsql

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

File details

Details for the file ggsql_jupyter-0.2.6-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ggsql_jupyter-0.2.6-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b3e3147e69824af0b4cd1e627e0a6e04d57dd7ccab0b80b29c1539cad368296e
MD5 a57dce9c3b3c1ed57ae4684dd2173a3d
BLAKE2b-256 47ac05682572679b77ac3373affd840d23f2283bd1b7c34826d704ff83ef9326

See more details on using hashes here.

Provenance

The following attestation bundles were made for ggsql_jupyter-0.2.6-py3-none-macosx_11_0_arm64.whl:

Publisher: release-jupyter.yml on posit-dev/ggsql

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

File details

Details for the file ggsql_jupyter-0.2.6-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ggsql_jupyter-0.2.6-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 91afbb06f7d4db9e92a6576ba2b6d87286b545b4b3db22deb419d8bcb837180f
MD5 b2869eb8fbcd74e87f827a99e6845d68
BLAKE2b-256 58da0f489922fdecb73be20f80d260a5ac062b689ce19760c137e4fe4f83449e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ggsql_jupyter-0.2.6-py3-none-macosx_10_12_x86_64.whl:

Publisher: release-jupyter.yml on posit-dev/ggsql

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