Experimental
This is highly experimental and will change frequently.
jupyterlite_duckdb_wasm
Python wrapper to run DuckDB_WASM within JupyterLite with a Pyodide Kernel
See notebooks for example of running this within jupyterlite
Cell Magic %%dql
Following the example of magic_duckdb, there's an initial proof of concept for a duckdb for JupyterLite. See Magic Example
You can also test directly on pyodide
import micropip;
await micropip.install('pandas');
await micropip.install('jupylite-duckdb');
import jupylite_duckdb as jd;
conn = await jd.connect();
r1 = await jd.query("pragma version", conn);
r2 = await jd.query("create or replace table xyz as select * from 'https://raw.githubusercontent.com/Teradata/kylo/master/samples/sample-data/parquet/userdata2.parquet'", conn);
r3 = await jd.query("select gender, count(*) as c from xyz group by gender", conn);
print(r1);
print(r2);
print(r3);
Some development notes
- There's some (well known) CORS considerations when trying to load data from other sites. Examples here are all using public sites, there's some limits that to address with your own jupyterlite deployment
- If you're adding local .py files, use importlib.invalidate_caches(). Even then, it was flaky to import.
- Careful with caching... %pip install will pull from browser cache. I had to clear frequently within dev tools
- To clear local storage, which is annoyingly persistent, https://superuser.com/questions/519628/clear-html5-local-storage-on-a-specific-page
Metadata
Release files for jupylite-duckdb 0.0.17
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jupylite_duckdb-0.0.17-py3-none-any.whl | Python 3 | none | any | Details |
Release files / jupylite_duckdb-0.0.17-py3-none-any.whl
| Download URL | jupylite_duckdb-0.0.17-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d7607e054a6c026140eb10007e3228f2a6296472623b9270782cfe004a438e74
|
|
BLAKE2b-256 checksum How to use checksums |
720c1deb7a4e3d41c43cd1b5a8a0131b4e9eec159c63d636c43f37f18c99681e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|