signalr-client


Namesignalr-client JSON
Version 0.0.7 PyPI version JSON
download
home_pagehttps://github.com/TargetProcess/signalr-client-py
SummarySimple SignalR client for Python
upload_time2016-03-29 09:11:09
maintainer
docs_urlNone
authorTaucraft Limited
requires_python
licenseApache
keywords signalr
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            signalr-client-py
=================

Python client proxy for `SignalR <http://signalr.net/>`_.


Requirements
------------

Install requirements by running::

    pip install -r requirements


Signalr client is based on `gevent` which in turn requires Python headers.
In Debian based distributions (such as Ubuntu and Raspbian) they are called `python-dev`.


Compatibility
-------------

Compatible with Python 2 and 3.


Usage
-----
Here is sample usage::

    from requests import Session
    from signalr import Connection

    with Session() as session:
        #create a connection
        connection = Connection("http://localhost:5000/signalr", session)

        #get chat hub
        chat = connection.register_hub('chat')

        #start a connection
        connection.start()

        #create new chat message handler
        def print_received_message(data):
            print('received: ', data)

        #create new chat topic handler
        def print_topic(topic, user):
            print('topic: ', topic, user)

        #create error handler
        def print_error(error):
            print('error: ', error)

        #receive new chat messages from the hub
        chat.client.on('newMessageReceived', print_received_message)

        #change chat topic
        chat.client.on('topicChanged', print_topic)

        #process errors
        connection.error += print_error

        #start connection, optionally can be connection.start()
        with connection:

            #post new message
            chat.server.invoke('send', 'Python is here')

            #change chat topic
            chat.server.invoke('setTopic', 'Welcome python!')

            #invoke server method that throws error
            chat.server.invoke('requestError')

            #post another message
            chat.server.invoke('send', 'Bye-bye!')

            #wait a second before exit
            connection.wait(1)
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/TargetProcess/signalr-client-py",
    "name": "signalr-client",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "signalr",
    "author": "Taucraft Limited",
    "author_email": "info@taucraft.com",
    "download_url": "https://files.pythonhosted.org/packages/2e/f9/f473918805096752937d2d8a90f0e84a876a8c4eb8ede8845f26d629eebf/signalr-client-0.0.7.zip",
    "platform": "UNKNOWN",
    "description": "signalr-client-py\r\n=================\r\n\r\nPython client proxy for `SignalR <http://signalr.net/>`_.\r\n\r\n\r\nRequirements\r\n------------\r\n\r\nInstall requirements by running::\r\n\r\n    pip install -r requirements\r\n\r\n\r\nSignalr client is based on `gevent` which in turn requires Python headers.\r\nIn Debian based distributions (such as Ubuntu and Raspbian) they are called `python-dev`.\r\n\r\n\r\nCompatibility\r\n-------------\r\n\r\nCompatible with Python 2 and 3.\r\n\r\n\r\nUsage\r\n-----\r\nHere is sample usage::\r\n\r\n    from requests import Session\r\n    from signalr import Connection\r\n\r\n    with Session() as session:\r\n        #create a connection\r\n        connection = Connection(\"http://localhost:5000/signalr\", session)\r\n\r\n        #get chat hub\r\n        chat = connection.register_hub('chat')\r\n\r\n        #start a connection\r\n        connection.start()\r\n\r\n        #create new chat message handler\r\n        def print_received_message(data):\r\n            print('received: ', data)\r\n\r\n        #create new chat topic handler\r\n        def print_topic(topic, user):\r\n            print('topic: ', topic, user)\r\n\r\n        #create error handler\r\n        def print_error(error):\r\n            print('error: ', error)\r\n\r\n        #receive new chat messages from the hub\r\n        chat.client.on('newMessageReceived', print_received_message)\r\n\r\n        #change chat topic\r\n        chat.client.on('topicChanged', print_topic)\r\n\r\n        #process errors\r\n        connection.error += print_error\r\n\r\n        #start connection, optionally can be connection.start()\r\n        with connection:\r\n\r\n            #post new message\r\n            chat.server.invoke('send', 'Python is here')\r\n\r\n            #change chat topic\r\n            chat.server.invoke('setTopic', 'Welcome python!')\r\n\r\n            #invoke server method that throws error\r\n            chat.server.invoke('requestError')\r\n\r\n            #post another message\r\n            chat.server.invoke('send', 'Bye-bye!')\r\n\r\n            #wait a second before exit\r\n            connection.wait(1)",
    "bugtrack_url": null,
    "license": "Apache",
    "summary": "Simple SignalR client for Python",
    "version": "0.0.7",
    "project_urls": {
        "Homepage": "https://github.com/TargetProcess/signalr-client-py"
    },
    "split_keywords": [
        "signalr"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ba9bab0d019cbe8149be2e0f3f80aba80eaaf1c3b8506c80cc29e79d309fa91b",
                "md5": "facfda4837c0a485e3f1c3c33635a3bd",
                "sha256": "a0cf5efc4e33dcbdf866ad7adea7acf1e73cbbc8ee7e6895b95c8a1051b31661"
            },
            "downloads": -1,
            "filename": "signalr_client-0.0.7-py2-none-any.whl",
            "has_sig": false,
            "md5_digest": "facfda4837c0a485e3f1c3c33635a3bd",
            "packagetype": "bdist_wheel",
            "python_version": "py2",
            "requires_python": null,
            "size": 9216,
            "upload_time": "2016-03-29T09:10:38",
            "upload_time_iso_8601": "2016-03-29T09:10:38.161525Z",
            "url": "https://files.pythonhosted.org/packages/ba/9b/ab0d019cbe8149be2e0f3f80aba80eaaf1c3b8506c80cc29e79d309fa91b/signalr_client-0.0.7-py2-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "39fa2085d8f6062821b8c48a79a20f32410798af7ee5bd2f64d70c1468656348",
                "md5": "b972cf4f7684ee64f2ce3f085b67d92c",
                "sha256": "91e4ac4dedd4bd8887610f6a7171e37364daaf66131feb0a4cd9bf2f13fe19cc"
            },
            "downloads": -1,
            "filename": "signalr_client-0.0.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b972cf4f7684ee64f2ce3f085b67d92c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 9192,
            "upload_time": "2016-03-29T09:10:54",
            "upload_time_iso_8601": "2016-03-29T09:10:54.578158Z",
            "url": "https://files.pythonhosted.org/packages/39/fa/2085d8f6062821b8c48a79a20f32410798af7ee5bd2f64d70c1468656348/signalr_client-0.0.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2ef9f473918805096752937d2d8a90f0e84a876a8c4eb8ede8845f26d629eebf",
                "md5": "78a2ef32a246f2eb66fb2007fe8a8d55",
                "sha256": "16ff89484394fe8b84ec82a97c7b954c76815bc66949d794e584ac8d8382a49b"
            },
            "downloads": -1,
            "filename": "signalr-client-0.0.7.zip",
            "has_sig": false,
            "md5_digest": "78a2ef32a246f2eb66fb2007fe8a8d55",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 9837,
            "upload_time": "2016-03-29T09:11:09",
            "upload_time_iso_8601": "2016-03-29T09:11:09.144521Z",
            "url": "https://files.pythonhosted.org/packages/2e/f9/f473918805096752937d2d8a90f0e84a876a8c4eb8ede8845f26d629eebf/signalr-client-0.0.7.zip",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2016-03-29 09:11:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "TargetProcess",
    "github_project": "signalr-client-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "signalr-client"
}
        
Elapsed time: 0.30631s