{ "info": { "author": "Nils Diefenbach", "author_email": "nlsdfnbch.foss@kolabnow.com", "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": "[![PyPI version](https://badge.fury.io/py/Pysher.svg)](https://badge.fury.io/py/Pysher)\n\nPysher\n=============\n\n`pysher` is a python module for handling pusher websockets. It is based on @ekulyk's `PythonPusherClient`. This fork is meant as \na continuation of the project and is actively maintained. A key difference is the dropped support for pre-3.5 Python versions.\n\nInstallation\n------------\n\nSimply run `python setup.py install` - or install via pip `pip install pysher`.\n\nThis module depends on websocket-client module available from: \n\nExample\n-------\n\nExample of using this pusher client to consume websockets::\n\n```python\nimport pysher\n\n# Add a logging handler so we can see the raw communication data\nimport logging\nroot = logging.getLogger()\nroot.setLevel(logging.INFO)\nch = logging.StreamHandler(sys.stdout)\nroot.addHandler(ch)\n\npusher = pysher.Pusher(appkey)\n\ndef my_func(*args, **kwargs):\n print(\"processing Args:\", args)\n print(\"processing Kwargs:\", kwargs)\n\n# We can't subscribe until we've connected, so we use a callback handler\n# to subscribe when able\ndef connect_handler(data):\n channel = pusher.subscribe('mychannel')\n channel.bind('myevent', my_func)\n\npusher.connection.bind('pusher:connection_established', connect_handler)\npusher.connect()\n\nwhile True:\n # Do other things in the meantime here...\n time.sleep(1)\n```\n\nSending pusher events to a channel can be done simply using the pusher client supplied by pusher. You can get it here: \n\n import pusher\n pusher.app_id = app_id\n pusher.key = appkey\n\n p = pusher.Pusher()\n p['mychannel'].trigger('myevent', 'mydata')\n \nPerformance\n------\nPysher relies on websocket-client (websocket-client on pyPI, websocket import in code), which by default does utf5 validation in pure python. This is somewhat cpu hungry for lot's of messages (100's of KB/s or more). To optimize this validation consider installing the wsaccel module from pyPI to let websocket-client use C-compiled utf5 validation methods (websocket does this automatically once wsaccel is present and importable).\n\nThanks\n------\nA big thanks to @ekulyk for developing the [PythonPusherClient](https://github.com/ekulyk/PythonPusherClient) library.\n\n\nCopyright\n---------\n\nMTI License - See LICENSE for details.\n\nChangelog\n---------\n## Version 1.0.2\n### Fixed\n - #38 Fix missing `\u1e81s` arg for websocket app callbacks, thanks to @[squgeim](https://github.com/squgeim)\n## Version 1.0.0\n### Updated\n- #35 Support websocket-client >0.48 only and fix reconnect error, thanks to @[agronholm](https://github.com/agronholm)\n\n**This change may break existing setups and is backwards-incompatible!**\n\n## Version 0.5.0\n### Added\n - #14 Added support for cluster configuration, thanks to @[Yvictor](https://github.com/Yvictor)\n\n### Fixed\n - #30 Require websocket-client version 0.48 or earlier.\n - #24 Signature generation now works as expected, thanks to @[agronholm](https://github.com/agronholm)\n - #31 Name threads of the pysher lib for better debugging, thanks to @[caliloo](https://github.com/caliloo)\n\n## Version 0.4.2\n### Fixed:\n - #11 Global Logger settings no longer overridden in Connection logger\n\n## Version 0.4.0\n### Added:\n - #8 Add support for WebSocket over HTTP proxy, thanks to @[1tgr](https://github.com/1tgr)\n\n## Version 0.3.0\n### Added:\n - #7 Auto-resubscribe to channels after reconnecting, thanks to @[pinealan](https://github.com/pinealan)\n\n### Fixed:\n- #4, #5 Updated references to the library name, thanks to @[deanmaniatis](https://github.com/deanmaniatis)\n\n## Version 0.2.0 \n### Added:\n- #2 Allow for token generated by auth endpoint, thanks to @[wardcraigj](https://github.com/wardcraigj)\n- #3 Allow instantiation with custom host, thanks to @[wardcraigj](https://github.com/wardcraigj)", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/InscribeAI/Pysher", "keywords": "pusher websocket client", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "inscribe-Pysher", "package_url": "https://pypi.org/project/inscribe-Pysher/", "platform": "", "project_url": "https://pypi.org/project/inscribe-Pysher/", "project_urls": { "Homepage": "https://github.com/InscribeAI/Pysher" }, "release_url": "https://pypi.org/project/inscribe-Pysher/1.0.3/", "requires_dist": null, "requires_python": "", "summary": "Pusher websocket client for python, based on Erik Kulyk's PythonPusherClient", "version": "1.0.3" }, "last_serial": 5513038, "releases": { "1.0.3": [ { "comment_text": "", "digests": { "md5": "c6ff8879dcd4096ab7306710f0c72fd9", "sha256": "7c49fd76e86289328d2345ed350d8d1eddd57ea7ed4d291f4e4201b8b11d79ef" }, "downloads": -1, "filename": "inscribe-Pysher-1.0.3.tar.gz", "has_sig": false, "md5_digest": "c6ff8879dcd4096ab7306710f0c72fd9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8524, "upload_time": "2019-07-10T16:49:31", "url": "https://files.pythonhosted.org/packages/10/b0/93d43c03a4250b2dc9e48fd89427bb084f612d7abc1624ce173e6d13cf89/inscribe-Pysher-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c6ff8879dcd4096ab7306710f0c72fd9", "sha256": "7c49fd76e86289328d2345ed350d8d1eddd57ea7ed4d291f4e4201b8b11d79ef" }, "downloads": -1, "filename": "inscribe-Pysher-1.0.3.tar.gz", "has_sig": false, "md5_digest": "c6ff8879dcd4096ab7306710f0c72fd9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8524, "upload_time": "2019-07-10T16:49:31", "url": "https://files.pythonhosted.org/packages/10/b0/93d43c03a4250b2dc9e48fd89427bb084f612d7abc1624ce173e6d13cf89/inscribe-Pysher-1.0.3.tar.gz" } ] }