datastar-py
Helper functions and classes for the Datastar library (https://data-star.dev/)
Decision gist · record as of 2026-08-14
Yes. Datastar-py is actively maintained, has no external dependencies, and provides a clean abstraction for SSE-based real-time communication across multiple popular frameworks. It's suitable for production use if you're building applications that need server-to-browser push updates. The MIT license imposes no restrictions.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Framework-specific helpers require installing one of the supported frameworks (Django, FastAPI, FastHTML, Litestar, Quart, Sanic, or Starlette).
- Low friction to install—pure Python wheel with no runtime dependencies.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use this package freely in commercial and private projects without restriction.
last release 2026-06-02 (73 days) · last repo commit 2026-07-23 · 172 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 170,208 downloads/mo, #10,402 on PyPI
Alternatives
Verify before relying
pip install datastar-py
from datastar_py import ServerSentEventGenerator as SSE, attribute_generator as data
# Generate SSE events
event = SSE.patch_elements("<div>update</div>")
signal_event = SSE.patch_signals({"mysignal": "myval"})
# Generate data attributes
attrs = data.on("click", "console.log('clicked')").debounce(1000).stop- Whether the package handles backpressure or connection limits for long-lived SSE streams.
- Performance characteristics when broadcasting to many concurrent clients.
- Whether signal state is persisted or only held in memory during a request.
What it is and what it does
Datastar-py is a Python SDK that enables real-time, bidirectional communication between backend applications and browsers via server-sent events. Instead of the traditional request-response cycle, a single HTTP request can trigger a stream of events from the backend to the browser, allowing the server to push updates at any time. The package provides low-level event generation primitives (patch_elements, patch_signals) that work with any framework, plus framework-specific decorators and response classes for Django, FastAPI, FastHTML, Litestar, Quart, Sanic, and Starlette.
The SDK handles three main concerns: generating SSE-formatted events, wrapping those events in framework-appropriate response objects, and reading signal state (frontend data) sent with each request. It also includes an attribute generator for building data-* HTML attributes with IDE completion and type checking. The package has no external runtime dependencies and supports Python 3.10 through 3.14.
Use it for
- Real-time dashboard updates: push live metrics or status changes to a browser without polling.
- Live form validation: send validation feedback to the browser as the user types, using signals to track state.
- Streaming data visualization: continuously update charts or tables with new data from a long-lived SSE connection.
- Collaborative editing: broadcast changes made by one user to all connected clients in real time.
- Progress tracking: stream progress updates from a long-running backend task to show live status.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Datastar-py is actively maintained, has no external dependencies, and provides a clean abstraction for SSE-based real-time communication across multiple popular frameworks. It's suitable for production use if you're building applications that need server-to-browser push updates. The MIT license imposes no restrictions.
Install
datastar-py on PyPI
Before you install
Low friction to install—pure Python wheel with no runtime dependencies. The package is actively maintained with a recent release (73 days ago) and has accumulated 172 stars on its repository.
Requires Python 3.10 or later. Framework-specific helpers require installing one of the supported frameworks (Django, FastAPI, FastHTML, Litestar, Quart, Sanic, or Starlette).
License in practice
MIT license is permissive; you can use this package freely in commercial and private projects without restriction.
Quickstart
pip install datastar-py
from datastar_py import ServerSentEventGenerator as SSE, attribute_generator as data
# Generate SSE events
event = SSE.patch_elements("<div>update</div>")
signal_event = SSE.patch_signals({"mysignal": "myval"})
# Generate data attributes
attrs = data.on("click", "console.log('clicked')").debounce(1000).stop
Verify before relying
- Whether the package handles backpressure or connection limits for long-lived SSE streams.
- Performance characteristics when broadcasting to many concurrent clients.
- Whether signal state is persisted or only held in memory during a request.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 73 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 170,208 / month, #10,402 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaEnvironment :: Web EnvironmentIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14 |
Evidence: datastar_py-1.0.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “real-time backend updates”
- datastar-pyDatastar-py provides a Python SDK for building server-sent event…
- convexPython client for Convex, a backend-as-a-service platform, enabling…
- supabasePython client library for Supabase that provides unified access to…
Give your agent the search over MCP, or paste the wish link into any chat.
More Dynamic Content packages
MarkupSafe provides a text object that escapes special characters so untrusted strings can be safely embedded in HTML and XML without injection attacks.
Jinja2 is a templating engine that renders dynamic content by combining templates with Python-like syntax and data, supporting template inheritance, macros, autoescaping, and sandboxed execution.
Soupsieve is a CSS selector library designed to work with Beautiful Soup 4 to select, match, and filter HTML and XML elements using modern CSS selectors from CSS level 1 through CSS level 4 specifications.
Install it if you use Beautiful Soup for HTML or XML parsing and want modern CSS selector support.
Werkzeug is a WSGI utility library providing request/response objects, URL routing, an interactive debugger, HTTP utilities, and a development server for building web applications.
Flask is a lightweight WSGI web application framework for building web applications in Python, from simple single-page sites to complex multi-route applications.
Mako compiles Python-embedded templates into Python modules for fast rendering, supporting layout inheritance, custom functions, and direct Python expressions within template syntax.
See also sse-starlette · sseclient-py · httpx-sse · requests-sse · filigran-sseclient · launchdarkly-eventsource · sseclient · aiohttp-sse-client · aiohttp-sse-client2