What is Lent? And When Does Lent Start?

solara.InputText(label="New todo", value=text, on_value_change=text.set) solara.Button("Add", on_click=add_todo) @solara.component def TodoList(): def toggle(index): new_todos = todos.value.copy() new_todos[index]["done"] = not new_todos[index]["done"] todos.value = new_todos

Here’s an informative overview of on GitHub. What is Solara? Solara is a pure Python, React-style web framework for building scalable and interactive web apps, specifically designed for data scientists and Python developers. It is built on top of React and FastAPI , but you don't need to know any JavaScript or HTML to use it.

def add_todo(): if text.value.strip(): todos.value = todos.value + ["text": text.value, "done": False] text.value = ""

No HTML, no JS, no callbacks – just Python. User's Browser │ ▼ React.js (runtime) ←────── WebSocket/HTTP │ │ ▼ ▼ Solara Python Components ←→ FastAPI Server │ ▼ ipywidgets & Reactive State Solara renders components on the server, manages reactive state, and syncs UI updates to the browser via WebSockets. Who Is Behind Solara? Solara is developed by Widgetti , the same company behind ipywidgets and Jupyter Widgets ecosystem. This means Solara benefits from deep integration with Jupyter and production-grade stability. Comparison with Other Python UI Frameworks | Framework | Syntax | React-style Hooks | Jupyter Support | Scalability | |-----------|--------|------------------|----------------|--------------| | Solara | Python | ✅ Yes | ✅ Native | High | | Streamlit | Python | ❌ (script rerun) | Limited | Medium | | Dash | Python/HTML | ❌ (callbacks) | ❌ | High | | Shiny for Python | Python | ❌ (reactive calc) | ✅ | Medium | | Gradio | Python | ❌ | ✅ (notebook) | Low | Getting Started Installation pip install solara Create a simple app Save as app.py :

@solara.component def TodoInput(): text = solara.reactive("")

import solara @solara.component def Page(): with solara.Column(): solara.Markdown("# Hello Solara") solara.Success("It works!") Run the app solara run app.py Open http://localhost:8765 Advanced Example: Todo App import solara todos = solara.reactive([])

solara.Button(label=f"Clicked count.value times", on_click=increment)

@solara.component def Counter(): def increment(): count.value += 1

Becca Stanley

Words by Becca Stanley


SHARE:

Twitter Facebook

More stories for you

Homepage Banner

Join thousands of people praying to end poverty, take action through our appeals and activities, and be inspired by how God is changing lives.

Get a little Compassion in your inbox with our Prayer and Stories email.

Remember, you can unsubscribe at any time. Please see our Privacy Policy for more information.

Compassion UK Christian Child Development, registered charity in England and Wales (1077216) and Scotland (SC045059). A company limited by guarantee, Registered in England and Wales company number 03719092. Registered address: Compassion House, Barley Way, Fleet, Hampshire, GU51 2UT.