Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

From myBinder to the use of the GitHub pages: from IPython Kernel to Pyodide #118

Open
eliselavy opened this issue May 22, 2023 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@eliselavy
Copy link

eliselavy commented May 22, 2023

Due to the "500 Internal Server Error" of myBinder the last weeks, i look at how to make available the notebooks via GitHub pages with the support of Jupyterlite.

Problem

I notice some problems with the existing notebooks i have:

  • use of request library

Many people load their datas like:
Loading the EDH dataset from the zenodo url

import requests
url = "https://zenodo.org/record/4888168/files/EDH_text_cleaned_2021-01-21.json"  
r = requests.get(url)
json = r.json()
EDH = pd.DataFrame.from_dict(json)

I see i should look at pyodide.http.FetchResponse

  • use of SSL
df = pd.read_csv("https://raw.githubusercontent.com/jdh-observer/jdh001-JJszM3GwAYDs/main/namelesscrowd/cooc-multitudo-tac_hyperbase.csv")
df

URLError: <urlopen error unknown url type: https>

By using the Jupyterlite demo template

../jupyterlite-demo/blob/main/.github/workflows/deploy.yml

    uses: actions/setup-python@v4
        with:
          python-version: '3.10'

https://docs.python.org/3/library/ssl.html

This module does not work or is not available on WebAssembly platforms wasm32-emscripten and wasm32-wasi.

Advices

  • Guidelines to develop notebook for the Pyodide kernel?
  • Do you have already theses feedbacks of migration of existing notebook for Jupyterlite?
  • or should i look at this https://github.com/jupyterlite/repo2jupyterlite to migrate already written notebook?
@jtpio
Copy link
Member

jtpio commented May 23, 2023

Thanks @eliselavy for opening this issue 👍

use of request library

You'll need to use pyodide_http to patch requests: https://jupyterlite.readthedocs.io/en/latest/howto/content/python.html#fetching-remote-content

Although there might be an issue currently: koenvo/pyodide-http#33

use of ssl

Normally it should handle HTTPS fine.

or should i look at this https://github.com/jupyterlite/repo2jupyterlite to migrate already written notebook?

Indeed there is ongoing work to make repo2jupyterlite behave similarly to repo2docker / Binder in terms of functionalities and UX. Some issues that will likely help with this in the short term:

The idea would be to provide a https://lite.binder.org and hopefully remove some load on Binder.

@jtpio
Copy link
Member

jtpio commented May 23, 2023

Do you have already theses feedbacks of migration of existing notebook for Jupyterlite?

Unfortunately it usually depends on a few parameters such as the types of packages, workloads, data size. But for many use cases running Python in the browser will be enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants