Metadata-Version: 2.1
Name: wuy
Version: 0.1.3
Summary: Like python eel, but for py3, with asyncio
Home-page: https://github.com/manatlan/reqman
Author: manatlan
Author-email: manatlan@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
Requires-Dist: aiohttp

# wuy 

It's like [python eel](https://github.com/ChrisKnott/Eel) BUT :

* it's not as polished
* it uses python3 ONLY
* it uses asyncio, and the marvellous [aiohttp](https://aiohttp.readthedocs.io/en/stable/)
* it's server hosted friendly from scratch
* it uses pubsub mechanism to communicate from server to clients, or from client to clients
* it's not pyinstaller-friendly for now
* com errors are catch'able thru the promise

it's a proof of concept : WUY means **W**eb **U**ser **Y**nterface ...

## to test/run

Download [the zip from here](https://github.com/manatlan/wuy/archive/master.zip)

    $ pip3 install aiohttp
    $ python3 -u server.py

## to use

Install the lib :

    $ pip3 install wuy

create a python file "web.py", and copy/paste this:

    import wuy
    wuy.start(app=True)

Run it, like this :

    python3 web.py

It will create a "web/index.html", the defaut front-end ;-)

Edit "web/index.html", like this :

    <script src="wuy.js"></script>
    <button onclick="wuy.myadd(42,13).then( alert )">test</button>

Edit "web.py", like this :

    import wuy

    @wuy.expose
    def myadd(a,b):
        return a+b

    wuy.start(app=(640,480))

and rerun your script :

    python3 web.py

and you can start to code

