{"id":15288704,"url":"https://github.com/nikirg/lazyfast","last_synced_at":"2026-03-10T10:32:10.221Z","repository":{"id":242023590,"uuid":"789063609","full_name":"nikirg/lazyfast","owner":"nikirg","description":"LazyFast is a lightweight Python library designed for building modern web interfaces using a component-based approach. It enables writing page logic on the server side in Python, integrating seamlessly with FastAPI.","archived":false,"fork":false,"pushed_at":"2026-01-26T23:32:52.000Z","size":1447,"stargazers_count":34,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-02-17T19:43:39.276Z","etag":null,"topics":["fastapi","fullstack","html","htmx","python","web","webinterface"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nikirg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["nikirg"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2024-04-19T16:29:01.000Z","updated_at":"2025-12-06T08:11:57.000Z","dependencies_parsed_at":"2024-07-08T16:18:56.142Z","dependency_job_id":"02d964cd-0270-4c82-a083-9a8c0f37574b","html_url":"https://github.com/nikirg/lazyfast","commit_stats":{"total_commits":87,"total_committers":3,"mean_commits":29.0,"dds":0.06896551724137934,"last_synced_commit":"94eab999c1a29e4bfb80e29affd1e03fa5edbb6d"},"previous_names":["nikirg/renderable","nikirg/lazyfast"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nikirg/lazyfast","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikirg%2Flazyfast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikirg%2Flazyfast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikirg%2Flazyfast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikirg%2Flazyfast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikirg","download_url":"https://codeload.github.com/nikirg/lazyfast/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikirg%2Flazyfast/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30330576,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T05:25:20.737Z","status":"ssl_error","status_checked_at":"2026-03-10T05:25:17.430Z","response_time":106,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fastapi","fullstack","html","htmx","python","web","webinterface"],"created_at":"2024-09-30T15:52:23.722Z","updated_at":"2026-03-10T10:32:10.183Z","avatar_url":"https://github.com/nikirg.png","language":"Python","funding_links":["https://github.com/sponsors/nikirg"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/nikirg/lazyfast/refs/heads/main/img/logo.png\" alt=\"LazyFast\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/nikirg/lazyfast/refs/heads/main/img/title.png\" alt=\"LazyFast\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"PyPI - Version\" src=\"https://img.shields.io/pypi/v/lazyfast\"\u003e\n  \u003cimg alt=\"PyPI - Python Version\" src=\"https://img.shields.io/pypi/pyversions/lazyfast\"\u003e\n  \u003cimg alt=\"PyPI - Downloads\" src=\"https://img.shields.io/pypi/dm/lazyfast\"\u003e\n\u003c/p\u003e\n\n**LazyFast** is a lightweight Python library for building modern, component-based web interfaces using FastAPI. It handles server-side logic in Python, with interactive elements like inputs and buttons triggering server-side component reloads for dynamic state updates.\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/nikirg/lazyfast/blob/main/DOCS.md\"\u003eDocumentation\u003c/a\u003e\n/\n\u003ca href=\"https://github.com/nikirg/lazyfast/tree/main/examples\"\u003eExamples\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n   \u003cimg src=\"img/todo_list.gif\" alt=\"todo_list\" width=\"49%\" style=\"display:inline-block;\"\u003e\n   \u003cimg src=\"img/live_search.gif\" alt=\"live_search\" width=\"49%\" style=\"display:inline-block;\"\u003e\n\u003c/p\u003e\n\n**Ideal for Python developers who:**\n- Have basic HTML and CSS knowledge and want to build web interfaces without learning complex frontend frameworks like React, Angular, or Vue.\n\n**Suitable for projects that:**\n- Have low to medium traffic and can benefit from server-side rendering to offload work from the client's machine. *(Note: High traffic may increase server costs due to backend load.)*\n- Require quick prototyping and demos without involving frontend developers. LazyFast offers more flexibility than tools like Streamlit, which can be limiting and produce similar-looking applications.\n\n\u003cp align=\"center\"\u003e\n   \u003cimg src=\"img/user_form.gif\" alt=\"todo_list\" width=\"60%\" style=\"display:inline-block;\"\u003e\n\u003c/p\u003e\n\n**Key Features**\n\n1. **Component-Based Server Rendering**\n   - Build interfaces with lazy-loaded components that encapsulate logic, state, and presentation.\n2. **Server-Side Logic**\n   - Manage interactions and state on the server, reducing client-side complexity.\n3. **FastAPI Integration**\n   - Components and pages are FastAPI endpoints, supporting dependency injection and other features.\n4. **Lightweight**\n   - Dependencies: FastAPI for Python and HTMX for JavaScript (included via CDN).\n5. **State Management**\n   - Use a state manager to trigger component reloads for a reactive user experience.\n\n\n## Installation\n\nTo install LazyFast, use pip:\n\n```bash\npip install lazyfast\n```\nor\n```bash\npoetry add lazyfast\n```\n\n## Quick Start\n\nHere's an example application to demonstrate how LazyFast works:\n\n```python\nfrom fastapi import FastAPI, Request\nfrom lazyfast import LazyFastRouter, Component, tags\n\n\n# LazyFastRouter inherits from FastAPI's APIRouter\nrouter = LazyFastRouter()\n\n# Define a lazy-loaded HTML component powered by HTMX\n@router.component()\nclass MyComponent(Component):\n    title: str\n\n    async def view(self, request: Request) -\u003e None:\n        tags.h1(self.title, class_=\"my-class\")\n\n        with tags.div(style=\"border: 1px solid black\"):\n            tags.span(request.headers)\n\n# Initialize the page dependencies for component rendering\n# The page endpoint is also a FastAPI endpoint\n@router.page(\"/{name}\")\ndef root(name: str):\n    with tags.div(class_=\"container mt-6\"):\n        MyComponent(title=f\"Hello, World from {name}\")\n\n# Embed the router in a FastAPI app\napp = FastAPI()\napp.include_router(router)\n```\nIf you use `uvicorn` instead as a server and want to reload on changes, use the following command:\n```bash\nuvicorn app:app --reload --timeout-graceful-shutdown 1\n```\n\n## License\n\nLazyFast is licensed under the [MIT License](https://github.com/nikirg/lazyfast/blob/main/LICENSE).\n\n\n## Roadmap\n1. Cache system for HTML tags\n2. Component templates with popular CSS frameworks (Bootstrap, Bulma, etc.)\n3. Advanced state management\n4. Closer integration with HTMX\n5. ...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikirg%2Flazyfast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikirg%2Flazyfast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikirg%2Flazyfast/lists"}