Modular Python web framework with hot-mount dynamic modules and stateful, WebSocket-driven LiveComponents — FastAPI + SQLAlchemy + Jinja2.
Project description
Modular Python web framework with hot-mount dynamic modules and stateful, WebSocket-driven LiveComponents.
What hotframe is
hotframe is a Python web framework that combines FastAPI, SQLAlchemy 2.0, and Jinja2 under Django-like ergonomics. It adds two pieces:
- A hot-mount module engine — install, activate, deactivate, and uninstall plugins at runtime without restarting the process.
LiveComponent— stateful, server-rendered components driven by a single WebSocket per page. Server holds the state; the client streams events and applies HTML patches withmorphdom. No client-side framework, no build step.
Install
pip install hotframe
Quickstart
hf startproject myapp
cd myapp
hf runserver
INFO hotframe.bootstrap Application started in 142ms
INFO uvicorn.error Uvicorn running on http://127.0.0.1:8000
A LiveComponent in 30 seconds
# modules/todo/components/todo_list/component.py
from hotframe.live import LiveComponent, event
from modules.todo.models import Todo
class TodoList(LiveComponent):
user_id: int # prop
items: list = [] # state
new_text: str = ""
async def on_mount(self) -> None:
self.items = await Todo.where(user_id=self.user_id).all()
@event("toggle")
async def toggle(self, todo_id: str) -> None:
t = next(t for t in self.items if str(t.id) == todo_id)
t.done = not t.done
await t.save()
@event("add")
async def add(self) -> None:
if not self.new_text.strip():
return
await Todo.create(user_id=self.user_id, text=self.new_text)
self.items = await Todo.where(user_id=self.user_id).all()
self.new_text = ""
{# modules/todo/components/todo_list/template.html #}
<ul>
{% for todo in items %}
<li>
<input type="checkbox" {% if todo.done %}checked{% endif %}
data-on:click="toggle:{{ todo.id }}">
{{ todo.text }}
</li>
{% endfor %}
</ul>
<form data-on:submit="add">
<input data-bind="new_text">
<button type="submit">Add</button>
</form>
{# any page template #}
{% extends "shared/base.html" %}
{% block body %}
{% live "todo_list" user_id=user.id %}
{% endblock %}
That's it. Click the checkbox — the server toggles the todo, sends an HTML patch back, the DOM updates without a page reload, and the dev wrote zero JavaScript.
Documentation
Full docs, guides and live examples at hotframe.dev.
License
Apache License 2.0 — see 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hotframe-1.1.0.tar.gz.
File metadata
- Download URL: hotframe-1.1.0.tar.gz
- Upload date:
- Size: 2.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55961002c83b978a5de6b4e89a45c679a1b215b9bc596d579798ba8ff58e2149
|
|
| MD5 |
4e1f3b4898753b98192876bee956aa1a
|
|
| BLAKE2b-256 |
55ded1dba0f72d7ad58f13372ea1c2178ece093a856a3c15ad2bfd42d6c53e96
|
Provenance
The following attestation bundles were made for hotframe-1.1.0.tar.gz:
Publisher:
release.yml on hotframe/hotframe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hotframe-1.1.0.tar.gz -
Subject digest:
55961002c83b978a5de6b4e89a45c679a1b215b9bc596d579798ba8ff58e2149 - Sigstore transparency entry: 1575461455
- Sigstore integration time:
-
Permalink:
hotframe/hotframe@2299307d69a34c5af9caefbbf3dd7251021f27f5 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/hotframe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2299307d69a34c5af9caefbbf3dd7251021f27f5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file hotframe-1.1.0-py3-none-any.whl.
File metadata
- Download URL: hotframe-1.1.0-py3-none-any.whl
- Upload date:
- Size: 301.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
725e8176da66c3ce3d39b35b2ba8dd971a527ad7b4b14a32def02f7e7f00390a
|
|
| MD5 |
685a1c1eb888ffbf76ec891a798d0d9f
|
|
| BLAKE2b-256 |
b6e5e57320574a57fac0808073e44e7196ba72847551e30e49fb8659406852a6
|
Provenance
The following attestation bundles were made for hotframe-1.1.0-py3-none-any.whl:
Publisher:
release.yml on hotframe/hotframe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hotframe-1.1.0-py3-none-any.whl -
Subject digest:
725e8176da66c3ce3d39b35b2ba8dd971a527ad7b4b14a32def02f7e7f00390a - Sigstore transparency entry: 1575461468
- Sigstore integration time:
-
Permalink:
hotframe/hotframe@2299307d69a34c5af9caefbbf3dd7251021f27f5 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/hotframe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2299307d69a34c5af9caefbbf3dd7251021f27f5 -
Trigger Event:
push
-
Statement type: