Skip to content

A full-stack Python framework for creating interactive web applications from Jupyter Notebooks.

License

Notifications You must be signed in to change notification settings

gergomiklos/plotolo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚩 Plotolo

A full-stack Python framework for creating interactive web applications from Jupyter Notebooks.

Experiments for serving Jupyter Notebook files through Tornado websockets as an interactive web application.

Guide

todo

How it works 🤷🏽

(Streamlit + Jupyter Notebook) =:

  • The client connects to the server through websocket.

  • The server reads and compiles the Notebook's source code and executes it cell by cell.

  • The Notebook's source code calls widget functions.

  • The widgets are sent to the client through the server.

  • The client displays the widgets as UI components.

  • The client sends widget input to the server on user interactions.

  • The server partially re-executes the Notebook with the new input.

  • +1 Works embedded inside Jupyter without running a server using in-browser Javascript.

So it is basically Streamlit, but it

  • does not rerun the whole script on inputs, only the given cells (imitating the normal data science flow: when I modify a cell, I rerun it with the following cells).
  • can work without a server and display widgets inside the Notebook during development.

So it is better. 💩

Example flow:

Architecture:

Project structure 🏗

This project is a monorepo containing the following:

  • backend (lib): Tornado Web Server + IPython widgets
  • frontend: Next.js Web Application
  • widget(s): React Component Library

Detailed architecture:

How to run 🏃🏽

Currently only the dev mode is supported.

Prerequisites:

  • Python >= 3.9 + PiP
  • Node.js >= 18.0

Install dependencies:

pip install -r requirements.txt
cd ./frontend
npm install

Embedded mode from a Notebook:

Use an existing example or create a new Notebook:

cd ./examples
jupyter notebook

Standalone server mode:

Start backend:

python ./main.py

Start frontend:

cd ./frontend
npm run dev

Then go to http://localhost:3000

Start widget storybook:

cd ./widget
npm run storybook

Then go to http://localhost:6006

About

A full-stack Python framework for creating interactive web applications from Jupyter Notebooks.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published