{ "info": { "author": "Jos\u00e9 Luis Pati\u00f1o Andr\u00e9s", "author_email": "jose.lpa@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: Unix", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Utilities" ], "description": "===============\nCrossbar HTTP 3\n===============\n\n.. image:: https://travis-ci.org/jose-lpa/crossbarhttp3.svg?branch=master\n :target: https://travis-ci.org/jose-lpa/crossbarhttp3\n\n.. image:: https://codecov.io/gh/jose-lpa/crossbarhttp3/branch/master/graph/badge.svg\n :target: https://codecov.io/github/jose-lpa/crossbarhttp3\n\n.. image:: https://img.shields.io/pypi/v/crossbarhttp3.svg\n :target: https://pypi.python.org/pypi/crossbarhttp3\n\n.. image:: https://img.shields.io/pypi/l/crossbarhttp3.svg\n :target: https://pypi.python.org/pypi/crossbarhttp3\n\nModule that provides methods for accessing Crossbar.io HTTP Bridge Services\n\nFork of the original package by `Eric Chapman at The HQ`_, now supporting \nPython 2.6, 2.7 and 3+ versions.\n\n\nInstallation\n============\n\nInstall Crossbar HTTP 3 with pip::\n\n pip install crossbarhttp3\n\n\nBasic usage\n===========\n\nCall\n----\n\nTo call a Crossbar HTTP bridge, do the following:\n\n.. code-block:: python\n\n client = Client('http://127.0.0.1/call')\n result = client.call('com.example.add', 2, 3, offset=10)\n \nThis will call the following ``add_something`` method of an `ApplicationSession object`_:\n\n.. code-block:: python\n\n from autobahn.twisted.wamp import ApplicationSession\n from twisted.internet.defer import inlineCallbacks\n\n\n class MyComponent(ApplicationSession):\n @inlineCallbacks\n def onJoin(self, details):\n\n def add_something(x, y, offset=0):\n print('Add was called')\n return x + y + offset\n\n yield self.register(add_something, 'com.example.add')\n \nPublish\n-------\n\nTo publish to a Crossbar HTTP bridge, do the following:\n\n.. code-block:: python\n\n client = Client('http://127.0.0.1/publish')\n result = client.publish('com.example.event', event='new event')\n \nThe receiving subscription implemented in an ``ApplicationSession`` class would\nlook like this:\n\n.. code-block:: python\n\n from autobahn.twisted.wamp import ApplicationSession\n from twisted.internet.defer import inlineCallbacks\n\n\n class MyComponent(ApplicationSession):\n @inlineCallbacks\n def onJoin(self, details):\n\n def subscribe_something(event=None, **kwargs):\n print('Publish was called with event %s' % event)\n\n yield self.subscribe(subscribe_something, 'com.example.event')\n\nKey/Secret\n----------\n\nFor bridge services that have a key and secret defined, simply include the key\nand secret in the instantiation of the client.\n\n.. code-block:: python\n\n client = Client('http://127.0.0.1/publish', key='key', secret='secret')\n\nAdditional options\n------------------\n\nThere are two more options available in the client instantiation:\n\n- ``timeout``: Lets you specify a number of seconds from which an idle request to the Crossbar.io node will be dismissed (timed out). Defaults to ``None``, meaning that the global default timeout setting will be used.\n- ``silently``: If set to ``True``, any failed request to the Crossbar.io node will be returned by the client as ``None``, **without raising any exception**. Defaults to ``False``, meaning that all failures will raise their correspondent exceptions.\n\nExceptions\n----------\n\nThe library will throw the following exceptions. Note that all exceptions\nsubclass from ``ClientBaseException`` so you can just catch that if you don't\nwant the granularity.\n\n- ``ClientBadUrl`` - The specified URL is not a HTTP bridge service\n- ``ClientBadHost`` - The specified host name is rejecting the connection\n- ``ClientMissingParams`` - The call was missing parameters\n- ``ClientSignatureError`` - The signature did not match\n- ``ClientNoCalleeRegistered`` - Callee was not registered on the router for the specified procedure\n- ``ClientCallRuntimeError`` - Procedure triggered an exception\n\nContributing\n============\n\nAll bug-fixes or improvements to the library are welcome.\n\nTo contribute, fork the repo and submit a pull request to the ``develop``\nbranch. Please, try to follow this basic coding rules:\n\n- Always include some unit tests for the new code you write or the bugs you fix. Or, update the existent unit tests if necessary.\n- Stick to `PEP-8`_ styling.\n\nTesting\n-------\n\nIn order to test Crossbar HTTP 3 properly you must have a Crossbar.io node in\nHTTP Bridge mode running in localhost port 8001. You can do that by yourself if\nyou need it, but otherwise there is a `Docker image`_ already prepared, so you\ndon't have to bother with this.\n\nTo use that image and raise a Docker container with everything working, make\nsure you have `Docker installed`_ and execute this command::\n\n docker run -t -p 8001:8001 --name crossbar-bridge joselpa/crossbar-http-bridge:0.2\n\nThen you can run the unit tests in the regular way::\n\n python setup.py test\n\nLicense\n=======\n\nReleased under `MIT License`_.\n\n.. _Eric Chapman at The HQ: https://github.com/thehq/python-crossbarhttp\n.. _ApplicationSession object: http://autobahn.ws/python/wamp/programming.html#creating-components\n.. _PEP-8: https://www.python.org/dev/peps/pep-0008/\n.. _Docker image: https://hub.docker.com/r/joselpa/crossbar-http-bridge/\n.. _Docker installed: https://docs.docker.com/\n.. _MIT License: https://opensource.org/licenses/MIT\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jose-lpa/crossbarhttp3", "keywords": "wamp,crossbar.io,websockets,http-bridge", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "crossbarhttp3", "package_url": "https://pypi.org/project/crossbarhttp3/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/crossbarhttp3/", "project_urls": { "Homepage": "https://github.com/jose-lpa/crossbarhttp3" }, "release_url": "https://pypi.org/project/crossbarhttp3/1.1/", "requires_dist": [ "future" ], "requires_python": "", "summary": "Library for connecting to Crossbar.io HTTP Bridge Services.", "version": "1.1" }, "last_serial": 2336410, "releases": { "1.1": [ { "comment_text": "", "digests": { "md5": "31cea746e0ac953626af22d52c737e2a", "sha256": "d03fb48a43523c01e6372eed40bcb1cb7b76e5024c5a7e8308c83fded99c6860" }, "downloads": -1, "filename": "crossbarhttp3-1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "31cea746e0ac953626af22d52c737e2a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5789, "upload_time": "2016-09-11T16:38:25", "url": "https://files.pythonhosted.org/packages/f1/d5/47df14de22c52d64c777b4a4be3f2de383a8b68a1e363163baffa087c95c/crossbarhttp3-1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "605e9b7fa955d04b0c1ab1875d1a088b", "sha256": "3bd1a1d868cfc05609a36320d9a8207049a66eb4fd9a535fb309f42453130dd4" }, "downloads": -1, "filename": "crossbarhttp3-1.1.tar.gz", "has_sig": false, "md5_digest": "605e9b7fa955d04b0c1ab1875d1a088b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5934, "upload_time": "2016-09-11T16:38:27", "url": "https://files.pythonhosted.org/packages/1e/5d/23e8ae3269ca91c9f515f32a14874b60c1ef96342ada6d7f831654d56183/crossbarhttp3-1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "31cea746e0ac953626af22d52c737e2a", "sha256": "d03fb48a43523c01e6372eed40bcb1cb7b76e5024c5a7e8308c83fded99c6860" }, "downloads": -1, "filename": "crossbarhttp3-1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "31cea746e0ac953626af22d52c737e2a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5789, "upload_time": "2016-09-11T16:38:25", "url": "https://files.pythonhosted.org/packages/f1/d5/47df14de22c52d64c777b4a4be3f2de383a8b68a1e363163baffa087c95c/crossbarhttp3-1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "605e9b7fa955d04b0c1ab1875d1a088b", "sha256": "3bd1a1d868cfc05609a36320d9a8207049a66eb4fd9a535fb309f42453130dd4" }, "downloads": -1, "filename": "crossbarhttp3-1.1.tar.gz", "has_sig": false, "md5_digest": "605e9b7fa955d04b0c1ab1875d1a088b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5934, "upload_time": "2016-09-11T16:38:27", "url": "https://files.pythonhosted.org/packages/1e/5d/23e8ae3269ca91c9f515f32a14874b60c1ef96342ada6d7f831654d56183/crossbarhttp3-1.1.tar.gz" } ] }