Jupyter Server extension for staging notebook workspaces from repositories, parameters, and data URLs.
Project description
NBStager
NBStager is a Jupyter Server extension for preparing notebook workspaces from launch URLs.
It can:
- write launch parameters into a
.envfile; - stage data files from HTTP(S) URLs;
- redirect to a notebook in JupyterLab.
NBStager is designed to work in Binder, JupyterHub, and local JupyterLab environments.
Install
From PyPI, once published:
pip install nbstager
From GitHub:
pip install git+https://github.com/recap/nbstager.git@v0.1.0
For development:
pip install -e .
The package includes a Jupyter Server config file that enables the extension automatically. If needed, enable it manually:
jupyter server extension enable --py nbstager --sys-prefix
Check:
jupyter server extension list
Endpoint
NBStager registers this route:
/launch
Example local URL:
http://localhost:8888/launch?notebookpath=mynotebook.ipynb&DATASET_URL=https://example.org/data.csv
Reserved query parameters
| Parameter | Required | Default | Description |
|---|---|---|---|
notebookpath |
no | — | Notebook path relative to the target repository root. |
data |
no | — | JSON object or array describing data files to download. |
All other query parameters are written to .env.
Passing notebook parameters
/launch?notebookpath=mynotebook.ipynb&DATASET_URL=https://example.org/data.csv
creates:
DATASET_URL=https://example.org/data.csv
inside:
.env
Python notebooks can read it with:
from dotenv import load_dotenv
import os
load_dotenv('.env')
print(os.getenv('DATASET_URL'))
R notebooks can read it with:
library(dotenv)
load_dot_env('.env')
Sys.getenv('DATASET_URL')
Data staging
The data parameter accepts JSON.
Decoded example:
[
{
"url": "https://example.org/customers.csv",
"path": "data/customers.csv"
}
]
NBStager downloads the files into the workspace and writes:
data_manifest.json
Binder usage
In Binder, install NBStager in your requirements.txt. Then launch a target repository through the wrapper with:
https://mybinder.org/v2/gh/OWNER/WRAPPER_REPO/main?urlpath=launch?notebookpath=mynotebook.ipynb&DATASET_URL=https://example.org/data.csv
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nbstager-0.1.0.tar.gz.
File metadata
- Download URL: nbstager-0.1.0.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
150fc74a05d13ca177f0b1b50f8728d2855fdf83806f642fc0ae7f8a5d456d68
|
|
| MD5 |
80de37ad6473db9e8e8e6b3b30c4a98f
|
|
| BLAKE2b-256 |
44b6e28ddffd06bc1532000e0eb462c4815efc49008245d30ba5533dd136b532
|
Provenance
The following attestation bundles were made for nbstager-0.1.0.tar.gz:
Publisher:
publish_pypi.yml on recap/nbstager
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nbstager-0.1.0.tar.gz -
Subject digest:
150fc74a05d13ca177f0b1b50f8728d2855fdf83806f642fc0ae7f8a5d456d68 - Sigstore transparency entry: 2097225030
- Sigstore integration time:
-
Permalink:
recap/nbstager@f02940f5638d2125ffd40922019f16c097b1fe56 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/recap
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@f02940f5638d2125ffd40922019f16c097b1fe56 -
Trigger Event:
release
-
Statement type:
File details
Details for the file nbstager-0.1.0-py3-none-any.whl.
File metadata
- Download URL: nbstager-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06fe420588bcf89aabe2dc9f8dc535617f8e57dda1ce5cc3dd3c8ea10c38bd83
|
|
| MD5 |
9a58ddc5ac54e6a00fb0a4e748a28194
|
|
| BLAKE2b-256 |
388d28aab0789a1ce513140f96036bf1f5c195f3bcb13fae2d1f58c5221d348f
|
Provenance
The following attestation bundles were made for nbstager-0.1.0-py3-none-any.whl:
Publisher:
publish_pypi.yml on recap/nbstager
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nbstager-0.1.0-py3-none-any.whl -
Subject digest:
06fe420588bcf89aabe2dc9f8dc535617f8e57dda1ce5cc3dd3c8ea10c38bd83 - Sigstore transparency entry: 2097225631
- Sigstore integration time:
-
Permalink:
recap/nbstager@f02940f5638d2125ffd40922019f16c097b1fe56 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/recap
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@f02940f5638d2125ffd40922019f16c097b1fe56 -
Trigger Event:
release
-
Statement type: