Skip to main content

A JupyterLab extension for serving web app.

Project description

jupyterpack

Github Actions Status Try on lite

A JupyterLite extension to serve in-browser Python and Javascript web application

Features

  • Python Web Apps: Serve Python web applications directly in the browser using JupyterLite's in-browser Python kernel. jupyterpack currently supports Dash.
  • JavaScript Web Apps: Bundle and serve JavaScript web applications using in-browser bundlers.

Installation

You can install jupyterpack using pip or conda

# Install using pip
pip install jupyterpack

# Install using conda
conda install -c conda-forge jupyterpack

Usage

To use jupyterpack, you need to create a .spk file that defines your web application. Here's an example structure of a React application:

my_app/
├── app.spk
├── App.js         # Your JS code
├── package.json   # Your JS dependencies
└── index.html      # HTML entry for JS apps

the app.spk is the entry point of your React app, it should contain the following content:

{
  "name": "React Example",
  "entry": "/index.html",
  "framework": "react"
}

Double clicking the spk file to open the web app as a tab of JupyterLab.

Dash application

Same as the React application, here is the structure of a Dash application:

my_app/
├── app.spk
├── server.py         # Your Dash code

the app.spk is the entry point of your Dash app, it should contain the following content:

{
  "name": "Dash Example",
  "entry": "server.py",
  "framework": "dash"
}

For the Dash code, you need to define your Dash app variable as app and do not call app.run_server directly, jupyterpack will handle the server for you. Just as the case of React app, double clicking the spk file will open the Dash app in a new JupyterLab tab.

Try it online!

You can try it online by clicking on this badge:

Try on lite

License

jupyterpack is licensed under the BSD-3-Clause license.

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

jupyterpack-0.2.0.tar.gz (172.5 kB view details)

Uploaded Source

Built Distribution

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

jupyterpack-0.2.0-py3-none-any.whl (103.6 kB view details)

Uploaded Python 3

File details

Details for the file jupyterpack-0.2.0.tar.gz.

File metadata

  • Download URL: jupyterpack-0.2.0.tar.gz
  • Upload date:
  • Size: 172.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for jupyterpack-0.2.0.tar.gz
Algorithm Hash digest
SHA256 542bac69eb9cffb35becbd7c30a9d7384b161733efc85d04a2d16c470a950b46
MD5 52448d5fee8b2339a1524de26fdc50f6
BLAKE2b-256 1a3c7d6d1d318edf14449056bca9e1f307bbf5b17e2630e2b10f8f380b05d372

See more details on using hashes here.

File details

Details for the file jupyterpack-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: jupyterpack-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 103.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for jupyterpack-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e11b16d46ff548aa1cc68604db83da27f2ac8d259ec7aee4f93bfba96905b0bf
MD5 29e0ef090778990ebe1c24bb7d6b2e2c
BLAKE2b-256 660ece197b1a348325661c73c6ecdbf12f742233e38975c1eac6d78030c44413

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