# 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/25/dc/c467414f636cfcd4bba3fbac3f867cfa452fdf421bde747d365e79962e1d/routelit-0.4.6.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.4.6",
"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": "538e5d974bcb9de04334782cfda28f929226c2230b122daa6f90d1e5e2d09673",
"md5": "aede5f8442b66cfd13e9448a1e862eb8",
"sha256": "8c63ff5d1fd9f328ab6db294d70f2b416c575b0b60e792f16f90977a933524fc"
},
"downloads": -1,
"filename": "routelit-0.4.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "aede5f8442b66cfd13e9448a1e862eb8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 31768,
"upload_time": "2025-07-21T22:33:04",
"upload_time_iso_8601": "2025-07-21T22:33:04.573961Z",
"url": "https://files.pythonhosted.org/packages/53/8e/5d974bcb9de04334782cfda28f929226c2230b122daa6f90d1e5e2d09673/routelit-0.4.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "25dcc467414f636cfcd4bba3fbac3f867cfa452fdf421bde747d365e79962e1d",
"md5": "860668637aff1d4a1c4223de9d76342c",
"sha256": "11263248ddfe6cd05bd9f518add6a3c8a1615d9e86f84fdbc7aaca1dc05dabcd"
},
"downloads": -1,
"filename": "routelit-0.4.6.tar.gz",
"has_sig": false,
"md5_digest": "860668637aff1d4a1c4223de9d76342c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 12602387,
"upload_time": "2025-07-21T22:33:06",
"upload_time_iso_8601": "2025-07-21T22:33:06.228457Z",
"url": "https://files.pythonhosted.org/packages/25/dc/c467414f636cfcd4bba3fbac3f867cfa452fdf421bde747d365e79962e1d/routelit-0.4.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-21 22:33:06",
"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"
}