webwidgets


Namewebwidgets JSON
Version 1.1.1 PyPI version JSON
download
home_pageNone
SummaryA Python package for designing web UIs.
upload_time2025-08-08 02:04:11
maintainerNone
docs_urlNone
authormlaasri
requires_python>=3.9
licenseNone
keywords design webui
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # WebWidgets

![CI Status](https://img.shields.io/github/actions/workflow/status/mlaasri/WebWidgets/ci-full.yml?branch=main)

A Python package for creating web UIs

## Installation

You can install **WebWidgets** with `pip`. To install the latest stable version, run:

```bash
pip install webwidgets
```

## Usage

**WebWidgets** allows you to create custom widgets and build websites with them. For example:

```python
import webwidgets as ww
from webwidgets.compilation.html import HTMLNode, RawText

# A <div> element
class Div(HTMLNode):
    pass

# A simple text widget
class Text(ww.Widget):
    def build(self):
        return Div([RawText("Hello, World!")])

# A website with one page containing a Text widget
page = ww.Page([Text()])
website = ww.Website([page])

# Compile the website into HTML code
compiled = website.compile()
print(compiled.html_content[0])
```

Prints the following result:

```console
<!DOCTYPE html>
<html>
    <head></head>
    <body>
        <div>
            Hello, World!
        </div>
    </body>
</html>
```
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "webwidgets",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "design, webui",
    "author": "mlaasri",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/bc/a1/d3f40f03aab44a85bf544e46a10d7edcee7316feb87004e4d1769918db51/webwidgets-1.1.1.tar.gz",
    "platform": null,
    "description": "# WebWidgets\n\n![CI Status](https://img.shields.io/github/actions/workflow/status/mlaasri/WebWidgets/ci-full.yml?branch=main)\n\nA Python package for creating web UIs\n\n## Installation\n\nYou can install **WebWidgets** with `pip`. To install the latest stable version, run:\n\n```bash\npip install webwidgets\n```\n\n## Usage\n\n**WebWidgets** allows you to create custom widgets and build websites with them. For example:\n\n```python\nimport webwidgets as ww\nfrom webwidgets.compilation.html import HTMLNode, RawText\n\n# A <div> element\nclass Div(HTMLNode):\n    pass\n\n# A simple text widget\nclass Text(ww.Widget):\n    def build(self):\n        return Div([RawText(\"Hello, World!\")])\n\n# A website with one page containing a Text widget\npage = ww.Page([Text()])\nwebsite = ww.Website([page])\n\n# Compile the website into HTML code\ncompiled = website.compile()\nprint(compiled.html_content[0])\n```\n\nPrints the following result:\n\n```console\n<!DOCTYPE html>\n<html>\n    <head></head>\n    <body>\n        <div>\n            Hello, World!\n        </div>\n    </body>\n</html>\n```",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Python package for designing web UIs.",
    "version": "1.1.1",
    "project_urls": {
        "Source code": "https://github.com/mlaasri/WebWidgets"
    },
    "split_keywords": [
        "design",
        " webui"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "58049293b0650fce0cf6ee2e178580913cf4c01f8447cbc690e0d3ce663b2475",
                "md5": "c732ac71a2edd5f635dbbeece43d2aee",
                "sha256": "f71e4372e81065c43a768e39cece78f02dd1ec1ce700c4ae9fea7ed685fe8dd3"
            },
            "downloads": -1,
            "filename": "webwidgets-1.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c732ac71a2edd5f635dbbeece43d2aee",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 34029,
            "upload_time": "2025-08-08T02:04:09",
            "upload_time_iso_8601": "2025-08-08T02:04:09.635152Z",
            "url": "https://files.pythonhosted.org/packages/58/04/9293b0650fce0cf6ee2e178580913cf4c01f8447cbc690e0d3ce663b2475/webwidgets-1.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "bca1d3f40f03aab44a85bf544e46a10d7edcee7316feb87004e4d1769918db51",
                "md5": "a32cadb106c3095bab83ebf1d5e5d20f",
                "sha256": "aa0ba3f9ae243fdd264a4092e58932229fe62e62f6444d58ba392283e0bda685"
            },
            "downloads": -1,
            "filename": "webwidgets-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "a32cadb106c3095bab83ebf1d5e5d20f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 39497,
            "upload_time": "2025-08-08T02:04:11",
            "upload_time_iso_8601": "2025-08-08T02:04:11.030460Z",
            "url": "https://files.pythonhosted.org/packages/bc/a1/d3f40f03aab44a85bf544e46a10d7edcee7316feb87004e4d1769918db51/webwidgets-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-08 02:04:11",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mlaasri",
    "github_project": "WebWidgets",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "webwidgets"
}
        
Elapsed time: 1.63528s