|
1 |
| -Disclaimer: _This is not an officially supported Google product._ |
| 1 | +# Mesop: Build delightful web apps quickly in Python 🚀 |
2 | 2 |
|
3 |
| -# Mesop |
| 3 | +### Used at Google for rapid internal app development |
4 | 4 |
|
5 |
| -Mesop is a Python-based UI framework that allows you to rapidly build web demos. Engineers without frontend experience can build web UIs by writing idiomatic Python code. |
| 5 | +Mesop is a Python-based UI framework that allows you to rapidly build web apps like demos and internal apps: |
6 | 6 |
|
7 |
| -## Status |
| 7 | +**Intuitive for UI novices ✨** |
8 | 8 |
|
9 |
| -Note: Mesop is under development. |
| 9 | +- Write UI in idiomatic Python code |
| 10 | +- Easy to understand reactive UI paradigm |
| 11 | +- Ready to use components |
| 12 | + |
| 13 | +**Frictionless developer workflows 🏎️** |
| 14 | + |
| 15 | +- Hot reload so the browser automatically reloads and preserves state |
| 16 | +- Edit your UI code directly in the browser using the visual editor |
| 17 | + |
| 18 | +**Flexible for delightful demos 🤩** |
| 19 | + |
| 20 | +- Build custom UIs _without_ writing Javascript/CSS/HTML |
| 21 | +- Compose your UI into components, which are just Python functions |
| 22 | + |
| 23 | +**Edit your UI directly in the browser using the Visual Editor 🪄** |
| 24 | + |
| 25 | +[](https://www.youtube.com/watch?v=tvbO-Lqq_TA) |
| 26 | + |
| 27 | +## Write your first Mesop app in less than 10 lines of code... |
| 28 | + |
| 29 | +[Demo app](https://mesop-y677hytkra-uc.a.run.app/text_io) |
| 30 | + |
| 31 | +```python |
| 32 | +import time |
| 33 | + |
| 34 | +import mesop as me |
| 35 | +import mesop.labs as mel |
| 36 | + |
| 37 | + |
| 38 | +@me.page(path="/text_io", title="Text I/O Example") |
| 39 | +def app(): |
| 40 | + mel.text_io( |
| 41 | + upper_case_stream, |
| 42 | + title="Text I/O Example", |
| 43 | + ) |
| 44 | + |
| 45 | + |
| 46 | +def upper_case_stream(s: str): |
| 47 | + yield s.capitalize() |
| 48 | + time.sleep(0.5) |
| 49 | + yield s.capitalize() + "foo" |
| 50 | +``` |
| 51 | + |
| 52 | +</div> |
| 53 | + |
| 54 | +## Try it |
| 55 | + |
| 56 | +**Step 1:** Install it |
| 57 | + |
| 58 | +```sh |
| 59 | +$ pip install mesop |
| 60 | +``` |
| 61 | + |
| 62 | +**Step 2:** Copy the example above into `main.py` |
| 63 | + |
| 64 | +**Step 3:** Run the app |
| 65 | + |
| 66 | +```sh |
| 67 | +$ mesop main.py |
| 68 | +``` |
| 69 | + |
| 70 | +Learn more in [Getting Started](./getting_started.md). |
| 71 | + |
| 72 | +## Disclaimer |
| 73 | + |
| 74 | +_This is not an officially supported Google product._ |
0 commit comments