@galaxyproject/jupyterlite 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -1,39 +1,47 @@
|
|
|
1
|
-
# JupyterLite +
|
|
1
|
+
# JupyterLite + Galaxy Integration
|
|
2
2
|
|
|
3
3
|
This project integrates JupyterLite with the Pyodide kernel and custom extensions such as `jl-galaxy`.
|
|
4
4
|
|
|
5
|
+
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.
|
|
6
|
+
|
|
5
7
|
## ⚙️ Requirements
|
|
6
8
|
|
|
7
|
-
- Python 3.
|
|
8
|
-
- Node.js
|
|
9
|
-
- npm
|
|
9
|
+
- Python **3.10.17+**
|
|
10
|
+
- Node.js **20.19.1+**
|
|
11
|
+
- npm **10.8.2+**
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
---
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
## 📦 Setup Instructions
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
### 1. Create and activate a virtual environment
|
|
16
18
|
|
|
17
19
|
```bash
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
python -m venv .venv
|
|
21
|
+
source .venv/bin/activate
|
|
20
22
|
```
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
### 2. Install Python dependencies
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pip install -r requirements.txt
|
|
28
|
+
```
|
|
23
29
|
|
|
24
|
-
|
|
30
|
+
This installs `jupyterlite`, `jupyterlite-pyodide-kernel`, and the `gxy` utility module for Galaxy integration.
|
|
25
31
|
|
|
26
|
-
Install
|
|
32
|
+
### 3. Install Node.js dependencies
|
|
27
33
|
|
|
28
34
|
```bash
|
|
29
35
|
npm install
|
|
30
36
|
```
|
|
31
37
|
|
|
32
|
-
This installs dependencies listed in `package.json`,
|
|
38
|
+
This installs JavaScript dependencies listed in `package.json`, including custom JupyterLite extensions.
|
|
39
|
+
|
|
40
|
+
---
|
|
33
41
|
|
|
34
42
|
## 🔨 Build
|
|
35
43
|
|
|
36
|
-
Run the build to generate a standalone JupyterLite distribution:
|
|
44
|
+
Run the full build to generate a standalone JupyterLite distribution:
|
|
37
45
|
|
|
38
46
|
```bash
|
|
39
47
|
npm run build
|
|
@@ -42,29 +50,92 @@ npm run build
|
|
|
42
50
|
This will:
|
|
43
51
|
- Run `jupyter lite build`
|
|
44
52
|
- Include the Pyodide kernel
|
|
45
|
-
- Bundle
|
|
46
|
-
-
|
|
53
|
+
- Bundle federated extensions like `jl-galaxy`
|
|
54
|
+
- Output the final static site to: `./static/dist/_output`
|
|
55
|
+
|
|
56
|
+
---
|
|
47
57
|
|
|
48
|
-
## 🚀
|
|
58
|
+
## 🚀 Serve
|
|
49
59
|
|
|
50
|
-
|
|
60
|
+
To serve the JupyterLite site locally:
|
|
51
61
|
|
|
52
62
|
```bash
|
|
53
|
-
|
|
63
|
+
npm run serve
|
|
54
64
|
```
|
|
55
65
|
|
|
56
|
-
|
|
66
|
+
Then open [http://localhost:3000](http://localhost:3000) in your browser.
|
|
57
67
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## 🧰 Galaxy Integration Utilities (`gxy`)
|
|
71
|
+
|
|
72
|
+
The `gxy` module provides Python functions to interact with the Galaxy API directly from JupyterLite.
|
|
73
|
+
|
|
74
|
+
### ✅ `api(endpoint, method="GET", data=None)`
|
|
75
|
+
Makes an HTTP request to a Galaxy API endpoint and returns the parsed JSON response.
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
await api("/api/histories")
|
|
79
|
+
await api("/api/histories", method="POST", data={"name": "New History"})
|
|
61
80
|
```
|
|
62
81
|
|
|
63
|
-
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
### ✅ `get(datasets_identifiers, identifier_type="hid", retrieve_datatype=False)`
|
|
85
|
+
Downloads dataset(s) by HID, ID, or regex pattern. Saves them to Pyodide's virtual filesystem.
|
|
86
|
+
|
|
87
|
+
```python
|
|
88
|
+
await get(3) # by HID
|
|
89
|
+
await get("some_id", identifier_type="id")
|
|
90
|
+
await get("myfile.*", identifier_type="regex")
|
|
91
|
+
```
|
|
64
92
|
|
|
65
93
|
---
|
|
66
94
|
|
|
67
|
-
|
|
95
|
+
### ✅ `put(name, output=None, ext="auto", dbkey="?", history_id=None)`
|
|
96
|
+
Uploads a file from the virtual filesystem to the current Galaxy history.
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
await put("mydata.txt", "newname.txt", ext="txt")
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
### ✅ `get_history(history_id=None)`
|
|
105
|
+
Returns metadata for all visible datasets in the current history.
|
|
106
|
+
|
|
107
|
+
```python
|
|
108
|
+
await get_history()
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
### ✅ `get_history_id()`
|
|
114
|
+
Returns the current history ID based on the dataset context.
|
|
115
|
+
|
|
116
|
+
```python
|
|
117
|
+
await get_history_id()
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
### ✅ `get_environment()`
|
|
123
|
+
Returns the Galaxy environment injected into the session via `__gxy__`.
|
|
124
|
+
|
|
125
|
+
```python
|
|
126
|
+
get_environment()
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
### ✅ `_find_matching_ids(history_datasets, list_of_regex_patterns, identifier_type='hid')`
|
|
132
|
+
Used internally to resolve regex patterns to dataset identifiers.
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## 📎 Notes
|
|
137
|
+
|
|
138
|
+
- The `jl-galaxy` extension allows users to browse and manage Galaxy histories directly from the Jupyter UI.
|
|
139
|
+
- All files must be placed within `static/dist/_output`; writing outside this directory breaks the build.
|
|
140
|
+
- The upload helper uses `XMLHttpRequest` to work around Pyodide's limitations with `fetch`.
|
|
68
141
|
|
|
69
|
-
- The build process automatically configures the Pyodide kernel and registers it as a federated extension.
|
|
70
|
-
- If you're developing additional extensions, make sure to register them in `jupyter-lite.json` under `federated_extensions`.
|
package/package.json
CHANGED
|
@@ -5,6 +5,21 @@
|
|
|
5
5
|
"appVersion": "0.5.1",
|
|
6
6
|
"baseUrl": "./",
|
|
7
7
|
"defaultKernelName": "python",
|
|
8
|
+
"disabledExtensions": [
|
|
9
|
+
"@jupyterlab/filebrowser-extension",
|
|
10
|
+
"@jupyterlab/launcher-extension",
|
|
11
|
+
"@jupyterlab/running-extension",
|
|
12
|
+
"@jupyterlab/toc-extension",
|
|
13
|
+
"@jupyterlab/fileeditor-extension:plugin",
|
|
14
|
+
"@jupyterlab/fileeditor-extension:cursor-position",
|
|
15
|
+
"@jupyterlab/fileeditor-extension:completer",
|
|
16
|
+
"@jupyterlab/fileeditor-extension:language-server",
|
|
17
|
+
"@jupyterlab/fileeditor-extension:editor-syntax-status",
|
|
18
|
+
"@jupyterlab/fileeditor-extension:tab-space-status",
|
|
19
|
+
"@jupyterlab/notebook-extension:toc",
|
|
20
|
+
"@jupyterlite/application-extension:share-file",
|
|
21
|
+
"@jupyterlab/tooltip-extension:files"
|
|
22
|
+
],
|
|
8
23
|
"faviconUrl": "./lab/favicon.ico",
|
|
9
24
|
"federated_extensions": [
|
|
10
25
|
{
|
|
@@ -13,17 +28,17 @@
|
|
|
13
28
|
"load": "static/remoteEntry.3ac7f76fb22d01270496.js",
|
|
14
29
|
"name": "@jupyterlite/pyodide-kernel-extension"
|
|
15
30
|
},
|
|
31
|
+
{
|
|
32
|
+
"extension": "./extension",
|
|
33
|
+
"load": "entry.js",
|
|
34
|
+
"name": "jl-galaxy"
|
|
35
|
+
},
|
|
16
36
|
{
|
|
17
37
|
"extension": "./extension",
|
|
18
38
|
"liteExtension": false,
|
|
19
39
|
"load": "static/remoteEntry.5cbb9d2323598fbda535.js",
|
|
20
40
|
"name": "jupyterlab_pygments",
|
|
21
41
|
"style": "./style"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"name": "jl-galaxy",
|
|
25
|
-
"load": "entry.js",
|
|
26
|
-
"extension": "./extension"
|
|
27
42
|
}
|
|
28
43
|
],
|
|
29
44
|
"fileTypes": {
|
|
@@ -310,22 +325,7 @@
|
|
|
310
325
|
]
|
|
311
326
|
}
|
|
312
327
|
}
|
|
313
|
-
}
|
|
314
|
-
"disabledExtensions": [
|
|
315
|
-
"@jupyterlab/filebrowser-extension",
|
|
316
|
-
"@jupyterlab/launcher-extension",
|
|
317
|
-
"@jupyterlab/running-extension",
|
|
318
|
-
"@jupyterlab/toc-extension",
|
|
319
|
-
"@jupyterlab/fileeditor-extension:plugin",
|
|
320
|
-
"@jupyterlab/fileeditor-extension:cursor-position",
|
|
321
|
-
"@jupyterlab/fileeditor-extension:completer",
|
|
322
|
-
"@jupyterlab/fileeditor-extension:language-server",
|
|
323
|
-
"@jupyterlab/fileeditor-extension:editor-syntax-status",
|
|
324
|
-
"@jupyterlab/fileeditor-extension:tab-space-status",
|
|
325
|
-
"@jupyterlab/notebook-extension:toc",
|
|
326
|
-
"@jupyterlite/application-extension:share-file",
|
|
327
|
-
"@jupyterlab/tooltip-extension:files"
|
|
328
|
-
]
|
|
328
|
+
}
|
|
329
329
|
},
|
|
330
330
|
"jupyter-lite-schema-version": 0
|
|
331
331
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"gxy": {
|
|
3
|
+
"releases": {
|
|
4
|
+
"0.0.0": [
|
|
5
|
+
{
|
|
6
|
+
"comment_text": "",
|
|
7
|
+
"digests": {
|
|
8
|
+
"md5": "aaaf4a39a1b09914421e1217fdd80ad9",
|
|
9
|
+
"sha256": "6a71c41fcd17283c8259d1011e8c5f8e297850357594c7c20407720d4985d05f"
|
|
10
|
+
},
|
|
11
|
+
"downloads": -1,
|
|
12
|
+
"filename": "gxy-0.0.0-py3-none-any.whl",
|
|
13
|
+
"has_sig": false,
|
|
14
|
+
"md5_digest": "aaaf4a39a1b09914421e1217fdd80ad9",
|
|
15
|
+
"packagetype": "bdist_wheel",
|
|
16
|
+
"python_version": "py3",
|
|
17
|
+
"requires_python": ">=3.7",
|
|
18
|
+
"size": 3919,
|
|
19
|
+
"upload_time": "2025-05-09T17:32:52.344251Z",
|
|
20
|
+
"upload_time_iso_8601": "2025-05-09T17:32:52.344251Z",
|
|
21
|
+
"url": "./gxy-0.0.0-py3-none-any.whl",
|
|
22
|
+
"yanked": false,
|
|
23
|
+
"yanked_reason": null
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
Binary file
|