pusherclient


Namepusherclient JSON
Version 0.3.0 PyPI version JSON
download
home_pagehttps://github.com/ekulyk/PythonPusherClient
SummaryPusher websocket client for python
upload_time2014-12-13 20:29:28
maintainerNone
docs_urlNone
authorErik Kulyk
requires_pythonNone
licenseMIT
keywords pusher websocket client
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            [![Build Status](https://travis-ci.org/ekulyk/PythonPusherClient.svg?branch=master)](https://travis-ci.org/ekulyk/PythonPusherClient)

pusherclient
=============

pusherclient is a python module for handling pusher websockets

Installation
------------

Simply run "python setup.py install".

This module depends on websocket-client module available from: <http://github.com/liris/websocket-client>

Example
-------

Example of using this pusher client to consume websockets::

    import pusherclient

    # Add a logging handler so we can see the raw communication data
    import logging
    root = logging.getLogger()
    root.setLevel(logging.INFO)
    ch = logging.StreamHandler(sys.stdout)
    root.addHandler(ch)

    global pusher

    # We can't subscribe until we've connected, so we use a callback handler
    # to subscribe when able
    def connect_handler(data):
        channel = pusher.subscribe('mychannel')
        channel.bind('myevent', callback)

    pusher = pusherclient.Pusher(appkey)
    pusher.connection.bind('pusher:connection_established', connect_handler)
    pusher.connect()

    while True:
        # Do other things in the meantime here...
        time.sleep(1)

Sending pusher events to a channel can be done simply using the pusher client supplied by pusher.  You can get it here: <http://github.com/newbamboo/pusher_client_python>

    import pusher
    pusher.app_id = app_id
    pusher.key = appkey

    p = pusher.Pusher()
    p['mychannel'].trigger('myevent', 'mydata')

Thanks
------

Built using the websocket-client module from <http://github.com/liris/websocket-client>.
The ruby gem by Logan Koester which provides a similar service was also very helpful for a reference.  Take a look at it here: <http://github.com/logankoester/pusher-client>.

Copyright
---------

MTI License - See LICENSE for details.
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ekulyk/PythonPusherClient",
    "name": "pusherclient",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "pusher websocket client",
    "author": "Erik Kulyk",
    "author_email": "e.kulyk@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/02/e1/0b7e6d15d0b4b905f0d8db152e4cb3f900f509b63fdac6a898f3df8e139c/pusherclient-0.3.0.tar.gz",
    "platform": "UNKNOWN",
    "description": "[![Build Status](https://travis-ci.org/ekulyk/PythonPusherClient.svg?branch=master)](https://travis-ci.org/ekulyk/PythonPusherClient)\n\npusherclient\n=============\n\npusherclient is a python module for handling pusher websockets\n\nInstallation\n------------\n\nSimply run \"python setup.py install\".\n\nThis module depends on websocket-client module available from: <http://github.com/liris/websocket-client>\n\nExample\n-------\n\nExample of using this pusher client to consume websockets::\n\n    import pusherclient\n\n    # Add a logging handler so we can see the raw communication data\n    import logging\n    root = logging.getLogger()\n    root.setLevel(logging.INFO)\n    ch = logging.StreamHandler(sys.stdout)\n    root.addHandler(ch)\n\n    global pusher\n\n    # We can't subscribe until we've connected, so we use a callback handler\n    # to subscribe when able\n    def connect_handler(data):\n        channel = pusher.subscribe('mychannel')\n        channel.bind('myevent', callback)\n\n    pusher = pusherclient.Pusher(appkey)\n    pusher.connection.bind('pusher:connection_established', connect_handler)\n    pusher.connect()\n\n    while True:\n        # Do other things in the meantime here...\n        time.sleep(1)\n\nSending pusher events to a channel can be done simply using the pusher client supplied by pusher.  You can get it here: <http://github.com/newbamboo/pusher_client_python>\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\nThanks\n------\n\nBuilt using the websocket-client module from <http://github.com/liris/websocket-client>.\nThe ruby gem by Logan Koester which provides a similar service was also very helpful for a reference.  Take a look at it here: <http://github.com/logankoester/pusher-client>.\n\nCopyright\n---------\n\nMTI License - See LICENSE for details.",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Pusher websocket client for python",
    "version": "0.3.0",
    "project_urls": {
        "Download": "UNKNOWN",
        "Homepage": "https://github.com/ekulyk/PythonPusherClient"
    },
    "split_keywords": [
        "pusher",
        "websocket",
        "client"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "02e10b7e6d15d0b4b905f0d8db152e4cb3f900f509b63fdac6a898f3df8e139c",
                "md5": "516219a01d3d51a7f37991a6135930b3",
                "sha256": "6a23f2c9255c31301d21728743fc3661e078faed8a6e4206e8774739917de33c"
            },
            "downloads": -1,
            "filename": "pusherclient-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "516219a01d3d51a7f37991a6135930b3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6320,
            "upload_time": "2014-12-13T20:29:28",
            "upload_time_iso_8601": "2014-12-13T20:29:28.318457Z",
            "url": "https://files.pythonhosted.org/packages/02/e1/0b7e6d15d0b4b905f0d8db152e4cb3f900f509b63fdac6a898f3df8e139c/pusherclient-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2014-12-13 20:29:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ekulyk",
    "github_project": "PythonPusherClient",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pusherclient"
}
        
Elapsed time: 0.10688s