{ "info": { "author": "Pierre Lamot", "author_email": "pierre.lamot@yahoo.fr", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Flask", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 2 :: Only", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Flask ThriftClient\n##################\n\nIntroduction\n============\n\nThis extension provide a simple intergration with\n`Thrift `_ RPC server.\n\n.. code:: python\n\n from flask import Flask\n from flask_thriftclient import ThriftClient\n\n from MyGeneratedThriftCode import MyService\n\n app = Flask(__name__)\n app.config[\"THRIFTCLIENT_TRANSPORT\"] = \"tcp://127.0.0.1:9090\"\n\n thriftclient = ThriftClient(MyService.Client, app)\n\n @app.route(\"/\")\n def home():\n data = thriftclient.client.mymethod()\n return data\n\n\nTransport\n=========\n\nThrift endpoints are defined in the configuration variable\nTHRIFTCLIENT_TRANSPORT as an URL. The default transport is\ntcp://localhost:9090\n\nAvailable url schemes are:\n\ntcp: use TCP socket as transport, you have to define the server\naddress and port. If the port isn't defined, 9090 will be used\n\nExample:\n\n * tcp://127.0.0.1\n\n * tcp://localhost:1234/\n\n\nhttp: use HTTP protocol as transport. Examples:\n\n * http://myservice.local/\n\nunix: use unix sockets as transport, as this scheme follow URI format,\nit *MUST* have either no or three \"/\" before the socket path\n\n * unix:///tmp/mysocket #absolute path\n\n * unix:/tmp/mysocket #absolute path\n\n * unix:./mysocket #relative path\n\nSSL\n===\n\nYou may set SSL version of transport communications by using *'s'*\nversion of url scheme:\n\ntcp <=> tcps\nhttp <=> https\nunix <=> unixs\n\nexamples:\n\n * https://myserver/\n\n * unixs:/tmp/mysocket\n\n * tcps://localhost:5533/\n\nTwo options are related to SSL transport:\n\nTHRIFTCLIENT_SSL_VALIDATE: True if the certificate has to be validated\n(default True)\n\nTHRIFTCLIENT_SSL_CA_CERTS: path to the SSL certificate (default None)\n\nNote that you *MUST* set one of theses options:\n\n.. code:: python\n\n app.config[\"THRIFTCLIENT_SSL_VALIDATE\"] = False\n app.config[\"THRIFTCLIENT_TRANSPORT\"] = \"https://127.0.0.1/\"\n\n #or\n\n app.config[\"THRIFTCLIENT_SSL_CA_CERTS\"] = \"./cacert.pem\"\n app.config[\"THRIFTCLIENT_TRANSPORT\"] = \"https://127.0.0.1/\"\n\nProtocol\n========\n\nYou may define which procotol must be use by setting the parametter\n*THRIFTCLIENT_PROTOCOL*. The default protocol is Binary.\n\nAvailable parametters are:\n\nThriftClient.BINARY or \"BINARY\" : use the binary protocol\n\nThriftClient.COMPACT or \"COMPACT\" : use the compact protocol\n\nThriftClient.JSON or \"JSON\" : use the JSON protocol. note that this\nprotocol is only available for thrift >= 0.9.1\n\nConnection\n==========\n\nBy default the application will open then close the transport for each request\nThis can be overriden by setting *THRIFTCLIENT_ALWAYS_CONNECT* to False\n\nwhen THRIFTCLIENT_ALWAYS_CONNECT is set to False there is 3 ways to handle your\nconnections:\n\n- you can call transport.close and transport.open manually\n- you can use the autoconnect decorator\n- you can use the connect \"with\" context\n\n.. code:: python\n\n app = Flask(__name__)\n app.config[\"THRIFTCLIENT_TRANSPORT\"] = \"tcp://127.0.0.1:9090\"\n app.config[\"THRIFTCLIENT_ALWAYS_CONNECT\"] = False\n\n thriftclient = ThriftClient(MyService.Client, app)\n\n @app.route(\"/with_autoconnect\")\n @thriftclient.autoconnect\n def with_autoconnect():\n data = thriftclient.client.mymethod()\n return data\n\n @app.route(\"/with_context\")\n def with_context():\n with thriftclient.connect():\n data = thriftclient.client.mymethod()\n return data\n\n @app.route(\"/with_manual_connection\")\n def with_manual_connection():\n thriftclient.transport.open()\n data = thriftclient.client.mymethod()\n thriftclient.transport.close()\n return data\n\nOptions\n=======\n\nOther options are:\n\nTHRIFTCLIENT_BUFFERED: use buffered transport (default False)\n\nTHRIFTCLIENT_ZLIB: use zlib compressed transport (default False)", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/chub/flask-thriftclient", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "Flask-ThriftClient", "package_url": "https://pypi.org/project/Flask-ThriftClient/", "platform": "any", "project_url": "https://pypi.org/project/Flask-ThriftClient/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://bitbucket.org/chub/flask-thriftclient" }, "release_url": "https://pypi.org/project/Flask-ThriftClient/0.2.0/", "requires_dist": null, "requires_python": null, "summary": "Adds thrift client support to your Flask application", "version": "0.2.0" }, "last_serial": 1445983, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "fcb2391bf58b7e31728b34df5e556cc7", "sha256": "a6abdf78d89245f8d371137c6cc367df7e962fdb8a03c343fe0403d9f548b92b" }, "downloads": -1, "filename": "Flask-ThriftClient-0.1.tar.gz", "has_sig": false, "md5_digest": "fcb2391bf58b7e31728b34df5e556cc7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4716, "upload_time": "2014-02-28T09:35:27", "url": "https://files.pythonhosted.org/packages/86/eb/d7e3c0d14dc64caed3d87189a636a4f046698a1ab6816ca409cc7f83a54c/Flask-ThriftClient-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "27adfbe571d10d8a8e52b3b78d693697", "sha256": "bb35fab3ee02b0e9273d19562e7be948097d06e1f528127852acbc8b939f6d11" }, "downloads": -1, "filename": "Flask-ThriftClient-0.1.1.tar.gz", "has_sig": false, "md5_digest": "27adfbe571d10d8a8e52b3b78d693697", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4775, "upload_time": "2014-04-22T13:27:29", "url": "https://files.pythonhosted.org/packages/7a/68/ef9a3f54a321f420d2dd0a5e29aad4f414f6acfa1a03e1486329875ab373/Flask-ThriftClient-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "2afbecf6463633de8cedf803948746cd", "sha256": "be0a1fee3c31a4579eebbefab6ac4bcd64f44090aa8e3bacd6c9d8735bbefa33" }, "downloads": -1, "filename": "Flask-ThriftClient-0.2.0.tar.gz", "has_sig": false, "md5_digest": "2afbecf6463633de8cedf803948746cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5733, "upload_time": "2015-03-03T12:30:43", "url": "https://files.pythonhosted.org/packages/43/b7/b79ddf369c47711f1fa92445b23a73d96bfbf7c328dca519585b4e927bd5/Flask-ThriftClient-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2afbecf6463633de8cedf803948746cd", "sha256": "be0a1fee3c31a4579eebbefab6ac4bcd64f44090aa8e3bacd6c9d8735bbefa33" }, "downloads": -1, "filename": "Flask-ThriftClient-0.2.0.tar.gz", "has_sig": false, "md5_digest": "2afbecf6463633de8cedf803948746cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5733, "upload_time": "2015-03-03T12:30:43", "url": "https://files.pythonhosted.org/packages/43/b7/b79ddf369c47711f1fa92445b23a73d96bfbf7c328dca519585b4e927bd5/Flask-ThriftClient-0.2.0.tar.gz" } ] }