# routelit
[](https://img.shields.io/github/v/release/routelit/routelit)
[](https://github.com/routelit/routelit/actions/workflows/main.yml?query=branch%3Amain)
[](https://codecov.io/gh/routelit/routelit)
[](https://img.shields.io/github/commit-activity/m/routelit/routelit)
[](https://img.shields.io/github/license/routelit/routelit)

**routelit** is a Python framework for building interactive web user interfaces that are framework-agnostic and easy to use. It allows you to create dynamic web applications with a simple, declarative API similar to Streamlit, but designed to work with any HTTP framework (Flask, FastAPI, Django, etc.).
## β¨ Features
- **Framework Agnostic**: Works with any Python web framework (Flask, FastAPI, Django, etc.)
- **Declarative UI**: Build interfaces using simple Python functions
- **Interactive Components**: Buttons, forms, inputs, selects, checkboxes, and more
- **State Management**: Built-in session state management
- **Reactive Updates**: Automatic UI updates based on user interactions
- **Fragment Support**: Partial page updates for better performance
- **Flexible Layouts**: Containers, columns, flex layouts, and expandable sections
- **Rich Content**: Support for markdown, images, and custom styling
## π Installation
Install routelit using pip:
```bash
pip install routelit
```
## π Quick Start
Here's a simple example of how to use routelit:
```python
from routelit import RouteLit, RouteLitBuilder
# Create a RouteLit instance
rl = RouteLit()
def my_app(builder: RouteLitBuilder):
builder.title("Welcome to RouteLit!")
name = builder.text_input("Enter your name:", value="World")
if builder.button("Say Hello"):
builder.text(f"Hello, {name}!")
builder.markdown("This is a **markdown** text with *emphasis*.")
# Use with your preferred web framework
# Example with Flask:
from flask import Flask, request
app = Flask(__name__)
flask_adapter = ... # TODO: publish package for this
@app.route("/", methods=["GET", "POST"])
def index():
# Return HTML response
return flask_adapter.response(my_app)
```
## ποΈ Core Concepts
### Builder Pattern
RouteLit uses a builder pattern where you define your UI using a `RouteLitBuilder` instance:
```python
def my_view(builder: RouteLitBuilder):
builder.header("My Application")
with builder.container():
builder.text("This is inside a container")
col1, col2 = builder.columns(2)
with col1:
builder.text("Left column")
with col2:
builder.text("Right column")
```
### State Management
RouteLit automatically manages state between requests:
```python
def counter_app(builder: RouteLitBuilder):
# Get current count from session state
count = builder.session_state.get("count", 0)
builder.text(f"Count: {count}")
if builder.button("Increment"):
builder.session_state["count"] = count + 1
builder.rerun() # Trigger a re-render
```
### Interactive Components
Build rich forms and interactive elements:
```python
def form_example(builder: RouteLitBuilder):
with builder.form("my_form"):
name = builder.text_input("Name")
age = builder.text_input("Age", type="number")
options = ["Option 1", "Option 2", "Option 3"]
choice = builder.select("Choose an option", options)
newsletter = builder.checkbox("Subscribe to newsletter")
if builder.button("Submit", event_name="submit"):
builder.text(f"Hello {name}, you are {age} years old!")
if newsletter:
builder.text("Thanks for subscribing!")
```
## π§ Framework Integration
RouteLit is designed to work with any Python web framework.
TODO: Add framework integration examples.
## π Documentation
- **Github repository**: <https://github.com/routelit/routelit/>
- **Documentation**: <https://routelit.github.io/routelit/>
## π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
## π License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## π Acknowledgments
RouteLit is inspired by [Streamlit](https://streamlit.io/) but designed to be framework-agnostic and more flexible for web development use cases.
---
Repository initiated with [fpgmaas/cookiecutter-uv](https://github.com/fpgmaas/cookiecutter-uv).
Raw data
{
"_id": null,
"home_page": null,
"name": "routelit",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": "data analysis, data science, fastapi, flask, gradio, machine learning, numpy, pandas, python, shiny, streamlit",
"author": null,
"author_email": "Rolando G\u00f3mez Tabar <rolangom@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/c9/76/93b093a35792cdea8c0570bead431ab7ce3af2dc487eecae611c3a0f7bac/routelit-0.5.8.tar.gz",
"platform": null,
"description": "# routelit\n\n[](https://img.shields.io/github/v/release/routelit/routelit)\n[](https://github.com/routelit/routelit/actions/workflows/main.yml?query=branch%3Amain)\n[](https://codecov.io/gh/routelit/routelit)\n[](https://img.shields.io/github/commit-activity/m/routelit/routelit)\n[](https://img.shields.io/github/license/routelit/routelit)\n\n\n\n**routelit** is a Python framework for building interactive web user interfaces that are framework-agnostic and easy to use. It allows you to create dynamic web applications with a simple, declarative API similar to Streamlit, but designed to work with any HTTP framework (Flask, FastAPI, Django, etc.).\n\n## \u2728 Features\n\n- **Framework Agnostic**: Works with any Python web framework (Flask, FastAPI, Django, etc.)\n- **Declarative UI**: Build interfaces using simple Python functions\n- **Interactive Components**: Buttons, forms, inputs, selects, checkboxes, and more\n- **State Management**: Built-in session state management\n- **Reactive Updates**: Automatic UI updates based on user interactions\n- **Fragment Support**: Partial page updates for better performance\n- **Flexible Layouts**: Containers, columns, flex layouts, and expandable sections\n- **Rich Content**: Support for markdown, images, and custom styling\n\n## \ud83d\ude80 Installation\n\nInstall routelit using pip:\n\n```bash\npip install routelit\n```\n\n## \ud83d\udcd6 Quick Start\n\nHere's a simple example of how to use routelit:\n\n```python\nfrom routelit import RouteLit, RouteLitBuilder\n\n# Create a RouteLit instance\nrl = RouteLit()\n\ndef my_app(builder: RouteLitBuilder):\n builder.title(\"Welcome to RouteLit!\")\n\n name = builder.text_input(\"Enter your name:\", value=\"World\")\n\n if builder.button(\"Say Hello\"):\n builder.text(f\"Hello, {name}!\")\n\n builder.markdown(\"This is a **markdown** text with *emphasis*.\")\n\n# Use with your preferred web framework\n# Example with Flask:\nfrom flask import Flask, request\n\napp = Flask(__name__)\n\nflask_adapter = ... # TODO: publish package for this\n\n@app.route(\"/\", methods=[\"GET\", \"POST\"])\ndef index():\n\n # Return HTML response\n return flask_adapter.response(my_app)\n```\n\n## \ud83c\udfd7\ufe0f Core Concepts\n\n### Builder Pattern\nRouteLit uses a builder pattern where you define your UI using a `RouteLitBuilder` instance:\n\n```python\ndef my_view(builder: RouteLitBuilder):\n builder.header(\"My Application\")\n\n with builder.container():\n builder.text(\"This is inside a container\")\n\n col1, col2 = builder.columns(2)\n with col1:\n builder.text(\"Left column\")\n with col2:\n builder.text(\"Right column\")\n```\n\n### State Management\nRouteLit automatically manages state between requests:\n\n```python\ndef counter_app(builder: RouteLitBuilder):\n # Get current count from session state\n count = builder.session_state.get(\"count\", 0)\n\n builder.text(f\"Count: {count}\")\n\n if builder.button(\"Increment\"):\n builder.session_state[\"count\"] = count + 1\n builder.rerun() # Trigger a re-render\n```\n\n### Interactive Components\nBuild rich forms and interactive elements:\n\n```python\ndef form_example(builder: RouteLitBuilder):\n with builder.form(\"my_form\"):\n name = builder.text_input(\"Name\")\n age = builder.text_input(\"Age\", type=\"number\")\n\n options = [\"Option 1\", \"Option 2\", \"Option 3\"]\n choice = builder.select(\"Choose an option\", options)\n\n newsletter = builder.checkbox(\"Subscribe to newsletter\")\n\n if builder.button(\"Submit\", event_name=\"submit\"):\n builder.text(f\"Hello {name}, you are {age} years old!\")\n if newsletter:\n builder.text(\"Thanks for subscribing!\")\n```\n\n## \ud83d\udd27 Framework Integration\n\nRouteLit is designed to work with any Python web framework.\nTODO: Add framework integration examples.\n\n## \ud83d\udcda Documentation\n\n- **Github repository**: <https://github.com/routelit/routelit/>\n- **Documentation**: <https://routelit.github.io/routelit/>\n\n## \ud83e\udd1d Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.\n\n## \ud83d\udcc4 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## \ud83d\ude4f Acknowledgments\n\nRouteLit is inspired by [Streamlit](https://streamlit.io/) but designed to be framework-agnostic and more flexible for web development use cases.\n\n---\n\nRepository initiated with [fpgmaas/cookiecutter-uv](https://github.com/fpgmaas/cookiecutter-uv).\n",
"bugtrack_url": null,
"license": null,
"summary": "Project to build easy user interfaces, agnostic for http frameworks",
"version": "0.5.8",
"project_urls": {
"Documentation": "https://routelit.github.io/routelit/",
"Homepage": "https://routelit.github.io/routelit/",
"Repository": "https://github.com/routelit/routelit"
},
"split_keywords": [
"data analysis",
" data science",
" fastapi",
" flask",
" gradio",
" machine learning",
" numpy",
" pandas",
" python",
" shiny",
" streamlit"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "9d7af4c6a3dd477778b78ed475f9e866850b3cc38566008a96b59d343f985952",
"md5": "8be3a7f73f1ba9f1184a9356a0c41d3a",
"sha256": "9cee251d6cc67959b09d65cf25dd389b57c346d75d54d9368d62f20717a4670b"
},
"downloads": -1,
"filename": "routelit-0.5.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8be3a7f73f1ba9f1184a9356a0c41d3a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 36194,
"upload_time": "2025-08-20T01:32:07",
"upload_time_iso_8601": "2025-08-20T01:32:07.488662Z",
"url": "https://files.pythonhosted.org/packages/9d/7a/f4c6a3dd477778b78ed475f9e866850b3cc38566008a96b59d343f985952/routelit-0.5.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "c97693b093a35792cdea8c0570bead431ab7ce3af2dc487eecae611c3a0f7bac",
"md5": "23e50e94d00a00d8f38741cbf32cb36f",
"sha256": "5966201dd8fdaf53d8edfda4b443e6258162fd90434b1c119821b9a706778f3b"
},
"downloads": -1,
"filename": "routelit-0.5.8.tar.gz",
"has_sig": false,
"md5_digest": "23e50e94d00a00d8f38741cbf32cb36f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 119359,
"upload_time": "2025-08-20T01:32:08",
"upload_time_iso_8601": "2025-08-20T01:32:08.913178Z",
"url": "https://files.pythonhosted.org/packages/c9/76/93b093a35792cdea8c0570bead431ab7ce3af2dc487eecae611c3a0f7bac/routelit-0.5.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-20 01:32:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "routelit",
"github_project": "routelit",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "routelit"
}