@galaxyproject/jupyterlite

中文文档
0.0.32发布于 2026/09/24ES Module零依赖近 30 天下载 1.2万

This project integrates JupyterLite with the Pyodide kernel and custom extensions such as jl-galaxy.

原始使用文档
文档目录16 节
  1. ⚙️ Requirements
  2. 📦 Setup Instructions
  3. 1. Create and activate a virtual environment
  4. 2. Install Python dependencies
  5. 3. Install Node.js dependencies
  6. 🔨 Build
  7. 🚀 Serve
  8. 🧰 Galaxy Integration Utilities ( gxy )
  9. ✅ api(endpoint, method="GET", data=None)
  10. ✅ get(datasets_identifiers, identifier_type="hid", retrieve…
  11. ✅ put(name, output=None, ext="auto", dbkey="?", history_id=…
  12. ✅ get_history(history_id=None)
  13. ✅ get_history_id()
  14. ✅ get_environment()
  15. ✅ _find_matching_ids(history_datasets, list_of_regex_patter…
  16. 📎 Notes

JupyterLite + Galaxy Integration

This project integrates JupyterLite with the Pyodide kernel and custom extensions such as jl-galaxy.

The jl-galaxy extension enables Jupyter users to interact seamlessly with their Galaxy history — including loading and saving notebooks — through a fully integrated browser-based interface.

⚙️ Requirements

  • Python 3.10.17+
  • Node.js 20.19.1+
  • npm 10.8.2+

📦 Setup Instructions

1. Create and activate a virtual environment

python -m venv .venv
source .venv/bin/activate

2. Install Python dependencies

pip install -r requirements.txt

This installs jupyterlite, jupyterlite-pyodide-kernel, and the gxy utility module for Galaxy integration.

3. Install Node.js dependencies

npm install

This installs JavaScript dependencies listed in package.json, including custom JupyterLite extensions.


🔨 Build

Run the full build to generate a standalone JupyterLite distribution:

npm run build

This will:

  • Run jupyter lite build
  • Include the Pyodide kernel
  • Bundle federated extensions like jl-galaxy
  • Output the final static site to: ./static/dist/_output

🚀 Serve

To serve the JupyterLite site locally:

npm run serve

Then open http://localhost:3000 in your browser.


🧰 Galaxy Integration Utilities (gxy)

The gxy module provides Python functions to interact with the Galaxy API directly from JupyterLite.

✅ api(endpoint, method="GET", data=None)

Makes an HTTP request to a Galaxy API endpoint and returns the parsed JSON response.

await api("/api/histories")
await api("/api/histories", method="POST", data={"name": "New History"})

✅ get(datasets_identifiers, identifier_type="hid", retrieve_datatype=False)

Downloads dataset(s) by HID, ID, or regex pattern. Saves them to Pyodide's virtual filesystem.

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)

Uploads a file from the virtual filesystem to the current Galaxy history.

await put("mydata.txt", "newname.txt", ext="txt")

✅ get_history(history_id=None)

Returns metadata for all visible datasets in the current history.

await get_history()

✅ get_history_id()

Returns the current history ID based on the dataset context.

await get_history_id()

✅ get_environment()

Returns the Galaxy environment injected into the session via __gxy__.

get_environment()

✅ _find_matching_ids(history_datasets, list_of_regex_patterns, identifier_type='hid')

Used internally to resolve regex patterns to dataset identifiers.


📎 Notes

  • The jl-galaxy extension allows users to browse and manage Galaxy histories directly from the Jupyter UI.
  • All files must be placed within static/dist/_output; writing outside this directory breaks the build.
  • The upload helper uses XMLHttpRequest to work around Pyodide's limitations with fetch.

版本与发布记录

@galaxyproject/jupyterlite 共发布 32 个版本,首次发布于 2025/05/07;过去 12 个月发布了 15 个版本。

版本发布日期距今
0.0.32latest2026/09/241 个月前
0.0.312026/09/082 个月前
0.0.302026/01/159 个月前
0.0.292026/01/1510 个月前
0.0.282026/01/0510 个月前
0.0.272025/12/2610 个月前

关于 @galaxyproject/jupyterlite 的常见问题

@galaxyproject/jupyterlite 是什么?

This project integrates JupyterLite with the Pyodide kernel and custom extensions such as jl-galaxy.

如何安装 @galaxyproject/jupyterlite?

在项目目录运行 npm install @galaxyproject/jupyterlite,或使用 pnpm add / yarn add / bun add。

@galaxyproject/jupyterlite 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/galaxyproject__jupyterlite 是否存在。

@galaxyproject/jupyterlite 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@galaxyproject/jupyterlite 可以商用吗?

@galaxyproject/jupyterlite 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@galaxyproject/jupyterlite 的下载量有多少?

根据 npm 官方下载统计,@galaxyproject/jupyterlite 在 2026/10/16 – 2026/11/14 这 30 天内被下载 11,949 次,日均约 398 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@galaxyproject/jupyterlite 还在维护吗?

最新版本 0.0.32 发布于 2026/09/24(1 个月前);至今共发布 32 个版本,其中过去 12 个月发布了 15 个;首次发布于 2025/05/07。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。