Skip to main content

Jupyter magic commands for configuring Dash apps on nanoHUB

Project description

nanohub-dash

Documentation Status

Tools for running Dash applications on nanoHUB.

Documentation

Full documentation is available at https://nanohub-dash.readthedocs.io

Installation

pip install nanohub-dash

Features

  • Jupyter Magic Command (%set_dash_env): Configure environment variables for Dash apps directly in Jupyter notebooks
  • Command-line Tool (start_dash): Launch Dash applications with automatic proxy configuration and header injection

Quick Start

Jupyter Notebook

%load_ext nanohubdash
%set_dash_env

import os
from dash import Dash, html

app = Dash(__name__,
    routes_pathname_prefix=os.getenv("DASH_ROUTES_PATHNAME_PREFIX"),
    requests_pathname_prefix=os.getenv("DASH_REQUESTS_PATHNAME_PREFIX")
)
app.layout = html.Div("Hello nanoHUB!")

if __name__ == "__main__":
    app.run(
        jupyter_server_url=os.environ.get("DASH_BASE_PROXY"),
        host=os.environ.get("DASH_HOST", "0.0.0.0"),
        port=os.environ.get("DASH_PORT", "8001"),
    )

Command Line

start_dash --app myapp.py

Environment Variables

The magic command sets the following environment variables:

  • DASH_REQUESTS_PATHNAME_PREFIX - The proxy path prefix for Dash requests
  • DASH_ROUTES_PATHNAME_PREFIX - Set to /
  • DASH_HOST - The bind host for Dash
  • DASH_PORT - The port for Dash
  • DASH_BASE_PROXY - The proxy URL (https://proxy.<hub_host>)

Requirements

  • Python >= 3.8
  • IPython >= 7.0
  • Must be running on a nanoHUB environment with SESSION and SESSIONDIR environment variables set

License

MIT License - Copyright 2026 HUBzero Foundation, LLC.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nanohub_dash-0.1.1.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nanohub_dash-0.1.1-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file nanohub_dash-0.1.1.tar.gz.

File metadata

  • Download URL: nanohub_dash-0.1.1.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for nanohub_dash-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6a54f2be721f8343d3eac2a5e9aa254932b6f3793b2822c0ce5aa17edc31d04f
MD5 302fa755013d0043583fcb8ccd6ab498
BLAKE2b-256 fac049702d9b7f06badc3b3a05bcc999e256326e3007911d603a677d4591843e

See more details on using hashes here.

File details

Details for the file nanohub_dash-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: nanohub_dash-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for nanohub_dash-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b84d11a549feb0d1a9a5faf5ba61d3a5d30d1ad72f964cfd4639945afaf27912
MD5 df33e508347f9f31667032e10610f4c3
BLAKE2b-256 8d9d7143c554c2c5fe6a1cbd709e52ba477f92c329944f9d26188bb0b667d556

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page