Pulse Python
Core Python framework for building full-stack reactive web apps with React frontends.
Architecture
Server-driven UI model: Python components render to VDOM, synced to React via WebSocket. State changes trigger re-renders; diffs are sent to client.
┌─────────────────────────────────────────────────────────────────┐
│ Python Server │
│ ┌──────────┐ ┌───────────────┐ ┌──────────────────────────┐ │
│ │ App │──│ RenderSession │──│ VDOM Renderer │ │
│ │ (FastAPI)│ │ (per browser) │ │ (diff & serialize) │ │
│ └──────────┘ └───────────────┘ └──────────────────────────┘ │
│ │ │ │ │
│ │ ┌──────┴───────┐ │ │
│ │ │ Hooks │ │ │
│ │ │ (state/setup)│ │ │
│ │ └──────────────┘ │ │
└───────┼───────────────────────────────────────┼─────────────────┘
│ Socket.IO │ VDOM updates
▼ ▼
┌─────────────────────────────────────────────────────────────────┐
│ Browser (React) │
└─────────────────────────────────────────────────────────────────┘
Folder Structure
src/pulse/
├── app.py # Main App class, FastAPI + Socket.IO setup
├── channel.py # Bidirectional real-time channels
├── routing.py # Route/Layout definitions, URL matching
├── vdom.py # VDOM node types (Element, Component, Node)
├── renderer.py # VDOM rendering and diffing
├── render_session.py # Per-browser session, manages mounted routes
├── reactive.py # Signal/Computed/Effect primitives
├── reactive_extensions.py # ReactiveList, ReactiveDict, ReactiveSet
├── state.py # State management
├── serializer.py # Python<->JSON serialization
├── middleware.py # Request middleware (prerender, connect, message)
├── plugin.py # Plugin interface for extensions
├── form.py # Form handling
├── context.py # PulseContext (request/session context)
├── cookies.py # Cookie management
├── request.py # PulseRequest abstraction
├── user_session.py # User session storage
├── helpers.py # Utilities (CSSProperties, later, repeat)
├── decorators.py # @computed, @effect decorators
├── messages.py # Client<->server message types
├── react_component.py # ReactComponent wrapper for JS libraries
│
├── hooks/ # Server-side hooks (like React hooks)
│ ├── core.py # Hook registry, HooksAPI
│ ├── runtime.py # session(), route(), navigate(), redirect()
│ ├── states.py # Reactive state hook
│ ├── effects.py # Side effects hook
│ ├── setup.py # Initialization hook
│ ├── init.py # One-time setup hook
│ └── stable.py # Memoization hook
│
├── queries/ # Data fetching (like TanStack Query)
│ ├── query.py # @query decorator
│ ├── mutation.py # @mutation decorator
│ ├── infinite_query.py # Pagination support
│ ├── client.py # QueryClient for cache management
│ └── store.py # Query state store
│
├── components/ # Built-in components
│ ├── for_.py # <For> loop component
│ ├── if_.py # <If> conditional component
│ └── react_router.py # Link, Outlet for routing
│
├── html/ # HTML element bindings
│ ├── tags.py # div, span, button, etc.
│ ├── props.py # Typed props for HTML elements
│ ├── events.py # Event types (MouseEvent, etc.)
│ └── elements.py # Element type definitions
│
├── transpiler/ # Python->JS transpilation
│ ├── function.py # JsFunction, @javascript decorator
│ └── imports.py # Import/CssImport for client-side JS
│
├── codegen/ # Code generation for React Router
│ ├── codegen.py # Generates routes.ts, loaders
│ └── templates/ # Mako templates for generated code
│
├── cli/ # Command-line interface
│ ├── cmd.py # pulse run, pulse build
│ ├── lock.py # Web-root lock state and helpers
│ └── processes.py # Dev server process management
│
└── js/ # JS API stubs for transpilation
├── window.py, document.py, navigator.py
├── array.py, object.py, string.py
└── ...
Key Concepts
App
Entry point defining routes, middleware, plugins.
import pulse as ps
app = ps.App(routes=[
ps.Route("/", home),
ps.Layout("/dashboard", layout, children=[
ps.Route("/", dashboard),
]),
])
Components
Functions returning VDOM. Use @ps.component for stateful components.
def greeting(name: str):
return ps.div(f"Hello, {name}!")
@ps.component
def counter():
count = ps.states.use(0)
return ps.button(f"Count: {count()}", onClick=lambda _: count.set(count() + 1))
Reactivity
Signal[T]- reactive valueComputed[T]- derived valueEffect- side effect on change
Hooks
Server-side hooks via ps.state, ps.effect, ps.setup:
ps.state(StateClass)- reactive state (auto-keyed by callsite; usekey=for manual control)@ps.effect- side effects decoratorps.setup(fn)- one-time initialization
Queries
Data fetching with caching:
@ps.query
async def fetch_user(id: str):
return await db.get_user(id)
Channels
Bidirectional real-time messaging:
ch = ps.channel("chat")
@ch.on("message")
def handle_message(data):
ch.broadcast("new_message", data)
Main Exports
App,FastAPIConfig,Route,Layout- app/routingcomponent- server-side component decoratorstates,effects,setup,init- hooksquery,mutation,infinite_query- data fetchingchannel- real-time channelsState,@computed,@effect- reactivityReactiveList,ReactiveDict,ReactiveSet- reactive containersdiv,span,button, ... - HTML elementsFor,If,Link,Outlet- built-in components@react_component- wrap JS components@javascript- transpile Python to JS
Metadata
Release files for pulse-framework 0.1.111
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 | Actions |
|---|---|---|---|---|
| pulse_framework-0.1.111.tar.gz | 283.9 kB | Without provenance | Details for pulse_framework-0.1.111.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pulse_framework-0.1.111-py3-none-any.whl | Python 3 | none | any | Details for pulse_framework-0.1.111-py3-none-any.whl |
Total release size: 631.7 kB
Release files / pulse_framework-0.1.111.tar.gz
| Download URL | pulse_framework-0.1.111.tar.gz |
|---|---|
| Size | 283.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
784f380bf43bbd62e4934ae5a45277e6b2582052094964bbd295708f89eda6a8
|
|
BLAKE2b-256 checksum How to use checksums |
059d833f81c454dfaf5d74a9cc7d3f41c1872d5bac475da215a2d7aae866956a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / pulse_framework-0.1.111-py3-none-any.whl
| Download URL | pulse_framework-0.1.111-py3-none-any.whl |
|---|---|
| Size | 347.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
83d137c33e54080e0ed92a204e23af5dd7444d1b7843bedbc36651ca4b4b6527
|
|
BLAKE2b-256 checksum How to use checksums |
018152e81c3f57398373baf1fb2d31b1f9c7e1acdd3ca4c3e13011d4c7743d61
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for pulse-framework 0.1.111
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.