Skip to content

grobgl/duckdb-sql-ipython-ext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

DuckDB SQL IPython Extension

Loads JupySQL extension with DuckDB setup (incl. GCS auth).

Setup

Use in a notebook as follows:

  1. Install via pip if not yet installed:

    pip install git+https://github.com/grobgl/duckdb-sql-ipython-ext
    
  2. (optional) Prepare GCS credentials:

    1. Create HMAC keys and store them as GCS_KEY_ID and GCS_SECRET environment variables.
    2. If using a .env file, these may have to be loaded into a notebook using python-dotenv:
      %load_ext dotenv
      %dotenv /home/serenitydev/.env
      
  3. Load extension:

    %load_ext duckdb_sql
    

Usage

See JupySQL.

%sql select * from 'gs://example-bucket/**/*-example.parquet' limit 10;

Multi line:

%%sql
select *
from 'gs://example-bucket/**/*-example.parquet'
limit 10

Store result to variable:

%%sql example_df <<
select * from 'gs://example-bucket/**/*-example.parquet' limit 10;

About

DuckDB SQL IPython Extension

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages