{ "info": { "author": "Akshay Ramasubramanian", "author_email": "araa@connect.ust.hk", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Internet", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "PysherAsync \n=============\n\n`pysherasync` is a python module for handling Pusher Channels. It is based on @ekulyk's `PythonPusherClient` and @nlsdfnbch `Pysher`. This is a re-implementation of the project\nto use more efficient asynchronous logic and more efficient websockets. A key difference is the dropped support for pre-3.5 Python versions. \n\nThis is also currently a very minimalistic implementation and may be missing some components, please submit an issue and let me know if you run into any problems. \n\nInstallation\n------------\n\nSimply clone the project and run `python setup.py install` - or install via pip `pip install pysherasync`.\n\nThis module depends on websockets module available from: \n\nExample\n-------\n\nExample of using this pusher client to consume websockets:\n\n```python\nimport pysherasync\n\nasync def bitstamp_ob_subscription(loop):\n global loop \n # This is your app key, currently set to https://www.bitstamp.net/websocket/ \n appkey = \"de504dc5763aeef9ff52\"\n # Create an instance of PusherAsyncClient and pass it the appkey \n pusherclient = pysherasync.PusherAsyncClient(appkey)\n # Connect to websocket \n pushersocket = await pusherclient.connect()\n # Subscribe to channel \n status = await pusherclient.subscribe(channel_name='order_book')\n print(\"Subscription Status: %s\"%(status))\n while True:\n ## This is because re-connection logic is not implemented yet\n if not pushersocket.open:\n # on disconnections, reconnect\n print(\"Connection reconnecting\")\n # re-connect\n pushersocket = await pusherclient.connect()\n # re-subscribe \n status = await pusherclient.subscribe(channel_name='order_book')\n print(\"Subscription Status: %s\"%(status))\n try:\n # wait for msg\n msg = await asyncio.wait_for(pushersocket.recv(), 5)\n # parse to json \n msg = json.loads(msg)\n # print the msg \n if msg:\n print(msg) \n except asyncio.TimeoutError:\n print(\"asyncio timeout while waiting for ws msg\")\n except Exception as e:\n print(e)\n\n if __name__ == \"__main__\":\n loop = asyncio.new_event_loop()\n asyncio.set_event_loop(loop)\n loop.run_until_complete(bitstamp_ob_subscription(loop))\n loop.close()\n```\n\nPerformance\n------\nPysherAsync relies on websockets which is one of the most efficient implementations on python.\n\nThanks\n------\nA big thanks to @ekulyk for developing the [PythonPusherClient](https://github.com/ekulyk/PythonPusherClient) library.\n\nA big thanks to @nlsdfnbch for developing the [Pysher](https://github.com/nlsdfnbch/Pysher) library.\n\nA big thanks to @aaugustin for developing the [WebSockets](https://github.com/aaugustin/websockets) library.\n\n\nCopyright\n---------\n\nMTI License - See LICENSE for details.\n\nChangelog\n---------\n## Version 0.2\n### Fix\n - Bug fix for disconnect, added missing await \n## Version 0.1\n### New\n - First Working Version \n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/araa47", "keywords": "pusher websocket client", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pysherasync", "package_url": "https://pypi.org/project/pysherasync/", "platform": "", "project_url": "https://pypi.org/project/pysherasync/", "project_urls": { "Homepage": "http://github.com/araa47" }, "release_url": "https://pypi.org/project/pysherasync/0.2/", "requires_dist": [ "websockets" ], "requires_python": "", "summary": "Asyncio Pusher Channels Client", "version": "0.2" }, "last_serial": 4829388, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "70c2c549ef0f89d20984b2c7bb2a0379", "sha256": "145bd4667e9a0231e24e547cb55c75434ca2a1319182f5652626feeb7cad9ddc" }, "downloads": -1, "filename": "pysherasync-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "70c2c549ef0f89d20984b2c7bb2a0379", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5045, "upload_time": "2019-02-16T16:53:16", "url": "https://files.pythonhosted.org/packages/e7/bf/88e99581e9aa19b084505765753aac4b810e4ec7ea64251a05309a496403/pysherasync-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e13b075a8b440f506c20880faf60f4de", "sha256": "8f94858cabfc1c607f5b5c53711ad0cf6e7c31146dd2c244205ddae5683db597" }, "downloads": -1, "filename": "pysherasync-0.1.tar.gz", "has_sig": false, "md5_digest": "e13b075a8b440f506c20880faf60f4de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4791, "upload_time": "2019-02-16T16:53:18", "url": "https://files.pythonhosted.org/packages/80/91/35ba8ff8980ddf7e9cee35a811cc81e20c3cd95a9d62b02b1d4630c55727/pysherasync-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "369a69202749210c2492f671f52a988c", "sha256": "7580a739f470b496ad6442118844ecd3e63db920d6f5bfef4b24c73bfabdaead" }, "downloads": -1, "filename": "pysherasync-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "369a69202749210c2492f671f52a988c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5072, "upload_time": "2019-02-16T18:16:43", "url": "https://files.pythonhosted.org/packages/ba/8d/7fbc7a565d36730f3a00fe0296e4a365c043d639f6b3ee95a3e37de2d1f0/pysherasync-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0fce6020d5f189baf6deaca8a28890de", "sha256": "5061ab45e952eb75ab8700c1a306347414e4c9b5c6f5587b22f09677c3663542" }, "downloads": -1, "filename": "pysherasync-0.2.tar.gz", "has_sig": false, "md5_digest": "0fce6020d5f189baf6deaca8a28890de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4823, "upload_time": "2019-02-16T18:16:44", "url": "https://files.pythonhosted.org/packages/1f/40/0c1391951cf28a5b65b4dc9372b1862360693317bad74daa1ea73bb010e0/pysherasync-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "369a69202749210c2492f671f52a988c", "sha256": "7580a739f470b496ad6442118844ecd3e63db920d6f5bfef4b24c73bfabdaead" }, "downloads": -1, "filename": "pysherasync-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "369a69202749210c2492f671f52a988c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5072, "upload_time": "2019-02-16T18:16:43", "url": "https://files.pythonhosted.org/packages/ba/8d/7fbc7a565d36730f3a00fe0296e4a365c043d639f6b3ee95a3e37de2d1f0/pysherasync-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0fce6020d5f189baf6deaca8a28890de", "sha256": "5061ab45e952eb75ab8700c1a306347414e4c9b5c6f5587b22f09677c3663542" }, "downloads": -1, "filename": "pysherasync-0.2.tar.gz", "has_sig": false, "md5_digest": "0fce6020d5f189baf6deaca8a28890de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4823, "upload_time": "2019-02-16T18:16:44", "url": "https://files.pythonhosted.org/packages/1f/40/0c1391951cf28a5b65b4dc9372b1862360693317bad74daa1ea73bb010e0/pysherasync-0.2.tar.gz" } ] }