Unifying frontend and backend into one Pythonic experience.
StreamJam allows developers to craft both the frontend and backend of web applications using just Python. Inspired by the reactivity of modern frameworks and the real-time capabilities of today's best tools, StreamJam offers a streamlined approach to web development.
Dive into our documentation or explore some sample projects to get started.
Here's a simple countdown timer using StreamJam:
from streamjam import pie
template = """
<div class="countdown-timer">
<h1>{title}</h1>
<p>Time left: {time_left} seconds</p>
<button onclick={start}>Start</button>
<button onclick={stop}>Stop</button>
</div>
"""
class Component:
title: pie[str] = "New Timer"
time_left: pie[int] = 10
interval = None
def start(self):
self.interval = setInterval(self.tick, 1000)
def tick(self):
if self.time_left > 0:
self.time_left -= 1
else:
self.stop()
def stop(self):
clearInterval(self.interval)
self.interval = None