{ "info": { "author": "Jhon Byaka", "author_email": "byaka.life@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Flask", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "|python27| |License| |PyPI version| |PyPI downloads|\n\nflaskJSONRPCServer\n==================\n\nThis library is an extended implementation of server for JSON-RPC\nprotocol. It supports only json-rpc 2.0 specification for now, which\nincludes batch submission, keyword arguments, notifications, etc.\n\nComments, bug reports\n~~~~~~~~~~~~~~~~~~~~~\n\nflaskJSONRPCServer resides on **github**. You can file issues or pull\nrequests `there `__.\n\nRequirements\n~~~~~~~~~~~~\n\n- **Python2.6** or **Python2.7**\n- **Flask** >= 0.10 (not tested with older version)\n- **Gevent** >= 1.0 (optionally, but recommended)\n\n`How to install <#install>`__\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n`Documentation `__\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n`Simple example <#examples>`__\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n`Licensing <#license>`__\n^^^^^^^^^^^^^^^^^^^^^^^^\n\nPros\n~~~~\n\n- Lib ready for **production**, we use it in some products\n- Lib tested over **\"highload\"** (over 60 connections per second, 24/7\n and it's not simulation) with **Gevent** enabled and no stability\n issues or memory leak (this is why i'm wrote this library)\n- Auto **CORS**\n- Simple switching to **Gevent** as backend\n- Auto fallback to **JSONP** on GET requests (for old browsers, that\n don't support CORS like **IE**\\ <10)\n- Dispatchers can simply get info about connection (**IP**,\n **Cookies**, **Headers**)\n- Dispatchers can simply set **Cookies**, change output **Headers**,\n change output format for **JSONP** requests\n- Lib fully support **Notification** requests (see *example/notify.py*)\n- Lib supports **restarting** server (see *example/restart.py*)\n- Lib supports **hot-reloading** of API (see *example/hotReload1.py*,\n *example/hotReload2.py*)\n- Lib supports **multiple servers** in one app (see\n *example/multiple.py*)\n- Lib supports **merging** with another WSGI app on the same IP:PORT\n (see *example/mergeFlaskApp.py*)\n- Lib supports different **execution-backends**, for example\n multiprocessing (see *example/parallelExecuting.py*)\n- Lib supports **locking** (you can lock all server or specific\n dispatchers)\n- Lib supports different **serializing-backends** so you can implement\n any protocol, not only JSON\n- Lib supports **individual settings** for different dispatchers. For\n example one of them can be processed with parallel (multiprocess)\n backend, other with standard processing\n- Lib collects self **speed-stats**\n\nCons\n~~~~\n\n- Not fully **documentated**. For now only examples in package and `API\n documentation `__.\n- Lib not has **decorators**, so it not a \"Flask-way\" (this can be\n simply added, but i not use decorators, sorry)\n- Lib not covered with **tests**.\n\nInstall\n~~~~~~~\n\n``pip install flaskJSONRPCServer``\n\nExamples\n~~~~~~~~\n\nSimple server. More examples you can find in directory *example/*\n\n.. code:: python\n\n import sys, time, random\n from flaskJSONRPCServer import flaskJSONRPCServer\n\n class mySharedMethods:\n def random(self):\n # Sipmly return random value (0..mult)\n return int(random.random()*65536)\n\n class mySharedMethods2:\n def random(self):\n # Sipmly return random value (0..mult)\n return round(random.random()*1, 1)\n\n def echo(data='Hello world!'):\n # Simply echo\n return data\n echo._alias='helloworld' #setting alias for method\n\n def myip(_connection=None):\n # Return client's IP\n return 'Hello, %s!'%(_connection.ip)\n\n def setcookie(_connection=None):\n # Set cookie to client\n print _connection.cookies\n _connection.cookiesOut.append({'name':'myTestCookie', 'value':'Your IP is %s'%_connection.ip, 'domain':'byaka.name'})\n return 'Setted'\n\n def stats(_connection=None):\n #return server's speed stats\n return _connection.server.stats(inMS=True) #inMS=True return stats in milliseconds\n\n def big(_connection=None):\n _connection.allowCompress=True #allow compression for this method only\n s=\"\"\"\n ... large data here ...\n \"\"\"\n return s\n\n big._alias=['bigdata', 'compressed'] #setting alias for method\n\n if __name__=='__main__':\n print 'Running api..'\n # Creating instance of server\n # switch server to sync mode when is False\n # switch auto CORS support\n # switch to using Gevent as backend\n # switch to logging connection's info from Flask\n # switch to logging debug info from flaskJSONRPCServer\n # switch auto fallback to JSONP on GET requests\n # switch auto compression\n # set min limit for compression\n # set descriptor's limit for server\n # set JSON backend. Auto fallback to native when problems\n # set backend for Notify-requests\n server=flaskJSONRPCServer((\"0.0.0.0\", 7001), blocking=False, cors=True, gevent=True, debug=False, log=False, fallback=True, allowCompress=False, jsonBackend='simplejson', notifBackend='simple', tweakDescriptors=[1000, 1000])\n # Register dispatcher for all methods of instance\n server.registerInstance(mySharedMethods(), path='/api')\n # same name, but another path\n server.registerInstance(mySharedMethods2(), path='/api2')\n # Register dispatchers for single functions\n server.registerFunction(setcookie, path='/api')\n server.registerFunction(echo, path='/api')\n server.registerFunction(myip, path='/api')\n server.registerFunction(big, path='/api')\n server.registerFunction(stats, path='/api')\n # Run server\n server.serveForever()\n # Now you can access this api by path http://127.0.0.1:7001/api for JSON-RPC requests\n # Or by path http://127.0.0.1:7001/api/?jsonp=&(params) for JSONP requests\n # For example by http://127.0.0.1:7001/api/echo?data=test_data&jsonp=jsonpCallback_129620\n\nLicense\n~~~~~~~\n\nIt is licensed under the Apache License, Version 2.0\n(`read `__).\n\n.. |python27| image:: https://img.shields.io/badge/python-2.7-blue.svg\n :target: https://github.com/byaka/flaskJSONRPCServer\n.. |License| image:: https://img.shields.io/pypi/l/flaskJSONRPCServer.svg\n :target: http://www.apache.org/licenses/LICENSE-2.0.html\n.. |PyPI version| image:: https://img.shields.io/pypi/v/flaskJSONRPCServer.svg\n :target: https://pypi.python.org/pypi/flaskJSONRPCServer\n.. |PyPI downloads| image:: https://img.shields.io/pypi/dm/flaskJSONRPCServer.svg\n :target: https://pypi.python.org/pypi/flaskJSONRPCServer", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/byaka/flaskJSONRPCServer/tarball/master", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://byaka.github.io/flaskJSONRPCServer/", "keywords": "flask json-rpc jsonrpc gevent", "license": "Apache 2.0", "maintainer": null, "maintainer_email": null, "name": "flaskJSONRPCServer", "package_url": "https://pypi.org/project/flaskJSONRPCServer/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/flaskJSONRPCServer/", "project_urls": { "Download": "https://github.com/byaka/flaskJSONRPCServer/tarball/master", "Homepage": "https://byaka.github.io/flaskJSONRPCServer/" }, "release_url": "https://pypi.org/project/flaskJSONRPCServer/0.9.3/", "requires_dist": null, "requires_python": null, "summary": "A Python JSON-RPC over HTTP with flask and gevent", "version": "0.9.3" }, "last_serial": 2189947, "releases": { "0.3.1": [ { "comment_text": "", "digests": { "md5": "cfc2f41ad6d8ddf009e4f6e375f1aea0", "sha256": "0e7e1291bb534881fedfd50d1efaf4935f58d470de1bd17c66ad9882c0952640" }, "downloads": -1, "filename": "flaskJSONRPCServer-0.3.1.tar.gz", "has_sig": false, "md5_digest": "cfc2f41ad6d8ddf009e4f6e375f1aea0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10794, "upload_time": "2015-05-02T00:19:23", "url": "https://files.pythonhosted.org/packages/ff/c8/35557d3c6e1daba66dd951d60bd31b9c8964d667781a1da863749fe66a49/flaskJSONRPCServer-0.3.1.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "aff92442b684ac2228903c22028a3007", "sha256": "88b1d2067d606d29bae509ee4101962c852b42b127be4b9426f4afca3f743f34" }, "downloads": -1, "filename": "flaskJSONRPCServer-0.4.1.tar.gz", "has_sig": false, "md5_digest": "aff92442b684ac2228903c22028a3007", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13823, "upload_time": "2015-06-21T12:00:56", "url": "https://files.pythonhosted.org/packages/12/d5/861179fa6a3ea9a8b252a26a4344683eb6ec2a4ef7178992a62913da5b4b/flaskJSONRPCServer-0.4.1.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "27ca6627c74b4230c0cd513c81ce23de", "sha256": "2d6d5942ea8c0abf56ccca552c7ca2d753fdb9f989102d6ac65d23faf65f17b1" }, "downloads": -1, "filename": "flaskJSONRPCServer-0.5.1.tar.gz", "has_sig": false, "md5_digest": "27ca6627c74b4230c0cd513c81ce23de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19408, "upload_time": "2015-10-25T22:50:42", "url": "https://files.pythonhosted.org/packages/e9/50/32fce0c1b11a5afbba61dccfeae71a4993abad4cd025bfb966e65d2ec69d/flaskJSONRPCServer-0.5.1.tar.gz" } ], "0.5.2": [ { "comment_text": "", "digests": { "md5": "a7a9bacf4278d6f35c1d3aeaf6b51ce2", "sha256": "248c8c3b5f44feef02610ed0bb3e1c80bd6cf9a60f0ea8a1b782760c6fb23edf" }, "downloads": -1, "filename": "flaskJSONRPCServer-0.5.2.tar.gz", "has_sig": false, "md5_digest": "a7a9bacf4278d6f35c1d3aeaf6b51ce2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19409, "upload_time": "2015-10-25T22:56:21", "url": "https://files.pythonhosted.org/packages/67/fc/66f378e75be94538ab66f185f5e9518bf91a73e916f5558da199c3259b26/flaskJSONRPCServer-0.5.2.tar.gz" } ], "0.5.21": [ { "comment_text": "", "digests": { "md5": "f1f08c71ec30306c06c5c335983e0812", "sha256": "9fcb728259589de819fef62c888c3923ef2f4a662bfba7255c78e5cd9140109b" }, "downloads": -1, "filename": "flaskJSONRPCServer-0.5.21.tar.gz", "has_sig": false, "md5_digest": "f1f08c71ec30306c06c5c335983e0812", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23927, "upload_time": "2015-10-25T23:15:06", "url": "https://files.pythonhosted.org/packages/84/c7/b15d748e6b70e57b1cf504f755306c2c9cae2c44cfd1301107e1c57a7d9b/flaskJSONRPCServer-0.5.21.tar.gz" } ], "0.9.0": [ { "comment_text": "", "digests": { "md5": "0a73c47771eb84c2ad4dcb72e5502d2c", "sha256": "b9d0bad4c940788453131064c0b238a8b5a9bd3d9ceef4a0616eef3d5a7d95fb" }, "downloads": -1, "filename": "flaskJSONRPCServer-0.9.0.tar.gz", "has_sig": false, "md5_digest": "0a73c47771eb84c2ad4dcb72e5502d2c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 85765, "upload_time": "2016-05-04T14:20:56", "url": "https://files.pythonhosted.org/packages/69/8d/b7f8bd4c9f5741d3b0caf012b49963ce8069215cacd2a50a0c1d9850e842/flaskJSONRPCServer-0.9.0.tar.gz" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "dd0bdb8a650e86e0f05004041a85477e", "sha256": "5a6dec381b55ceb28e01c18a178f5736227507f07094791bf6c598944020cbae" }, "downloads": -1, "filename": "flaskJSONRPCServer-0.9.1.tar.gz", "has_sig": false, "md5_digest": "dd0bdb8a650e86e0f05004041a85477e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 63378, "upload_time": "2016-05-04T14:52:03", "url": "https://files.pythonhosted.org/packages/4e/50/3684fef9a77f6386d01d7e549371fabd5052445e04a5dc2060d9b7d7c6f3/flaskJSONRPCServer-0.9.1.tar.gz" } ], "0.9.2": [ { "comment_text": "", "digests": { "md5": "f3010e54a7a3f33dbbd5f0ddb101a579", "sha256": "0033c5aeacefa1ff7f3e269d401db591d7d6fce027ad805a33c49cac00784ae0" }, "downloads": -1, "filename": "flaskJSONRPCServer-0.9.2.tar.gz", "has_sig": false, "md5_digest": "f3010e54a7a3f33dbbd5f0ddb101a579", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 60426, "upload_time": "2016-05-16T12:40:40", "url": "https://files.pythonhosted.org/packages/1d/90/d292d15671cb9717d336d72bb262aca3df4c3c0e6519300a1f43752373ee/flaskJSONRPCServer-0.9.2.tar.gz" } ], "0.9.3": [ { "comment_text": "", "digests": { "md5": "38b7fa959d4570c02ebdd6f69faad163", "sha256": "25c7244e22d9745d8e0433c8c7b0b6902d10d8fabe7f5dbe566827df929dea93" }, "downloads": -1, "filename": "flaskJSONRPCServer-0.9.3.tar.gz", "has_sig": false, "md5_digest": "38b7fa959d4570c02ebdd6f69faad163", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 60443, "upload_time": "2016-06-27T17:27:07", "url": "https://files.pythonhosted.org/packages/5a/f1/9bfc8dddb4dee60f56a487d7b54c9e4687afa3a2c208f068043db16363f2/flaskJSONRPCServer-0.9.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "38b7fa959d4570c02ebdd6f69faad163", "sha256": "25c7244e22d9745d8e0433c8c7b0b6902d10d8fabe7f5dbe566827df929dea93" }, "downloads": -1, "filename": "flaskJSONRPCServer-0.9.3.tar.gz", "has_sig": false, "md5_digest": "38b7fa959d4570c02ebdd6f69faad163", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 60443, "upload_time": "2016-06-27T17:27:07", "url": "https://files.pythonhosted.org/packages/5a/f1/9bfc8dddb4dee60f56a487d7b54c9e4687afa3a2c208f068043db16363f2/flaskJSONRPCServer-0.9.3.tar.gz" } ] }