PyView
A Python implementation of Phoenix LiveView
PyView enables dynamic, real-time web apps, using server-rendered HTML.
Documentation: https://pyview.rocks
Source Code: https://github.com/ogrodnek/pyview
Installation
pip install pyview-web
Quickstart
There's a cookiecutter template available
cookiecutter gh:ogrodnek/pyview-cookiecutter
Live Examples
https://examples.pyview.rocks/
Other Examples
- pyview AI chat
- pyview auth example (using authlib)
Simple Counter
count.py:
from pyview import LiveView, LiveViewSocket
from typing import TypedDict
class CountContext(TypedDict):
count: int
class CountLiveView(LiveView[CountContext]):
async def mount(self, socket: LiveViewSocket[CountContext], _session):
socket.context = {"count": 0}
async def handle_event(self, event, payload, socket: LiveViewSocket[CountContext]):
if event == "decrement":
socket.context["count"] -= 1
if event == "increment":
socket.context["count"] += 1
async def handle_params(self, url, params, socket: LiveViewSocket[CountContext]):
if "c" in params:
socket.context["count"] = int(params["c"][0])
count.html:
<div>
<h1>Count is {{count}}</h1>
<button phx-click="decrement">-</button>
<button phx-click="increment">+</button>
</div>
Acknowledgements
-
Obviously this project wouldn't exist without Phoenix LiveView, which is a wonderful paradigm and implementation. Besides using their ideas, we also directly use the LiveView JavaScript code.
-
Thanks to Donnie Flood for the encouragement, inspiration, help, and even pull requests to get this project started! Check out LiveViewJS for a TypeScript implementation of LiveView (that's much more mature than this one!)
-
Thanks to Darren Mulholland for both his Let's Build a Template Language tutorial, as well as his ibis template engine, which he very generously released into the public domain, and forms the basis of templating in PyView.
Additional Thanks
- We're using the pubsub implementation from flet
- PyView is built on top of Starlette.
Status
PyView is in the very early stages of active development. Please check it out and give feedback! Note that the API is likely to change, and there are many features that are not yet implemented.
Running the included Examples
Setup
uv sync
Running
uv run uvicorn examples.app:app --reload
Then go to http://localhost:8000/
uv Install
brew install uv
or
curl -LsSf https://astral.sh/uv/install.sh | sh
(see https://docs.astral.sh/uv/getting-started/installation/ for more details)
License
PyView is licensed under the MIT License.
Metadata
Release files for pyview-web 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pyview_web-0.9.0.tar.gz | 137.7 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyview_web-0.9.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 300.5 kB
Release files / pyview_web-0.9.0.tar.gz
| Download URL | pyview_web-0.9.0.tar.gz |
|---|---|
| Size | 137.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d35c487ba4995f63fef31802fa78d3033f82b79617ffa967bd3a813bdeebb00b
|
|
BLAKE2b-256 checksum How to use checksums |
8874f25db9ee44db7c1ff1f6f4a29fe4915711cefa16bbbf96933be516bd5516
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 3, 2026.
Transparency logRelease files / pyview_web-0.9.0-py3-none-any.whl
| Download URL | pyview_web-0.9.0-py3-none-any.whl |
|---|---|
| Size | 162.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c4a63af2591876e222059238d2e16215a645f4e2a42b404ddf32e5b5e83e9462
|
|
BLAKE2b-256 checksum How to use checksums |
972c39024e2cb1553396f14cb9881c597cf8461ff87d621f566eb9822951ec3b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 3, 2026.
Transparency logSecurity for pyview-web 0.9.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for pyview_web-0.9.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 3, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.