-
Notifications
You must be signed in to change notification settings - Fork 603
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(tutorial): deploy a jupyterlite repl on the website (#9009)
- Loading branch information
Showing
14 changed files
with
951 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
::: {.callout-warning collapse="true"} | ||
## Ibis in the browser is experimental. | ||
|
||
iOS is known to cause crashes on this page. | ||
|
||
Mobile Firefox may also not work (the page won't crash though). | ||
|
||
Please [open an issue on GitHub](https://github.com/ibis-project/ibis/issues/new/choose) if you encounter problems. | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[ | ||
{ | ||
"origin": ["*"], | ||
"method": ["GET"], | ||
"responseHeader": ["Content-Type"], | ||
"maxAgeSeconds": 3600 | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"PipliteAddon": { | ||
"piplite_urls": [ | ||
"https://duckdb.github.io/duckdb-pyodide/wheels/duckdb-0.10.2-cp311-cp311-emscripten_3_1_46_wasm32.whl", | ||
"dist/ibis_framework-8.0.0-py3-none-any.whl" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
title: JupyterLite console | ||
format: | ||
html: | ||
page-layout: full | ||
--- | ||
|
||
Try our experimental JupyterLite console with Ibis, using the Palmer | ||
penguins[^1] dataset loaded into the DuckDB backend! | ||
|
||
{{< include ../../_tabsets/repl_warning.qmd >}} | ||
|
||
```{python} | ||
#| echo: false | ||
#| output: asis | ||
from urllib.parse import urlencode | ||
lines = """ | ||
%pip install numpy pandas tzdata | ||
import pyodide_js, pathlib, js | ||
await pyodide_js.loadPackage("https://storage.googleapis.com/ibis-wasm-wheels/pyarrow-16.0.0.dev2661%2Bg9bddb87fd-cp311-cp311-emscripten_3_1_46_wasm32.whl") | ||
pathlib.Path("penguins.csv").write_text(await (await js.fetch("https://storage.googleapis.com/ibis-tutorial-data/penguins.csv")).text()) | ||
del pyodide_js, pathlib, js | ||
%clear | ||
%pip install 'ibis-framework[duckdb]' | ||
from ibis.interactive import * | ||
penguins = ibis.read_csv("penguins.csv") | ||
penguins | ||
""" | ||
params = [ | ||
("toolbar", "1"), | ||
("theme", "JupyterLab Night"), | ||
("kernel", "python"), | ||
] | ||
params.extend(("code", line) for line in lines.splitlines() if line) | ||
query = urlencode(params) | ||
jupyterlite = f"../../jupyterlite/repl/?{query}" | ||
iframe = f'<iframe src="{jupyterlite}" id="jupyterlite-console"></iframe>' | ||
print(iframe) | ||
``` | ||
|
||
[^1]: Horst AM, Hill AP, Gorman KB (2020). palmerpenguins: Palmer Archipelago (Antarctica) penguin data. R package version 0.1.0. <https://allisonhorst.github.io/palmerpenguins/>. doi: 10.5281/zenodo.3960218. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.