Skip to main content

Live web renderer for the panelmark ecosystem

Project description

panelmark-web

Live web session runtime for the panelmark ecosystem.


What it is

panelmark-web sits on top of panelmark-html's static structure and adds a real-time browser interface:

  • A WebSocket server handler that drives a panelmark.Shell instance
  • A draw-command-to-HTML renderer that populates .pm-panel-body elements
  • A vanilla-JS browser client that relays keyboard input and applies DOM updates
  • Framework adapters for FastAPI/Starlette (async) and Flask/flask-sock (sync)

Each browser tab corresponds to one Shell instance on the server. The WebSocket connection is the session lifetime.


What it includes

Beyond the transport and rendering infrastructure, panelmark-web ships built-in implementations of the full portable standard library:

  • Interactions (panelmark_web.interactions): all 8 required portable interactions — StatusMessage, MenuReturn, RadioList, CheckBox, TextBox, NestedMenu, FormInput, DataclassFormInteraction — plus MenuFunction, ListView, TableView. See portable library spec for the full normative specification.

  • Widgets (panelmark_web.widgets): all 6 required portable widgets — Alert, Confirm, InputPrompt, ListSelect, DataclassForm, FilePicker. Web-specific note: widgets are async/non-blocking; see overview for the async widget model.

Application code can also supply arbitrary custom Interaction objects — any render() method that returns WriteCmd and FillCmd commands works out of the box.

See docs/interaction-coverage.md for the full status matrix.

What is not implemented

The following optional interactions and widgets from the portable library are not implemented in this version:

Item Type Notes
TreeView Interaction Not implemented
DatePicker Widget Not implemented
Progress Widget Not implemented
Spinner Widget Not implemented
Toast Widget Not implemented

See the interaction coverage matrix for the full status of every portable interaction, widget, and draw command.


Dependencies

Package Role
panelmark Shell, Interaction ABC, draw commands
panelmark-html Static page structure and base CSS
fastapi / starlette (optional) Async ASGI server adapter
flask + flask-sock (optional) Sync WSGI server adapter

Compatibility status

panelmark-web implements the core renderer contract and claims portable-library-compatible status:

  • shell hosting via WebSocket session
  • draw-command execution (WriteCmd, FillCmd; CursorCmd ignored)
  • focus routing and dirty-region tracking
  • exit signal handling
  • all 8 required portable interactions (panelmark_web.interactions)
  • all 6 required portable widgets (panelmark_web.widgets)

Web note: The portable-library spec describes widgets as blocking (widget.show(sh) returns after the user acts). In panelmark-web the session is async — assign the widget to a panel region and signal_return() delivers the result when the user acts. Constructor signatures and value semantics match the spec exactly.

See docs/interaction-coverage.md for the full status matrix.


Install

pip install panelmark-web[fastapi]   # FastAPI / Starlette
pip install panelmark-web[flask]     # Flask + flask-sock

Quick start

See docs/getting-started.md for a step-by-step guide including interaction definition, server wiring, and browser setup.

See examples/fastapi_app.py and examples/flask_app.py for working server examples.


Documentation

Document Description
Getting Started Step-by-step guide: interaction definition, FastAPI/Flask wiring, browser setup
Interaction Coverage Status matrix: every portable interaction, widget, and draw command
WebSocket Protocol Client→server and server→client message format; key mapping reference
Hook Usage How panelmark-web reads and writes the panelmark-html DOM hook contract
DOM Hook Contract Stable DOM interface defined by panelmark-html that this package depends on
Portable Library Spec Normative spec for all 8 portable interactions and 6 portable widgets
Renderer Spec Core renderer contract; compatibility levels; extension policy
Shell Language ASCII-art layout syntax reference
Ecosystem Overview How panelmark-web fits into the panelmark package ecosystem

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

panelmark_web-0.1.0.tar.gz (57.0 kB view details)

Uploaded Source

Built Distribution

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

panelmark_web-0.1.0-py3-none-any.whl (41.5 kB view details)

Uploaded Python 3

File details

Details for the file panelmark_web-0.1.0.tar.gz.

File metadata

  • Download URL: panelmark_web-0.1.0.tar.gz
  • Upload date:
  • Size: 57.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for panelmark_web-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7e67fb5483657efd5c1cd7d5c8ed2f36fbdc93fd7c1d7ad498d21b83b087f986
MD5 4582843d765f30722979e55491802e2e
BLAKE2b-256 b8b3dede91b54973fbcb484e94cb4ce4e777a82eac169214b1c16e30b88c1b40

See more details on using hashes here.

File details

Details for the file panelmark_web-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: panelmark_web-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 41.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for panelmark_web-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f7a4bda20327563d23788930604618b16eb6820ac97dce8d5c5e4f5f54983e07
MD5 aadf671eac54bdc6af001299bce35405
BLAKE2b-256 5b09fdf01a2e71db84e860f2ed9e74c4212c567d1099e446a41452517a7ee518

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