{"id":21822858,"url":"https://github.com/micheltlutz/winged-python","last_synced_at":"2025-04-14T03:53:05.706Z","repository":{"id":211241465,"uuid":"720507095","full_name":"micheltlutz/Winged-Python","owner":"micheltlutz","description":"Python HTML Made Simple and Powerful","archived":false,"fork":false,"pushed_at":"2024-01-25T11:54:54.000Z","size":103,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T17:51:57.558Z","etag":null,"topics":["dsl","framework","html","html-generator-python","library","modular","python"],"latest_commit_sha":null,"homepage":"https://linktr.ee/micheltlutz","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/micheltlutz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":"micheltlutz"}},"created_at":"2023-11-18T17:40:48.000Z","updated_at":"2023-12-07T22:13:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"455c89b3-d3c1-476b-af1d-afa73a872631","html_url":"https://github.com/micheltlutz/Winged-Python","commit_stats":{"total_commits":28,"total_committers":1,"mean_commits":28.0,"dds":0.0,"last_synced_commit":"a560aa9c4588a1b2e487e1595556935c59f4af1b"},"previous_names":["micheltlutz/winged-python"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micheltlutz%2FWinged-Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micheltlutz%2FWinged-Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micheltlutz%2FWinged-Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micheltlutz%2FWinged-Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/micheltlutz","download_url":"https://codeload.github.com/micheltlutz/Winged-Python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248819363,"owners_count":21166474,"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","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":["dsl","framework","html","html-generator-python","library","modular","python"],"created_at":"2024-11-27T17:18:11.336Z","updated_at":"2025-04-14T03:53:05.685Z","avatar_url":"https://github.com/micheltlutz.png","language":"Python","funding_links":["https://github.com/sponsors/micheltlutz"],"categories":[],"sub_categories":[],"readme":"# Winged-Python\n\n![main](https://github.com/micheltlutz/Winged-Python/actions/workflows/python-package.yml/badge.svg?branch=main)\n[![codecov](https://codecov.io/gh/micheltlutz/Winged-Python/graph/badge.svg?token=UvaQd65VVD)](https://codecov.io/gh/micheltlutz/Winged-Python)\n[![codebeat badge](https://codebeat.co/badges/b0a28fb9-ffba-4214-980f-a4333781f98f)](https://codebeat.co/projects/github-com-micheltlutz-winged-python-main)\n[![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com)\n[![PyPI version](https://badge.fury.io/py/winged-python.svg)](https://badge.fury.io/py/winged-python)\n# =============\n\n\nWinged-Python is an innovative Domain-Specific Language (DSL) library for efficient HTML writing in Python. Mirroring its Swift counterpart, Winged-Python is based on the DSL concept, focusing on simplification and specificity in HTML generation. Using the Composite design pattern, the library enables developers to construct HTML structures in a logical, organized, and reusable manner.\n\nThis library is created to be fully independent, not requiring integration with specific server frameworks or front-end libraries. This offers developers the freedom to use Winged-Python across a variety of projects, from simple static pages to complex web applications, keeping the code clean, readable, and efficient.\n\n\n## PyPI Releases Page\nhttps://pypi.org/project/winged-python/\n- [Releases Page]([https://pypi.org/manage/project/winged-python/releases/](https://pypi.org/project/winged-python/))\n\n\n## Install\n\n```bash\npip install winged-python==0.1.0\n```\n\n## Simple Usage Example\n\n\n```python\n\nfrom winged.HTML.div import Div\nfrom winged.HTML.h import H\nfrom winged.HTML.table import Table\nfrom winged.HTML.string import String\n\ndivC = Div((\"class\", \"container\"))\n\nh = H(\"1\")\nh.add(String(\"Hello World\"))\ndivC.add(h)\n\ntable = Table()\ntable.add_table_headers([\"Name\", \"Age\", \"Height\", \"Location\"])  # Define headers\n\ntable.add_row()\ntable.add_in_row(String(\"John\"))\ntable.add_in_row(String(\"25\"))\ntable.add_in_row(String(\"1.80\"))\ntable.add_in_row(String(\"New York\"))\n\ntable.add_row()\ntable.add_in_row(String(\"Maria\"))\ntable.add_in_row(String(\"23\"))\ntable.add_in_row(String(\"1.50\"))\ntable.add_in_row(String(\"New Jersey\"))\n\ndivC.add(table)\n\nprint(divC.generate())\n```\n\n## Output\n\n```html\n\u003cdiv class=\"container\"\u003e\n  \u003ch1\u003eHello World\u003c/h1\u003e\n  \u003ctable\u003e\n    \u003cthead\u003e\n      \u003cth\u003eName\u003c/th\u003e\n      \u003cth\u003eAge\u003c/th\u003e\n      \u003cth\u003eHeight\u003c/th\u003e\n      \u003cth\u003eLocation\u003c/th\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n      \u003ctr\u003e\n        \u003ctd\u003eJohn\u003c/td\u003e\n        \u003ctd\u003e25\u003c/td\u003e\n        \u003ctd\u003e1.80\u003c/td\u003e\n        \u003ctd\u003eNew York\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n        \u003ctd\u003eMaria\u003c/td\u003e\n        \u003ctd\u003e23\u003c/td\u003e\n        \u003ctd\u003e1.50\u003c/td\u003e\n        \u003ctd\u003eNew Jersey\u003c/td\u003e\n      \u003c/tr\u003e\n    \u003c/tbody\u003e\n  \u003c/table\u003e\n\u003c/div\u003e\n```\n\n## Usage with FastAPI Render\n\n```python\nfrom fastapi import FastAPI\nfrom fastapi.responses import HTMLResponse\n\nfrom winged.HTML.div import Div\nfrom winged.HTML.h import H\nfrom winged.HTML.string import String\n\n\n@app.get('/', response_class=HTMLResponse)\nasync def home():\n    divC = Div((\"class\", \"container\"))\n    h = H(\"1\")\n    h.add(String(\"Hello World\"))\n    divC.add(h)\n    return divC.get_string()  # Return HTML String\n```\n\n## Contributing\n\nTo contribute, it's simple, follow the guidelines below to prepare your development environment\n\n## Create environment\n\nUser OS terminal or IDE terminal\n\n### Linux or macOS\n\n```bash\npython3 -m venv venv\n```\n\n```bash\nsource venv/bin/activate\n```\n\n### Windows\n\n```bash\n.\\venv\\Scripts\\activate.bat\n```\n\n```bash\n.\\venv\\Scripts\\activate.ps1`\n```\n\n## Install dependencies\n\n```bash\npython3 -m pip install -r requirements.txt\n```\n\n## Run tests\n\n```bash\npytest\n```\n\n\n## TODO\n\n- [ ] Make documentation with Sphinx\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicheltlutz%2Fwinged-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicheltlutz%2Fwinged-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicheltlutz%2Fwinged-python/lists"}