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.

Image

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.4.0.tar.gz (197.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.4.0-py3-none-any.whl (121.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for jupyterpack-0.4.0.tar.gz
Algorithm Hash digest
SHA256 cd9b5e1944e203a6edce7e36e7e4e12e5e6b9c471a96005c0c63d93ec22b42d8
MD5 4bd16a4ff95f33843be711289fbb7982
BLAKE2b-256 9542443ff82856833cbc6fd23b091d9334cb40c6a0c69d9f7dbcc701527dbd26

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for jupyterpack-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f45c219d6ff60e2bbec22d9dcbb7eb2251229cd27177f39e5ccae4fce0604629
MD5 7553bcb2d16df5aec99de9a94b3494c9
BLAKE2b-256 e89f6f5c671bea9f331d17eaf21ad99e0f508f2026d9f067aee99e6a0216a516

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