GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - mthiboust/jupyterlab-retrieve-base-url: Jupyterlab v4 extension to retrieve the base URL from the frontend

BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
jupyterlab_retrieve_base_url
jupyterlab_retrieve_base_url
 
 
src
src
 
 
style
style
 
 
.copier-answers.yml
.copier-answers.yml
 
 
.gitignore
.gitignore
 
 
.prettierignore
.prettierignore
 
 
.yarnrc.yml
.yarnrc.yml
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
RELEASE.md
RELEASE.md
 
 
install.json
install.json
 
 
package.json
package.json
 
 
pyproject.toml
pyproject.toml
 
 
setup.py
setup.py
 
 
tsconfig.json
tsconfig.json
 
 
yarn.lock
yarn.lock
 
 

Repository files navigation

Retrieve Base URL extension for Jupyterlab v4

Github Actions Status

A JupyterLab extension to retrieve the base URL from the frontend. It was developped as a workaround for current limitation of dash jupyterlab extension that cannot be installed with jupyterlab v4. Code is mostly taken from here and here in the dash project.

Install

Note that this extension requires jupyterlab>=4.0.0.

To install/uninstall the extension, execute:

# Install
pip install jupyterlab-retrieve-base-url

# Uninstall
pip uninstall jupyterlab-retrieve-base-url

Usage

In a jupyterlab notebook:

from jupyterlab_retrieve_base_url import retrieve_base_url

retrieve_base_url()

Some typical results:

# Running locally
{'type': 'base_url_response',
 'server_url': 'http://localhost:8890',
 'base_subpath': '/',
 'frontend': 'jupyterlab'}
# Using jupyterhub
{'type': 'base_url_response',
 'server_url': 'https://my-domain.com',
 'base_subpath': '/user/[email protected]/',
 'frontend': 'jupyterlab'}

Configure dash proxy config

The current jupyter_dash.infer_jupyterlab_proxy_config() method from the dash==2.18.1 library is not working correctly with jupyterlab>=4.0.0 (see plotly/dash#2804 and plotly/dash#2998). If you run into this issue, then you can try the following:

from dash import Dash, jupyter_dash

# Set proxy settings
from dash._jupyter import _jupyter_config
from jupyterlab_retrieve_base_url import retrieve_base_url
_jupyter_config.update(retrieve_base_url())

# Create a dash app
app = dash.Dash()
...

# Run the dash app
jupyter_dash.run_app(app, host=host, port=port, mode="jupyterlab")

About

Jupyterlab v4 extension to retrieve the base URL from the frontend

Topics

base-urljupyterlab-4jupyterlab-extension

Resources

Readme
BSD-3-Clause license
Activity

Stars

2 stars

Watchers

1 watching

Forks

0 forks
Report repository

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.