{ "info": { "author": "Damien de Lemeny", "author_email": "ddelemeny@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "pyjrpc\n======\n\nA bare bones JSONRPC 2.0 implementation in python (that you can flesh\nout)\n\n.. code:: python\n\n from pyjrpc import JSONRPC\n import operator\n\n methods = {\n \"add\": operator.add,\n \"sub\": operator.sub,\n }\n\n jsonrpc_handler = JSONRPC(methods)\n\n\n print jsonrpc_handler('{\"jsonrpc\":\"2.0\", \"id\":\"A\", \"method\":\"add\", \"params\":[2,3]}')\n # {\"jsonrpc\": \"2.0\", \"id\": \"A\", \"result\": 5}\n print jsonrpc_handler('{\"jsonrpc\":\"2.0\", \"id\":\"B\", \"method\":\"sub\", \"params\":[3]}')\n # {\"jsonrpc\": \"2.0\", \"id\": \"B\", \"error\": {\"message\": \"Invalid parameters\", \"code\": -32602}}\n print jsonrpc_handler('{\"jsonrpc\":\"2.0\", \"id\":\"C\", \"method\":\"div\", \"params\":[2,3]}')\n # {\"jsonrpc\": \"2.0\", \"id\": \"C\", \"error\": {\"message\": \"Method not found\", \"code\": -32601}}\n print jsonrpc_handler(\n '[{\"jsonrpc\":\"2.0\", \"id\":\"D1\", \"method\":\"add\", \"params\":[1,1]},'\n '{\"jsonrpc\":\"2.0\", \"id\":\"D2\", \"method\":\"sub\", \"params\":[63,21]}]'\n )\n # [{\"jsonrpc\": \"2.0\", \"id\": \"D1\", \"result\": 2},\n # {\"jsonrpc\": \"2.0\", \"id\": \"D2\", \"result\": 42}]\n\nOnly the spec\n-------------\n\n**pyjrpc** aims to be a bare implementation of the `JSON-RPC 2.0\nspecification `_ in python, with\nminimum dependancies.\n\n**pyjrpc** aims to be easy to use, easy to plug and easy to extend.\n\nServer not included\n-------------------\n\n**pyjrpc** does not implement the transport layer, it doesn't even\nconsider it.\n\nIn it's simplest interpretation, the JSONRPC protocol only deals with\nrequests and responses, not their transportation. This is why **pyjrpc**\nwon't do anything about it.\n\nHowever, shall you have the means to transport a string, **pyjrpc** is\ndead easy to plug : its main object is a callable which takes a string\nrequest parameter and applies the protocol upon it. It might return a\nstring response if you're gentle enough.\n\nSay my name\n-----------\n\n**pyjrpc** does not implement function registering magic. Keep it\nsimple, stupid.\n\nNames are identified by their method, or maybe the other way. Therefore,\n**pyjrpc** only assumes that the method map passed as a parameter to the\n``JSONRPC()`` constructor implements ``__getitem__``. Yup, you can use a\ndict.\n\nIf you really WANT to implement the magic, feel free to do it. just\nimplement ``__getitem__`` so that ``methods[name]`` will return the\nfunction you want. Yeah, service introspection, namespaces, fuzzy\nnaming, you can do it all... wait, fuzzy naming ? I hope you're not\nserious about that but, hey, whatever.\n\nCascading handlers\n------------------\n\nTODO : A tale about handler decoration, and all the amazing things you\ncan do with that.\n\nClient POV\n----------\n\nraise NotImplementedError\n\nCompatibility\n-------------\n\n**pyjrpc** has been seen working live on python 2.7.\n\nTests\n-----\n\nRun ``python setup.py test``\n\nMoar docz, moar examplz\n-----------------------\n\nSoon.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ddelemeny/pyjrpc", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "pyjrpc", "package_url": "https://pypi.org/project/pyjrpc/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyjrpc/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/ddelemeny/pyjrpc" }, "release_url": "https://pypi.org/project/pyjrpc/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "Simple, minimal jsonrpc library", "version": "0.1.1" }, "last_serial": 921921, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "37173d4175b4f3f4e2ccd70a43f51d67", "sha256": "a14be502c442b0bcb6d4b67cce7e67f5f4a1fcee0a2f655e5d5e56905186dca2" }, "downloads": -1, "filename": "pyjrpc-0.1.1.tar.gz", "has_sig": false, "md5_digest": "37173d4175b4f3f4e2ccd70a43f51d67", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4232, "upload_time": "2013-11-17T16:40:05", "url": "https://files.pythonhosted.org/packages/bf/37/f0da614645f82fe2ff9738feec3d2a1745f64e2f90562757f40188be8405/pyjrpc-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "37173d4175b4f3f4e2ccd70a43f51d67", "sha256": "a14be502c442b0bcb6d4b67cce7e67f5f4a1fcee0a2f655e5d5e56905186dca2" }, "downloads": -1, "filename": "pyjrpc-0.1.1.tar.gz", "has_sig": false, "md5_digest": "37173d4175b4f3f4e2ccd70a43f51d67", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4232, "upload_time": "2013-11-17T16:40:05", "url": "https://files.pythonhosted.org/packages/bf/37/f0da614645f82fe2ff9738feec3d2a1745f64e2f90562757f40188be8405/pyjrpc-0.1.1.tar.gz" } ] }