JupyterLite 作为 Datasette 插件
将此插件安装在与 Datasette 相同的环境中。
$ datasette install datasette-jupyterlite
您可以在此处尝试该插件的演示: https://latest-with-plugins.datasette.io/jupyterlite/
在 Pyolite notebook 中运行此示例代码,将 github/stars 表中的所有数据拉取到 Pandas DataFrame 中
import pandas, pyodide
df = pandas.read_csv(pyodide.open_url(
"https://latest-with-plugins.datasette.io/github/stars.csv?_labels=on&_stream=on&_size=max")
)
安装后,访问 /jupyterlite/
即可访问由您的 Datasette 实例提供的 JupyterLite。
要在本地设置此插件,首先检出代码。然后创建一个新的虚拟环境
cd datasette-jupyterlite
python3 -mvenv venv
source venv/bin/activate
或者如果您正在使用 pipenv
pipenv shell
现在安装依赖项和测试依赖项
pip install -e '.[test]'
运行测试
pytest