{"id":31859497,"url":"https://github.com/python-ellar/py-htmlbuilder","last_synced_at":"2025-10-12T15:26:03.478Z","repository":{"id":249657175,"uuid":"832114602","full_name":"python-ellar/py-htmlbuilder","owner":"python-ellar","description":"Building Static HTML and CSS in python","archived":false,"fork":false,"pushed_at":"2024-11-01T15:42:14.000Z","size":2170,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-29T01:17:45.849Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/python-ellar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2024-07-22T11:38:32.000Z","updated_at":"2024-08-06T02:47:35.000Z","dependencies_parsed_at":"2024-07-28T08:06:12.494Z","dependency_job_id":"35c86c94-0c17-4cae-a15e-f2477eae1174","html_url":"https://github.com/python-ellar/py-htmlbuilder","commit_stats":null,"previous_names":["python-ellar/py-html","python-ellar/py-htmlbuilder"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/python-ellar/py-htmlbuilder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-ellar%2Fpy-htmlbuilder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-ellar%2Fpy-htmlbuilder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-ellar%2Fpy-htmlbuilder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-ellar%2Fpy-htmlbuilder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/python-ellar","download_url":"https://codeload.github.com/python-ellar/py-htmlbuilder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-ellar%2Fpy-htmlbuilder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279011851,"owners_count":26085004,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-10-12T15:26:00.325Z","updated_at":"2025-10-12T15:26:03.470Z","avatar_url":"https://github.com/python-ellar.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# py-HTMLBuilder\nBuilding Static HTML and CSS in Python\n\n## Introduction\nPyHTML is a library that compiles HTML syntax based on how py-HTML elements are combined. The compiled HTML is still static not JS interactions or Virtual DOM thingy.\nIt simply provides components that make building the HTML template faster. \n\nAlthough Jinja and Mako are in this space, I don't intend to substitute this library for such a package.\n\n**This is just an experiment.**\n\n## Installation\n```shell\npip install py-htmlbuilder\n```\n\n## Quick Bootstrap Example\n\n```python\nfrom py_html.el.base import render_component\nimport py_html.el as el\n\nfrom starlette.responses import HTMLResponse\n\nfrom ellar.common import ModuleRouter\n\nfrom ellar.app import AppFactory\nfrom ellar_cli.main import create_ellar_cli\n\n\nrouter = ModuleRouter(\"/example\")\n\n\n@router.get(\"/\", response=HTMLResponse)\ndef template():\n    content = el.html(\n        el.head(\n            el.title(\"Example HTML\"),\n            lambda ctx: el.link(href=ctx.get(\"bootstrap_css\", \"\"))\n        ),\n        el.body(class_name=\"container py-4\", *(\n            el.header(\n                class_name=\"pb-3 mb-4 border-bottom\",\n                *(\n                    el.a(href=\"/\", class_name=\"d-flex align-items-center text-dark text-decoration-none\", *(\n                        el.svg(width=40, height=32, class_name=\"me-2\", viewBox=\"0 0 118 94\", *(\n                            el.path(fill_rule=\"evenodd\", clip_rule=\"evenodd\", fill=\"currentColor\", d=(\n                                \"\"\"\n                                M24.509 0c-6.733 0-11.715 5.893-11.492 12.284.214 6.14-.064 14.092-2.066 20.577C8.943 \n                                39.365 5.547 43.485 0 44.014v5.972c5.547.529 8.943 4.649 10.951 11.153 2.002 6.485 2.28 \n                                14.437 2.066 20.577C12.794 88.106 17.776 94 24.51 94H93.5c6.733 0 11.714-5.893 \n                                11.491-12.284-.214-6.14.064-14.092 2.066-20.577 2.009-6.504 5.396-10.624 \n                                10.943-11.153v-5.972c-5.547-.529-8.934-4.649-10.943-11.153-2.002-6.484-2.28-14.437-2.066-20.577C105.214 \n                                5.894 100.233 0 93.5 0H24.508zM80 57.863C80 66.663 73.436 72 62.543 72H44a2 \n                                2 0 01-2-2V24a2 2 0 012-2h18.437c9.083 0 15.044 4.92 15.044 12.474 0 5.302-4.01 \n                                10.049-9.119 10.88v.277C75.317 46.394 80 51.21 80 57.863zM60.521 28.34H49.948v14.934h8.905c6.884 \n                                0 10.68-2.772 10.68-7.727 0-4.643-3.264-7.207-9.012-7.207zM49.948 49.2v16.458H60.91c7.167 \n                                0 10.964-2.876 10.964-8.281 0-5.406-3.903-8.178-11.425-8.178H49.948z\n                                \"\"\"\n                            )),\n                        )),\n                        el.span(\"Jumbotron example\", class_name=\"fs-4\")\n                    )),\n                )\n            ),\n            el.div(class_name=\"p-5 mb-4 bg-light rounded-3\", *(\n                el.div(class_name=\"container-fluid py-5\", *(\n                    el.h1(\"Custom jumbotron\", class_name=\"display-5 fw-bold\"),\n                    el.p(\"\"\"\n                            Using a series of utilities, you can create this jumbotron, just like the one in previous versions of Bootstrap.\n                             Check out the examples below for how you can remix and restyle it to your liking.\n                            \"\"\", class_name=\"col-md-8 fs-4\"\n                         ),\n                    el.button(\"Example button\", class_name=\"btn btn-primary btn-lg\", type=\"button\")\n                )),\n            )),\n            el.footer(\"© 2024\", class_name=\"pt-3 mt-4 text-muted border-top\")\n        ))\n    )\n\n    return render_component(content, {\n        \"bootstrap_css\":  \"https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css\",\n    })\n\n\ndef app_bootstrap():\n    application = AppFactory.create_app(routers=[router])\n    return application\n\n\ncli = create_ellar_cli(\"readme:app_bootstrap\")\n\nif __name__ == \"__main__\":\n    cli()\n```\nStart up command\n```shell\npython readme.py runserver --reload\n```\n\nVisit [http://127.0.0.1:8000/example/](http://127.0.0.1:8000/example/)\n\n![Swagger UI](docs/images/readme.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-ellar%2Fpy-htmlbuilder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpython-ellar%2Fpy-htmlbuilder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-ellar%2Fpy-htmlbuilder/lists"}