pywui


Namepywui JSON
Version 0.1.7 PyPI version JSON
download
home_pageNone
SummaryPywui is a Python package wrapper for pywebview to make easy the communication between python and JS and async support.
upload_time2024-11-20 07:54:46
maintainerNone
docs_urlNone
authorTsiresy Milà
requires_python<4.0,>=3.10
licenseNone
keywords pywui pywebview pyinstaller tauri vite
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">

[//]: # (  <a target="_blank"><img src="https://raw.githubusercontent.com/nestipy/nestipy/release-v1/nestipy.png" width="200" alt="Nestipy Logo" /></a></p>)
<p align="center">
    <a href="https://pypi.org/project/pywui">
        <img src="https://img.shields.io/pypi/v/pywui?color=%2334D058&label=pypi%20package" alt="Version">
    </a>
    <a href="https://pypi.org/project/pywui">
        <img src="https://img.shields.io/pypi/pyversions/nestipy.svg?color=%2334D058" alt="Python">
    </a>
    <a href="https://github.com/tsiresymila1/pywui/blob/main/LICENSE">
        <img src="https://img.shields.io/github/license/tsiresymila1/pywui" alt="License">
    </a>
</p>

## Description

<p>Pywui is a Python package wrapper for pywebview to make easy the communication between python and JS and async support. </p>

## Getting started

```cmd
    pip install pywui_cli
```

## Create new project

```cmd
    pywui new my_projet
```

## Example

```python
import asyncio
from datetime import datetime

from pywui import command, PyWuiApp, PyWuiWindow, listener, with_window


@with_window
@listener("message", )
async def on_message(window: PyWuiWindow, message: str):
    print("Message received: {}".format(message))


@with_window
@command()
async def greet(window: PyWuiWindow):
    # window.toggle_fullscreen()
    window.emit("message", "Hello from python")
    print("Hello :::", window)
    return "Hello World!"


async def on_start(window: PyWuiWindow):
    async def send_time():
        while True:
            window.emit("time", datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
            await asyncio.sleep(1)

    await asyncio.create_task(send_time())


app = PyWuiApp()
main_window = app.get_window("main")
app.run(func=on_start, args=[main_window], debug=True)


```

## Stay in touch

- Author - [Tsiresy Mila](https://tsiresymila.vercel.app)

## License

PyWui is [MIT licensed](LICENSE).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pywui",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "pywui, pywebview, pyinstaller, tauri, vite",
    "author": "Tsiresy Mil\u00e0",
    "author_email": "tsiresymila@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/22/12/2b67f8a0a1917abe1205bf66d328627e9d542f08f8ccfd17a67c01ddf68d/pywui-0.1.7.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n\n[//]: # (  <a target=\"_blank\"><img src=\"https://raw.githubusercontent.com/nestipy/nestipy/release-v1/nestipy.png\" width=\"200\" alt=\"Nestipy Logo\" /></a></p>)\n<p align=\"center\">\n    <a href=\"https://pypi.org/project/pywui\">\n        <img src=\"https://img.shields.io/pypi/v/pywui?color=%2334D058&label=pypi%20package\" alt=\"Version\">\n    </a>\n    <a href=\"https://pypi.org/project/pywui\">\n        <img src=\"https://img.shields.io/pypi/pyversions/nestipy.svg?color=%2334D058\" alt=\"Python\">\n    </a>\n    <a href=\"https://github.com/tsiresymila1/pywui/blob/main/LICENSE\">\n        <img src=\"https://img.shields.io/github/license/tsiresymila1/pywui\" alt=\"License\">\n    </a>\n</p>\n\n## Description\n\n<p>Pywui is a Python package wrapper for pywebview to make easy the communication between python and JS and async support. </p>\n\n## Getting started\n\n```cmd\n    pip install pywui_cli\n```\n\n## Create new project\n\n```cmd\n    pywui new my_projet\n```\n\n## Example\n\n```python\nimport asyncio\nfrom datetime import datetime\n\nfrom pywui import command, PyWuiApp, PyWuiWindow, listener, with_window\n\n\n@with_window\n@listener(\"message\", )\nasync def on_message(window: PyWuiWindow, message: str):\n    print(\"Message received: {}\".format(message))\n\n\n@with_window\n@command()\nasync def greet(window: PyWuiWindow):\n    # window.toggle_fullscreen()\n    window.emit(\"message\", \"Hello from python\")\n    print(\"Hello :::\", window)\n    return \"Hello World!\"\n\n\nasync def on_start(window: PyWuiWindow):\n    async def send_time():\n        while True:\n            window.emit(\"time\", datetime.now().strftime(\"%Y-%m-%d %H:%M:%S\"))\n            await asyncio.sleep(1)\n\n    await asyncio.create_task(send_time())\n\n\napp = PyWuiApp()\nmain_window = app.get_window(\"main\")\napp.run(func=on_start, args=[main_window], debug=True)\n\n\n```\n\n## Stay in touch\n\n- Author - [Tsiresy Mila](https://tsiresymila.vercel.app)\n\n## License\n\nPyWui is [MIT licensed](LICENSE).\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Pywui is a Python package wrapper for pywebview to make easy the communication between python and JS and async support.",
    "version": "0.1.7",
    "project_urls": null,
    "split_keywords": [
        "pywui",
        " pywebview",
        " pyinstaller",
        " tauri",
        " vite"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "acf7e1a70059fcad0489c2db6045ce2d76c5f14d09c4e0cb34c0e699a4f4585c",
                "md5": "435ec71ea00ce228739e5f2a27b60aa3",
                "sha256": "07be9defadcfc6d0370a1e0be32826a061083e9e8d328464b9c1ef9592828078"
            },
            "downloads": -1,
            "filename": "pywui-0.1.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "435ec71ea00ce228739e5f2a27b60aa3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 249366,
            "upload_time": "2024-11-20T07:54:45",
            "upload_time_iso_8601": "2024-11-20T07:54:45.066389Z",
            "url": "https://files.pythonhosted.org/packages/ac/f7/e1a70059fcad0489c2db6045ce2d76c5f14d09c4e0cb34c0e699a4f4585c/pywui-0.1.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "22122b67f8a0a1917abe1205bf66d328627e9d542f08f8ccfd17a67c01ddf68d",
                "md5": "4a6aac4639d66cdfea6945e0ac8c0e2e",
                "sha256": "9f08a5404c6e02f589f76b1e486342658cdec5f7cb367a8e5b1055a8e73405fd"
            },
            "downloads": -1,
            "filename": "pywui-0.1.7.tar.gz",
            "has_sig": false,
            "md5_digest": "4a6aac4639d66cdfea6945e0ac8c0e2e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 249834,
            "upload_time": "2024-11-20T07:54:46",
            "upload_time_iso_8601": "2024-11-20T07:54:46.908303Z",
            "url": "https://files.pythonhosted.org/packages/22/12/2b67f8a0a1917abe1205bf66d328627e9d542f08f8ccfd17a67c01ddf68d/pywui-0.1.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-20 07:54:46",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pywui"
}
        
Elapsed time: 2.35858s