{ "info": { "author": "Nicolas Maurice", "author_email": "nicolas.maurice.valera@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "Some rights reserved.\n\nRedistribution and use in source and binary forms of the software as well\nas documentation, with or without modification, are permitted provided\nthat the following conditions are met:\n\n* Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n* Neither the name of Flask-Web3 nor the names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\nTHIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND\nCONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT\nNOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER\nOR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\nEXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\nPROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\nDAMAGE.\nDescription: .. image:: https://travis-ci.org/nmvalera/flask-web3.svg?branch=master\n :target: https://travis-ci.org/nmvalera/flask-web3\n :alt: Build Status\n \n .. image:: https://codecov.io/gh/nmvalera/flask-web3/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/nmvalera/flask-web3\n :alt: Coverage\n \n .. image:: https://readthedocs.org/projects/flask-web3/badge/?version=stable\n :target: https://flask-web3.readthedocs.io/en/stable/?badge=stable\n :alt: Documentation Status\n \n Flask-Web3\n ==========\n \n Flask-Web3 is a flask extension allowing to smoothly integrate a flask application with `web3.py`_.\n This package is intended for developers will to build a Flask application that interacts with an Ethereum client.\n \n .. _`web3.py`: https://github.com/ethereum/web3.py\n \n Requirements\n ~~~~~~~~~~~~\n \n - Python>=3.5\n \n A simple example\n ~~~~~~~~~~~~~~~~\n \n .. code-block:: python\n \n >>> from flask import Flask, jsonify\n >>> from flask_web3 import current_web3, FlaskWeb3\n \n # Declare Flask application\n >>> app = Flask(__name__)\n \n # Set Flask-Web3 configuration\n >>> app.config.update({'ETHEREUM_PROVIDER': 'http', 'ETHEREUM_ENDPOINT_URI': 'http://localhost:8545'})\n \n # Declare Flask-Web3 extension\n >>> web3 = FlaskWeb3(app=app)\n \n # Declare route\n >>> @app.route('/blockNumber')\n ... def block_number():\n ... return jsonify({'data': current_web3.eth.blockNumber})\n \n You can notice that Flask-Web3 gives you an application context bound variable ``current_web3`` that is accessible\n from any active flask application context.\n \n An advanced example\n ~~~~~~~~~~~~~~~~~~~\n \n You may like to declare your Flask-Web3 extension from a customize Web3 class with enhanced logic.\n \n .. code-block:: python\n \n >>> from flask import Flask, jsonify\n >>> from flask_web3 import current_web3, FlaskWeb3\n >>> from web3 import Web3\n \n # Declare Flask application\n >>> app = Flask(__name__)\n >>> app.config.update({'ETHEREUM_PROVIDER': 'http', 'ETHEREUM_ENDPOINT_URI': 'http://localhost:8545'})\n \n # Declare a custom Web3 class\n >>> class CustomWeb3(Web3):\n ... def customBlockNumber():\n ... return self.eth.blockNumber\n \n # Associate a custom FlaskWeb3 extension\n >>> class CustomFlaskWeb3(FlaskWeb3):\n ... web3_class = CustomWeb3\n \n # Declare customized web3 extension\n >>> web3 = CustomFlaskWeb3(app=app)\n >>> isinstance(web3, CustomWeb3)\n True\n \n # Declare route\n >>> @app.route('/customBlockNumber')\n ... def last_odd_block_number():\n ... return jsonify({'data': current_web3.customBlockNumber()})\n \n Documentation\n ~~~~~~~~~~~~~\n \n Full documentation is available at https://flask-web3.readthedocs.io/en/stable/.\nPlatform: any\nClassifier: Development Status :: 5 - Production/Stable\nClassifier: Environment :: Web Environment\nClassifier: Intended Audience :: Developers\nClassifier: License :: OSI Approved :: BSD License\nClassifier: Operating System :: OS Independent\nClassifier: Programming Language :: Python\nClassifier: Programming Language :: Python :: 3\nClassifier: Programming Language :: Python :: 3.5\nClassifier: Programming Language :: Python :: 3.6\nProvides-Extra: doc\nProvides-Extra: dev\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nmvalera/flask-web3", "keywords": "", "license": "Copyright (c) 2017 by ConsenSys France and contributors.", "maintainer": "ConsenSys France", "maintainer_email": "", "name": "Flask-Web3", "package_url": "https://pypi.org/project/Flask-Web3/", "platform": "", "project_url": "https://pypi.org/project/Flask-Web3/", "project_urls": { "Homepage": "https://github.com/nmvalera/flask-web3" }, "release_url": "https://pypi.org/project/Flask-Web3/0.1.1/", "requires_dist": [ "web3 (>=4.4.0)", "flask (>=1.0.0)", "flake8; extra == 'dev'", "autoflake; extra == 'dev'", "autopep8; extra == 'dev'", "coverage; extra == 'dev'", "eth-tester[py-evm] (==0.1.0-beta.26); extra == 'dev'", "pytest (>=3); extra == 'dev'", "tox; extra == 'dev'", "sphinx; extra == 'dev'", "sphinx-rtd-theme; extra == 'dev'", "sphinx; extra == 'doc'", "sphinx-rtd-theme; extra == 'doc'" ], "requires_python": "", "summary": "Flask extension allowing to smoothly integrate with web3.py.", "version": "0.1.1" }, "last_serial": 4040811, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "df2e5f79d3687705f46c4da0811410e4", "sha256": "b3ea686a3903cf709032175f25f63aad3d5c94de13d9e96ab0b31fb9090214cf" }, "downloads": -1, "filename": "Flask_Web3-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "df2e5f79d3687705f46c4da0811410e4", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10751, "upload_time": "2018-07-08T14:47:38", "url": "https://files.pythonhosted.org/packages/d7/36/379be40408f17ad52d22301e0619c8e737d6d20d1cba38d8ab61770953ec/Flask_Web3-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "56d5c8f4efff4b194f75a4c02ed24258", "sha256": "040dcae3ffb093b70aa8f20bb20a7c93e157726c93e3162605aa1c4c17ae8554" }, "downloads": -1, "filename": "Flask-Web3-0.1.1.tar.gz", "has_sig": false, "md5_digest": "56d5c8f4efff4b194f75a4c02ed24258", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11196, "upload_time": "2018-07-08T14:47:39", "url": "https://files.pythonhosted.org/packages/aa/7a/26a40f964770e0b1bede013e13643796f191e9764378a3dfb027056e25a7/Flask-Web3-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "df2e5f79d3687705f46c4da0811410e4", "sha256": "b3ea686a3903cf709032175f25f63aad3d5c94de13d9e96ab0b31fb9090214cf" }, "downloads": -1, "filename": "Flask_Web3-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "df2e5f79d3687705f46c4da0811410e4", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10751, "upload_time": "2018-07-08T14:47:38", "url": "https://files.pythonhosted.org/packages/d7/36/379be40408f17ad52d22301e0619c8e737d6d20d1cba38d8ab61770953ec/Flask_Web3-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "56d5c8f4efff4b194f75a4c02ed24258", "sha256": "040dcae3ffb093b70aa8f20bb20a7c93e157726c93e3162605aa1c4c17ae8554" }, "downloads": -1, "filename": "Flask-Web3-0.1.1.tar.gz", "has_sig": false, "md5_digest": "56d5c8f4efff4b194f75a4c02ed24258", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11196, "upload_time": "2018-07-08T14:47:39", "url": "https://files.pythonhosted.org/packages/aa/7a/26a40f964770e0b1bede013e13643796f191e9764378a3dfb027056e25a7/Flask-Web3-0.1.1.tar.gz" } ] }