{ "info": { "author": "playerla", "author_email": "playerla.94@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Flask", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "[](https://palletsprojects.com/p/flask/)\n[](https://lit-html.polymer-project.org/)\n[](https://socket.io/)\n\n[](.)\n[](https://opensource.org/licenses/MIT)\n[](https://pypi.org/project/flask-socketio-lit-html/)\n[](https://flask-socketio-lit-html.readthedocs.io/)\n[](https://travis-ci.org/playerla/flask-socketio-lit-html)\n[](https://codecov.io/gh/playerla/flask-socketio-lit-html)\n[](https://codeclimate.com/github/playerla/flask-socketio-lit-html)\n\n# Flask-Socket.IO-lit-html\n\nWebcomponents with Flask and SocketIO\n\n[Quick Start on documentation](https://flask-socketio-lit-html.readthedocs.io/introduction.html#introduction)\n\n[Todo App example](https://github.com/playerla/flask-wel-todoapp)\n\n## Proof of concept project to use Webcomponents in Python Flask\n\n* Generate a restful API (inspired from Flask-Restful)\n* Update html on data changes through [socketio](https://socket.io/) (Inspired from Angular properties reflection)\n* Based on the powerful [lit-element library](https://lit-element.polymer-project.org/guide/start)\n\n## Usage philosophy\n\nCreate user webcomponent from sqlalchemy design. GET and POST API on `/user`.\n```python\nclass User(db.Model):\n username = db.Column(db.String(80), nullable=False)\n\nblueprint = User.configure_blueprint(\"/user\", \"user-item\", \"user.html\")\napp.register_blueprint(blueprint)\n```\nDefine the webcomponent view in a jinja template\n```jinja\n{% block render %}\n${ this.username }\n{% endblock %}\n```\nDisplay the second user of your database with live update:\n```html\n\n