<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-cli",
"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/f7/52/9307735337b550908d364d2745d04e80c9814e47b7209ead1198667f668f/pywui_cli-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 CLI for starting pywui project.",
"version": "0.1.7",
"project_urls": null,
"split_keywords": [
"pywui",
" pywebview",
" pyinstaller",
" tauri",
" vite"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1bba82b603c0bc933e1ab3eabba143f2922580dbce017e43258ab40182ae2c50",
"md5": "e57fe4d81d764af8cb37c6bf1d99d5ef",
"sha256": "3966956f4c628e253fc40f2b69c8698808e4fb21be65d1155670ed933230789e"
},
"downloads": -1,
"filename": "pywui_cli-0.1.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e57fe4d81d764af8cb37c6bf1d99d5ef",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 1608453,
"upload_time": "2024-11-15T15:05:48",
"upload_time_iso_8601": "2024-11-15T15:05:48.587138Z",
"url": "https://files.pythonhosted.org/packages/1b/ba/82b603c0bc933e1ab3eabba143f2922580dbce017e43258ab40182ae2c50/pywui_cli-0.1.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f7529307735337b550908d364d2745d04e80c9814e47b7209ead1198667f668f",
"md5": "a728f9c325bc023a727a229d8cd3e187",
"sha256": "606a1f871648b3ff6833d6f615b4751fe005374515690741d344d7dde706c32a"
},
"downloads": -1,
"filename": "pywui_cli-0.1.7.tar.gz",
"has_sig": false,
"md5_digest": "a728f9c325bc023a727a229d8cd3e187",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 1608243,
"upload_time": "2024-11-15T15:05:51",
"upload_time_iso_8601": "2024-11-15T15:05:51.308789Z",
"url": "https://files.pythonhosted.org/packages/f7/52/9307735337b550908d364d2745d04e80c9814e47b7209ead1198667f668f/pywui_cli-0.1.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-15 15:05:51",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pywui-cli"
}