MCPcopy
hub / github.com/mesop-dev/mesop

github.com/mesop-dev/mesop @v1.3.2 sqlite

repository ↗ · DeepWiki ↗ · release v1.3.2 ↗
2,527 symbols 7,669 edges 650 files 366 documented · 14%
README

Mesop: Build delightful web apps quickly in Python 🚀

PyPI PyPI downloads Twitter follow

Used at Google for rapid internal app development

Mesop is a Python-based UI framework that allows you to rapidly build web apps like demos and internal apps:

Intuitive for UI novices ✨

  • Write UI in idiomatic Python code
  • Easy to understand reactive UI paradigm
  • Ready to use components

Frictionless developer workflows 🏎️

  • Hot reload so the browser automatically reloads and preserves state
  • Rich IDE support with strong type safety

Flexible for delightful demos 🤩

  • Build custom UIs without writing Javascript/CSS/HTML
  • Compose your UI into components, which are just Python functions

Write your first Mesop app in less than 10 lines of code...

Demo app

import mesop as me
import mesop.labs as mel


@me.page(path="/text_to_text", title="Text to Text Example")
def app():
  mel.text_to_text(
    upper_case_stream,
    title="Text to Text Example",
  )


def upper_case_stream(s: str):
  return "Echo: " + s.capitalize()

Try it

Colab

You can try Mesop on Colab!

Locally

Step 1: Install it

pip install mesop

Step 2: Copy the example above into main.py

Step 3: Run the app

mesop main.py

Learn more in Getting Started.

Reporting a security issue

If you identify a security vulnerability with Mesop, please file a GitHub security issue and we will promptly respond to it.

Disclaimer

This is not an officially supported Google product.

Extension points exported contracts — how you extend this code

BaseComponent (Interface)
(no doc) [39 implementers]
mesop/web/src/component_renderer/type_to_component.ts
TypeToComponent (Interface)
(no doc)
mesop/web/src/component_renderer/type_to_component.ts
StateDiff (Interface)
(no doc)
mesop/web/src/utils/diff.ts
SSEHeaders (Interface)
(no doc)
mesop/web/src/utils/sse.ts
SSEOptions (Interface)
(no doc)
mesop/web/src/utils/sse.ts

Core symbols most depended-on inside this repo

state
called by 435
mesop/runtime/context.py
all
called by 208
mesop/component_helpers/style.py
runtime
called by 117
mesop/runtime/runtime.py
set_theme_mode
called by 88
mesop/runtime/context.py
context
called by 80
mesop/runtime/runtime.py
createDefaultComponent
called by 57
mesop/web/src/utils/diff_component_spec.ts
symmetric
called by 49
mesop/component_helpers/style.py
dispatchEvent
called by 45
mesop/web/src/utils/sse.ts

Shape

Function 1,386
Method 628
Class 481
Route 23
Interface 8
Enum 1

Languages

Python72%
TypeScript28%

Modules by API surface

mesop/dataclass_utils/dataclass_utils_test.py70 symbols
mesop/runtime/context.py62 symbols
mesop/component_helpers/helper.py43 symbols
mesop/commands/cookie_class_test.py42 symbols
mesop/component_helpers/helper_test.py41 symbols
mesop/server/state_session.py36 symbols
mesop/web/src/services/channel.ts35 symbols
mesop/server/state_session_test.py32 symbols
demo/grid_table.py31 symbols
demo/fancy_chat.py31 symbols
demo/main.py29 symbols
mesop/examples/web_component/gemini_live/demo.py28 symbols

Dependencies from manifests, versioned

@angular-devkit/build-angular19.0.0 · 1×
@angular-devkit/core19.0.0 · 1×
@angular-devkit/schematics19.0.0 · 1×
@angular/animations19.0.0 · 1×
@angular/bazelhttps://github.com/a · 1×
@angular/build19.0.0 · 1×
@angular/build-toolinghttps://github.com/a · 1×
@angular/cdk19.0.0 · 1×
@angular/cli19.0.0 · 1×
@angular/common19.0.0 · 1×
@angular/compiler19.0.0 · 1×
@angular/compiler-cli19.0.0 · 1×

For agents

$ claude mcp add mesop \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact