JupyterLite + 银河一体化
这个项目将 JupyterLite 与 Pyodide 内核和自定义扩展集成在一起, 例如 jl-galaxy。 。 。 .
这个 jl-galaxy 扩展让Jupyter用户能够通过一个完全集成的基于浏览器的界面,与他们的Galaxy历史无缝地互动——包括加载和保存笔记本.
所需经费
- 蟒 3.10.17+ (中文(简体) )
- 节点.js 20.19.1+ (中文(简体) )
- 无 10.8.2+ (单位:千美元)
QQ 设置指令
1. 创建和激活虚拟环境
python -m venv .venv
source .venv/bin/activate
2. 安装 Python 依赖性
pip install -r requirements.txt
此安装 jupyterlite, (中文(简体) ), jupyterlite-pyodide-kernel,则 gxy 银河系统一体化实用模块.
3. 安装节点js依赖性
npm install
安装 JavaScript 依赖性 package.json,包括自定义的JupyterLite扩展.
QQ 构建
运行完整的构建以生成独立的 JupyterLite 分布 :
npm run build
这将:
- 运行
jupyter lite build - 包含 Pyodide 内核
- 捆绑式联邦扩展像
jl-galaxy - 输出最后的静态站点到 :
./static/dist/_output
服务
在当地服务JupyterLite网站:
npm run serve
然后打开 http://localhost:3:00 (英语) 在您的浏览器中.
银河一体化公用事业gxy(中文(简体) )
这个 gxy 模块提供Python函数,直接从JupyterLite与Galaxy API交互.
✅ api(endpoint, method="GET", data=None)
向 Galaxy API 端点提交 HTTP 请求并返回解析后的 JSON 响应 .
await api("/api/histories")
await api("/api/histories", method="POST", data={"name": "New History"})
✅ get(datasets_identifiers, identifier_type="hid", retrieve_datatype=False)
通过HID,ID,或regex模式来下载数据集. 将其保存到Pyodide的虚拟文件系统.
await get(3) # by HID
await get("some_id", "id")
await get("myfile.*", "regex")
await get("mytag", "tag")
✅ put(name, output=None, ext="auto", dbkey="?", history_id=None)
将一个文件从虚拟文件系统上传到当前的Galaxy历史.
await put("mydata.txt", "newname.txt", ext="txt")
✅ get_history(history_id=None)
返回当前历史中所有可见数据集的元数据.
await get_history()
✅ get_history_id()
根据数据集上下文返回当前历史 ID.
await get_history_id()
✅ get_environment()
通过 __gxy__。 。 。 .
get_environment()
✅ _find_matching_ids(history_datasets, list_of_regex_patterns, identifier_type='hid')
内部用于解析regex模式到数据集标识符.
页:1
- 这个
jl-galaxy扩展允许用户直接从Jupyter UI浏览和管理Galaxy历史. - 所有文件必须放在里面
static/dist/_output; 在此目录外写入会打破构建. - 上传助手使用
XMLHttpRequest绕着Pyodide的局限性工作fetch。 。 。 .