Re: PyScript + VSCode (+Jupyter), EmscriptenForge, MambaLite, BinderLite (repo2jupyterlite), Datasette, ipycanvas + sphinx-jupyterlite
Wes Turner <[email protected]> Mon, 5 Sep 2022 20:34:22 -0400
| Newsgroups | gmane.comp.python.education |
|---|---|
| Message-ID | <CACfEFw8L0Wps88rJxoFOVJ5Nj5tdtDHai4GFHJUbkOWutvDa3w@mail.gmail.com> |
--===============2577917733031548855== Content-Type: multipart/alternative; boundary="0000000000003e9b9c05e7f75c3b" --0000000000003e9b9c05e7f75c3b Content-Type: text/plain; charset="UTF-8" executablebooks/jupyter-book > Launch in JupyterLite https://github.com/executablebooks/jupyter-book/issues/1661 JupyterLite/jupyterlite-sohinx > Editable cell? https://github.com/jupyterlite/jupyterlite-sphinx/issues/63 Voila + JupyterLite; WASM Jupyter Dashboards with remote data sources: https://github.com/jupyterlite/jupyterlite/issues/773 from https://news.ycombinator.com/item?id=31824578 https://westurner.github.io/hnlog/#comment-31824578 : > sqlite-parquet-vtable reads parquet with arrow for SQLite virtual tables https://github.com/cldellow/sqlite-parquet-vtable On Mon, Sep 5, 2022, 8:07 PM Wes Turner <[email protected]> wrote: > "Support for PyScript & Brython" > https://github.com/microsoft/vscode-python/issues/19415 > > - > https://marketplace.visualstudio.com/items?itemName=HardeepSingh.pyscript > > Jupyter support in VSCode: > - https://code.visualstudio.com/docs/datascience/jupyter-notebooks > > JupyterLite has p5 js support. Khan Academy CS curriculum has > ProcessingJS, which is basically p5 js. > What similar functionality exists in the python standard library? Does the > stdlib turtle module work in pyodide WASM (JupyterLite, PyScript,)? > > *** > Like matplotlib, but with vega-lite, > Altair charts are saveable to PNG, SVG for print/latexpdf. > https://altair-viz.github.io/user_guide/saving_charts.html > > Annotated matplotlib: > https://twitter.com/__mharrison__/status/1562454754306826241 > > JupyterLite: https://jupyterlite.readthedocs.io/en/latest/ : > > > Python kernel backed by Pyodide running in a Web Worker > > > > - Initial support for interactive visualization libraries such as > altair, bqplot, ipywidgets, matplotlib, and plotly > > FWIU ipycanvas also works in JupyerLite: > Drawing paths > Path commands: > https://ipycanvas.readthedocs.io/en/latest/drawing_paths.html#path-commands > > Src: > https://github.com/martinRenou/ipycanvas/blob/master/ipycanvas/canvas.py > > > *** > > The ipycanvas docs include JupyterLite w/ > https://github.com/jupyterlite/jupyterlite-sphinx : > > > JupyterLite Sphinx: A Sphinx extension that provides utilities for > embedding JupyterLite in your documentation > > > *** > > Datasette does static SQLite in WASM; now with JupyterLite as well: > https://datasette.io/plugins/datasette-jupyterlite > > There are *-to-sqlite > utilities for all of the things; though pd.read_csv() can read from a > remote URL in WASM, potentially unreproducibly (next semester it 404s) and > without a requests_cache, just like in normal JupyterLab e.g. from > repo2docker: https://pypi.org/search/?q=to+sqlite > https://pypi.org/search/?q=datasette > > *** > > > TIL about #EmscriptenForge, #MambaLite, #BinderLite (#repo2jupyterlite), > https://github.com/emscripten-forge/recipes > > > Tools to pack a conda / mamba environment into a JS & WASM bundle > https://github.com/emscripten-forge/empack > > > > ```bash > empack pack env --env-prefix /path/to/env --outname python_data --config > /path/to/config.yaml > ``` > > > > This will generate two files python_data.js and python_data.data that > you can use in the browser. A sample config is located in > tests/empack_test_config.yaml > > > https://github.com/emscripten-forge/requests-wasm-polyfill : > > Drop-in replacement for the requests library for wasm python > > Note that these only work when running under a web-worker, as it's > making blocking HTTP requests which are not allowed in the main thread. > > "Polyfills"; just like JS > > On Mon, Sep 5, 2022, 2:42 PM kirby urner <[email protected]> wrote: > >> >> https://youtu.be/obZqST6mBn8 (2 mins 41 secs) >> >> My first video on PyScript. >> >> Alludes to other topics in my Python for High School stuff. >> >> https://github.com/4dsolutions/elite_school/blob/master/PY4HS.ipynb >> >> Kirby >> >> _______________________________________________ >> Edu-sig mailing list -- [email protected] >> To unsubscribe send an email to [email protected] >> https://mail.python.org/mailman3/lists/edu-sig.python.org/ >> Member address: [email protected] >> > --0000000000003e9b9c05e7f75c3b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"auto"><div dir=3D"auto">executablebooks/jupyter-book > Launc= h in JupyterLite</div><a href=3D"https://github.com/executablebooks/jupyter= -book/issues/1661">https://github.com/executablebooks/jupyter-book/issues/1= 661</a><div dir=3D"auto"><br></div><div dir=3D"auto">JupyterLite/jupyterlit= e-sohinx > Editable cell?</div><div dir=3D"auto"><a href=3D"https://gith= ub.com/jupyterlite/jupyterlite-sphinx/issues/63">https://github.com/jupyter= lite/jupyterlite-sphinx/issues/63</a></div><div dir=3D"auto"><br></div><div= dir=3D"auto">Voila + JupyterLite; WASM Jupyter Dashboards with remote data= sources:=C2=A0</div><div dir=3D"auto"><a href=3D"https://github.com/jupyte= rlite/jupyterlite/issues/773">https://github.com/jupyterlite/jupyterlite/is= sues/773</a></div><div dir=3D"auto"><br></div><div dir=3D"auto"><br></div><= div dir=3D"auto">from <a href=3D"https://news.ycombinator.com/item?id=3D318= 24578">https://news.ycombinator.com/item?id=3D31824578</a> <a href=3D"https= ://westurner.github.io/hnlog/#comment-31824578">https://westurner.github.io= /hnlog/#comment-31824578</a> :</div><div dir=3D"auto"><br></div><div dir=3D= "auto">> sqlite-parquet-vtable reads parquet with arrow for SQLite virtu= al tables <a href=3D"https://github.com/cldellow/sqlite-parquet-vtable">htt= ps://github.com/cldellow/sqlite-parquet-vtable</a>=C2=A0</div></div><br><di= v class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Mon, Sep 5= , 2022, 8:07 PM Wes Turner <<a href=3D"mailto:[email protected]">wes.= [email protected]</a>> wrote:<br></div><blockquote class=3D"gmail_quote" = style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><di= v dir=3D"auto">"Support for PyScript & Brython" <a href=3D"ht= tps://github.com/microsoft/vscode-python/issues/19415" target=3D"_blank" re= l=3D"noreferrer">https://github.com/microsoft/vscode-python/issues/19415</a= ><div dir=3D"auto"><br></div><div dir=3D"auto">- <a href=3D"https://marketp= lace.visualstudio.com/items?itemName=3DHardeepSingh.pyscript" target=3D"_bl= ank" rel=3D"noreferrer">https://marketplace.visualstudio.com/items?itemName= =3DHardeepSingh.pyscript</a></div><div dir=3D"auto"><br></div><div dir=3D"a= uto">Jupyter support in VSCode:</div><div dir=3D"auto">- <a href=3D"https:/= /code.visualstudio.com/docs/datascience/jupyter-notebooks" target=3D"_blank= " rel=3D"noreferrer">https://code.visualstudio.com/docs/datascience/jupyter= -notebooks</a></div><div dir=3D"auto"><br></div><div dir=3D"auto">JupyterLi= te has p5 js support. Khan Academy CS curriculum has ProcessingJS, which is= basically p5 js.</div><div dir=3D"auto">What similar functionality exists = in the python standard library? Does the stdlib turtle module work in pyodi= de WASM (JupyterLite, PyScript,)?</div><div dir=3D"auto"><br></div><div dir= =3D"auto">***</div><div dir=3D"auto">Like matplotlib, but with vega-lite,</= div><div dir=3D"auto">Altair charts are saveable to PNG, SVG for print/late= xpdf. <a href=3D"https://altair-viz.github.io/user_guide/saving_charts.html= " target=3D"_blank" rel=3D"noreferrer">https://altair-viz.github.io/user_gu= ide/saving_charts.html</a></div><div dir=3D"auto"><br></div><div dir=3D"aut= o">Annotated matplotlib:=C2=A0 <a href=3D"https://twitter.com/__mharrison__= /status/1562454754306826241" target=3D"_blank" rel=3D"noreferrer">https://t= witter.com/__mharrison__/status/1562454754306826241</a></div><div dir=3D"au= to"><br></div><div dir=3D"auto">JupyterLite: <a href=3D"https://jupyterlite= .readthedocs.io/en/latest/" target=3D"_blank" rel=3D"noreferrer">https://ju= pyterlite.readthedocs.io/en/latest/</a> :</div><div dir=3D"auto"><br></div>= <div dir=3D"auto">> Python kernel backed by Pyodide running in a Web Wor= ker</div><div dir=3D"auto">></div><div dir=3D"auto">> - Initial suppo= rt for interactive visualization libraries such as altair, bqplot, ipywidge= ts, matplotlib, and plotly</div><div dir=3D"auto"><br></div><div dir=3D"aut= o">FWIU ipycanvas also works in JupyerLite:</div><div dir=3D"auto">Drawing = paths > Path commands: <a href=3D"https://ipycanvas.readthedocs.io/en/la= test/drawing_paths.html#path-commands" target=3D"_blank" rel=3D"noreferrer"= >https://ipycanvas.readthedocs.io/en/latest/drawing_paths.html#path-command= s</a></div><div dir=3D"auto"><br></div><div dir=3D"auto">Src: <a href=3D"ht= tps://github.com/martinRenou/ipycanvas/blob/master/ipycanvas/canvas.py" tar= get=3D"_blank" rel=3D"noreferrer">https://github.com/martinRenou/ipycanvas/= blob/master/ipycanvas/canvas.py</a></div><div dir=3D"auto"><br></div><div d= ir=3D"auto"><br></div><div dir=3D"auto">***</div><div dir=3D"auto"><br></di= v><div dir=3D"auto">The ipycanvas docs include JupyterLite w/=C2=A0 <a href= =3D"https://github.com/jupyterlite/jupyterlite-sphinx" target=3D"_blank" re= l=3D"noreferrer">https://github.com/jupyterlite/jupyterlite-sphinx</a> :</d= iv><div dir=3D"auto"><br></div><div dir=3D"auto">> JupyterLite Sphinx: A= Sphinx extension that provides utilities for embedding JupyterLite in your= documentation</div><div dir=3D"auto"><br></div><div dir=3D"auto"><br></div= ><div dir=3D"auto">***</div><div dir=3D"auto"><br></div><div dir=3D"auto">D= atasette does static SQLite in WASM; now with JupyterLite as well:=C2=A0</d= iv><div dir=3D"auto"><a href=3D"https://datasette.io/plugins/datasette-jupy= terlite" target=3D"_blank" rel=3D"noreferrer">https://datasette.io/plugins/= datasette-jupyterlite</a></div><div dir=3D"auto"><br></div><div dir=3D"auto= ">There are *-to-sqlite=C2=A0</div><div dir=3D"auto">utilities for all of t= he things; though pd.read_csv() can read from a remote URL in WASM, potenti= ally unreproducibly (next semester it 404s) and without a requests_cache, j= ust like in normal JupyterLab e.g. from repo2docker: <a href=3D"https://pyp= i.org/search/?q=3Dto+sqlite" target=3D"_blank" rel=3D"noreferrer">https://p= ypi.org/search/?q=3Dto+sqlite</a>=C2=A0 <a href=3D"https://pypi.org/search/= ?q=3Ddatasette" target=3D"_blank" rel=3D"noreferrer">https://pypi.org/searc= h/?q=3Ddatasette</a></div><div dir=3D"auto"><br></div><div dir=3D"auto">***= </div><div dir=3D"auto"><br></div><div dir=3D"auto">> TIL about #Emscrip= tenForge, #MambaLite, #BinderLite (#repo2jupyterlite),</div><div dir=3D"aut= o"><a href=3D"https://github.com/emscripten-forge/recipes" target=3D"_blank= " rel=3D"noreferrer">https://github.com/emscripten-forge/recipes</a></div><= div dir=3D"auto"><br></div><div dir=3D"auto">> Tools to pack a conda / m= amba environment into a JS & WASM bundle</div><div dir=3D"auto"><a href= =3D"https://github.com/emscripten-forge/empack" target=3D"_blank" rel=3D"no= referrer">https://github.com/emscripten-forge/empack</a>=C2=A0</div><div di= r=3D"auto">></div><div dir=3D"auto">> ```bash</div><div dir=3D"auto">= empack pack env --env-prefix /path/to/env --outname python_data --config /= path/to/config.yaml</div><div dir=3D"auto">```</div><div dir=3D"auto">><= /div><div dir=3D"auto">> This will generate two files python_data.js and= python_data.data that you can use in the browser. A sample config is locat= ed in tests/empack_test_config.yaml</div><div dir=3D"auto"><br></div><div d= ir=3D"auto"><br></div><div dir=3D"auto"><a href=3D"https://github.com/emscr= ipten-forge/requests-wasm-polyfill" target=3D"_blank" rel=3D"noreferrer">ht= tps://github.com/emscripten-forge/requests-wasm-polyfill</a> :</div><div di= r=3D"auto">> Drop-in replacement for the requests library for wasm pytho= n</div><div dir=3D"auto">> Note that these only work when running under = a web-worker, as it's making blocking HTTP requests which are not allow= ed in the main thread.</div><div dir=3D"auto"><br></div><div dir=3D"auto">&= quot;Polyfills"; just like JS</div></div><br><div class=3D"gmail_quote= "><div dir=3D"ltr" class=3D"gmail_attr">On Mon, Sep 5, 2022, 2:42 PM kirby = urner <<a href=3D"mailto:[email protected]" target=3D"_blank" rel=3D= "noreferrer">[email protected]</a>> wrote:<br></div><blockquote clas= s=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pad= ding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-= family:arial,helvetica,sans-serif;font-size:small"><br></div><div class=3D"= gmail_default" style=3D"font-family:arial,helvetica,sans-serif;font-size:sm= all"><a href=3D"https://youtu.be/obZqST6mBn8" rel=3D"noreferrer noreferrer"= target=3D"_blank">https://youtu.be/obZqST6mBn8</a>=C2=A0 (2 mins 41 secs)<= br></div><div class=3D"gmail_default" style=3D"font-family:arial,helvetica,= sans-serif;font-size:small"><br></div><div class=3D"gmail_default" style=3D= "font-family:arial,helvetica,sans-serif;font-size:small">My first video on = PyScript.=C2=A0 <br></div><div class=3D"gmail_default" style=3D"font-family= :arial,helvetica,sans-serif;font-size:small"><br></div><div class=3D"gmail_= default" style=3D"font-family:arial,helvetica,sans-serif;font-size:small">A= lludes to other topics in my Python for High School stuff.<br></div><div cl= ass=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif;font-= size:small"><br></div><div class=3D"gmail_default" style=3D"font-family:ari= al,helvetica,sans-serif;font-size:small"><a href=3D"https://github.com/4dso= lutions/elite_school/blob/master/PY4HS.ipynb" rel=3D"noreferrer noreferrer"= target=3D"_blank">https://github.com/4dsolutions/elite_school/blob/master/= PY4HS.ipynb</a></div><div class=3D"gmail_default" style=3D"font-family:aria= l,helvetica,sans-serif;font-size:small"><br></div><div class=3D"gmail_defau= lt" style=3D"font-family:arial,helvetica,sans-serif;font-size:small">Kirby<= /div><div class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans= -serif;font-size:small"><br></div></div> _______________________________________________<br> Edu-sig mailing list -- <a href=3D"mailto:[email protected]" rel=3D"norefe= rrer noreferrer" target=3D"_blank">[email protected]</a><br> To unsubscribe send an email to <a href=3D"mailto:[email protected]"= rel=3D"noreferrer noreferrer" target=3D"_blank">[email protected]</= a><br> <a href=3D"https://mail.python.org/mailman3/lists/edu-sig.python.org/" rel= =3D"noreferrer noreferrer noreferrer" target=3D"_blank">https://mail.python= .org/mailman3/lists/edu-sig.python.org/</a><br> Member address: <a href=3D"mailto:[email protected]" rel=3D"noreferrer n= oreferrer" target=3D"_blank">[email protected]</a><br> </blockquote></div> </blockquote></div> --0000000000003e9b9c05e7f75c3b-- --===============2577917733031548855== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Edu-sig mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/edu-sig.python.org/ Member address: [email protected] --===============2577917733031548855==--