{ "info": { "author": "Florian PAQUET", "author_email": "contact@florianpaquet.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "#####\nmease\n#####\n\n.. image:: https://badge.fury.io/py/mease.png\n :target: http://badge.fury.io/py/mease\n\n.. image:: https://travis-ci.org/florianpaquet/mease.png?branch=master\n :target: https://travis-ci.org/florianpaquet/mease\n\nWebsocket server using Twisted/Autobahn with an easy to use callback registry mechanism\n\nSee `django-mease `_, `django-mease-example `_ or `flask-mease-example `_ for working examples.\n\n************\nInstallation\n************\n\nUse pip to install the latest mease version : ::\n\n pip install mease\n\n``mease`` comes with two backends :\n\nRedis\n=====\n\nTo use Redis backend, install these dependencies : ::\n\n sudo apt-get install redis-server\n pip install redis\n\nRefer to the `Redis documentation `_ to configure your server.\n\nRabbitMQ\n========\n\nTo use RabbitMQ backend, install these dependencies : ::\n\n sudo apt-get install rabbitmq-server\n pip install kombu\n\nRefer to the `RabbitMQ documentation `_ to configure your server.\n\n**********\nQuickstart\n**********\n\nCreate a file where you can write your callbacks and register them :\n\n.. code:: python\n\n from mease import Mease\n from mease.backends.redis import RedisBackend\n # OR from mease.backends.rabbitmq import RabbitMQBackend\n\n from uuid import uuid4\n\n mease = Mease(RedisBackend)\n\n @mease.opener\n def example_opener(client, clients_list):\n # Do stuff on client connection\n client.storage['uuid'] = str(uuid4())\n\n @mease.closer\n def example_closer(client, clients_list):\n # Do stuff on client disconnection\n print(\"Client {uuid} disconnected\".format(uuid=client.storage.get('uuid')))\n\n @mease.receiver(json=True)\n def example_receiver(client, clients_list, message):\n # Do stuff on incoming client message\n pass\n\n @mease.sender(routing='mease.demo')\n def example_sender(routing, clients_list, my_tuple):\n # Do stuff on outgoing message\n pass\n\n if __name__ == '__main__':\n # Start websocket server\n mease.run_websocket_server()\n\nRemember to run the websocket server from the ``mease`` instance where you registered your callbacks.\n\nIn your code, you can now call the mease ``publish`` method to send a message to websocket clients :\n\n.. code:: python\n\n from mease import Mease\n from mease.backends.redis import RedisBackend\n\n mease = Mease(RedisBackend)\n\n # ...\n\n mease.publish('mease.demo', my_tuple=(\"Hello\", \"World\"))\n\nThat's it ! You are now able to send messages from your web server to your websocket server in a cool way !", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/florianpaquet/mease", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "mease", "package_url": "https://pypi.org/project/mease/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/mease/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/florianpaquet/mease" }, "release_url": "https://pypi.org/project/mease/0.2.0/", "requires_dist": null, "requires_python": null, "summary": "Mease: Twisted/Autobahn websocket server with an easy callback registry", "version": "0.2.0" }, "last_serial": 989747, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "9d75616c960db274f9910a5da0224cec", "sha256": "62e5b6bfc99fdaa31d4c8399ece55f24916730a5448726bd2b9c473f63f08508" }, "downloads": -1, "filename": "mease-0.1.0.tar.gz", "has_sig": false, "md5_digest": "9d75616c960db274f9910a5da0224cec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4683, "upload_time": "2014-01-20T22:05:03", "url": "https://files.pythonhosted.org/packages/0c/e0/8d78d0634d81f28bb4f5695b44678d5b1fbeddfc96eeedab383248e658d4/mease-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "fc38d3a640259b6fd737e69fc54bdeb6", "sha256": "9ee632cc53314ad609497c46cfc958de36d58248083fd47fc388cf9273ef5bf7" }, "downloads": -1, "filename": "mease-0.1.1.tar.gz", "has_sig": false, "md5_digest": "fc38d3a640259b6fd737e69fc54bdeb6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7465, "upload_time": "2014-01-21T21:59:10", "url": "https://files.pythonhosted.org/packages/80/c7/6d04764c0f7c19254cac4a0b6cc61d6254bcf3916fdd5c4d4a8be0b666de/mease-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "29ca399c5708bd8e3e2e793243a4303c", "sha256": "d65dd1cc43233e3244739c4d63d0facb0ead3e3d9ee46b9cd1a9a76f2d26caa0" }, "downloads": -1, "filename": "mease-0.2.0.tar.gz", "has_sig": false, "md5_digest": "29ca399c5708bd8e3e2e793243a4303c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8773, "upload_time": "2014-02-03T20:20:05", "url": "https://files.pythonhosted.org/packages/fb/21/76aa475cc8d0d62267d103d235bd3a69f981ce2508d19e998e4cccec93d1/mease-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "29ca399c5708bd8e3e2e793243a4303c", "sha256": "d65dd1cc43233e3244739c4d63d0facb0ead3e3d9ee46b9cd1a9a76f2d26caa0" }, "downloads": -1, "filename": "mease-0.2.0.tar.gz", "has_sig": false, "md5_digest": "29ca399c5708bd8e3e2e793243a4303c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8773, "upload_time": "2014-02-03T20:20:05", "url": "https://files.pythonhosted.org/packages/fb/21/76aa475cc8d0d62267d103d235bd3a69f981ce2508d19e998e4cccec93d1/mease-0.2.0.tar.gz" } ] }