semvec/pypi-packages huggingface dataset:
ezchat 0.0.9
easy instant chat webapp
License: MIT
Keywords: chat

ezchat
======

| **ezchat** stands for easy chat.
| + No frills Python chat app. + Instant setup.

| Run from a notebook or command line.
| In both cases, new independent processes are spawn.

1 - Notebook
~~~~~~~~~~~~

See
`demo\_notebook <http://nbviewer.jupyter.org/urls/gitlab.com/oscar6echo/ezchat/raw/master/demo_ezchat.ipynb>`__.

2 - Command Line
~~~~~~~~~~~~~~~~

-  Launch Hub:

.. code:: python

    from ezchat.servers import hub

    h = hub(port=5001)

-  Launch Client:

.. code:: python

    from ezchat.servers import client

    c = client(port=5002)

-  Kill Hub and Clients:

.. code:: python

    from ezchat.servers import kill

    kill(h)
    kill(c)

.. raw:: html
sanic-aioorm 0.0.5
a simple sanic middleware for aioorm
License: MIT
Keywords: orm


sanic-aioorm
===============================

version: 0.0.5

author: hsz

email: hsz1273327@gmail.com

Feature
----------------------
* simple to use, just like using flask's extension
* design to take the place of sanic-peewee
Example
-------------------------------


model.py


.. code:: python

    from sanic_aioorm import AioOrm, AioModel
    from peewee import Proxy, CharField
    db = Proxy()

    @AioOrm.regist
    class User(AioModel):
        username = CharField()
        class Meta:
            database = db



app.py


.. code:: python


    from sanic import Sanic
    from sanic.response import json
    from sanic_aioorm import AioOrm
    from ex_model import User, db
    app = Sanic()
    AioOrm.SetConfig(app, defaultdb="mysql://root:hsz881224@localhost:3306/test")
    orm = AioOrm(app)
    orm.init_proxys(defaultdb=db)
    orm.create_tables(User=[{'username': "hsz"}, {'username': "jojo"}])

    @app.get("/")
    async def testget(request):
        try:
            users = await User.select()
        except Exception as e:
            return json({"error": str(e)})
        else:
            return json({"hello": [await u.to_dict() for u in users]})

    @app.post("/")
    async def testpost(request):
        try:
            users = await User.create(request.json)
        except Exception as e:
            return json({"error": str(e)})
        else:
            return json({"hello": [u.to_dict() for u in users]})

    if __name__ == "__main__":
        app.run(host="0.0.0.0", port=4500)



Install
--------------------------------

- ``python -m pip install sanic-aioorm``


Limitations
-----------
* only support mysql and pgsql