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.3.1.tar.gz (941.9 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.3.1-py3-none-win_amd64.whl (15.5 MB view details)

Uploaded Python 3Windows x86-64

ggsql_jupyter-0.3.1-py3-none-manylinux_2_28_x86_64.whl (19.1 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

ggsql_jupyter-0.3.1-py3-none-manylinux_2_28_aarch64.whl (17.0 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

ggsql_jupyter-0.3.1-py3-none-macosx_11_0_arm64.whl (15.1 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

ggsql_jupyter-0.3.1-py3-none-macosx_10_12_x86_64.whl (17.4 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: ggsql_jupyter-0.3.1.tar.gz
  • Upload date:
  • Size: 941.9 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.3.1.tar.gz
Algorithm Hash digest
SHA256 d4f3d36246bd94fbee4c24b895139732f9c3c7a9ff0e2c92d00ae122f626db19
MD5 62a11539e48edf941aef43ae51e2a00f
BLAKE2b-256 9f2979a8ec08972b1a4ed5f5ed4a1c121ec606207c529043208523c3580887dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for ggsql_jupyter-0.3.1.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.3.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: ggsql_jupyter-0.3.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 15.5 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.3.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 367137d95c10f51bdee0d4ad3ebb283bfe5f9a089eb4ffeecd95cc92da7bae51
MD5 0563e821e7a77696c91fd3f3cbfab384
BLAKE2b-256 d9fa35751453095208c39188d8173914e4730b92cef75264318b411c26778e9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ggsql_jupyter-0.3.1-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.3.1-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ggsql_jupyter-0.3.1-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9d89dfbca9f37761b4e5d8ee80bff5c5bdfc63054ca68eec8d01af363aacd3d0
MD5 71364a7b9ab64e92a2bd9ad58875fe1d
BLAKE2b-256 c60e5cd2157292dcb6c8e3685d12cc6b97ebb89189dd8990abd893a00f9863da

See more details on using hashes here.

Provenance

The following attestation bundles were made for ggsql_jupyter-0.3.1-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.3.1-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for ggsql_jupyter-0.3.1-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 59ae0b14626a53e615baefeced0a3e6f962a32a220aabca3012c24ccea6aebc3
MD5 3df05b0f0667c3c6bbf569653fe2fa29
BLAKE2b-256 da10e6eb16916d9323866be32887008a04a75d88c9b35e54bd1fc574a4945b38

See more details on using hashes here.

Provenance

The following attestation bundles were made for ggsql_jupyter-0.3.1-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.3.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ggsql_jupyter-0.3.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cedd6d7197a846c9121d36e79dd35345d081aa3d8a13824c0419de47f72f3464
MD5 e83faaef69bf3aaa587f2f936e070799
BLAKE2b-256 a44fcd2a32cf8ca72fbee1ffbd754ddd4487f3ab137cfd1d969f130797b10757

See more details on using hashes here.

Provenance

The following attestation bundles were made for ggsql_jupyter-0.3.1-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.3.1-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ggsql_jupyter-0.3.1-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 63c37a4dd81cb109c1a3b607d308dfbbe28c43472dac12b282af25ea1668474d
MD5 437c05a62dcdfc682c1bce142490ec3b
BLAKE2b-256 917d588f45ae531167ed49af5912ae61be14bbe5dfc793af45e7cf84a321b60f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ggsql_jupyter-0.3.1-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