{ "info": { "author": "Pawe\u0142 A. Pierzchlewicz", "author_email": "paul@teacode.io", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Topic :: Software Development :: Build Tools" ], "description": "# ColabComponent\nA React.js inspired Component for building a simple reactive UI in Google Colaboratory.\n\n### Why?\nSometimes there is some manual work that has to be done with your data. Instead of building a custom desktop app, why not do so in Colab?\n\nI built this component inspired by the react framework, which provides in my opinion the best tools for quick prototype-like development ideal for custom data exploring and data analysis tools.\n\n### How?\nThe `google.colab` package offers an interface to run python functions in the `output`. Combine that with the fact that python notebooks can render full on HTML and you can build UIs using python, HTML, css and javascript!\n\n## Install\nIn a cell run:\n\n```bash\n!pip3 install ColabComponent\n```\n\nAll the required dependencies are installed in the enviroment provided by google.\n\n## How to use?\nThe package utilises Object-Oriented inheritance and is based around the basic class `Component`.\n\n### Component API\n| property name | type | description | overridable |\n|---|---|---|---|\n| render | method | the basic method, where the ui and effects are defined | ☑ |\n| component_did_mount | method | a hook that is called, when the component is mounted | ☑ |\n| component_did_update | method | a hook that is called, when the component is updated | ☑ |\n| display | method | run to display the component | ☒ |\n| register_effect | method | registers a python function such that it can be used within the HTML code | ☒ |\n| state | dict | holds the info about the state of the component | ☒ |\n| set_state | method | the preferred way of updating the component state | ☒ |\n\n## Example\n```python\nfrom ColabComponent import Component\n\nclass Counter(Component):\n def __init__(self):\n super().__init__()\n self.state = {\n 'number': 1\n }\n\n self.use_add = self.register_effect('add', self.add)\n\n def render(self):\n return f'''\n

{self.state['number']}

\n \n '''\n\n def component_did_mount(self):\n print('mounted')\n\n def component_did_update(self):\n print('updated')\n\n def add(self):\n self.set_state({\n 'number': self.state['number'] + 1\n })\n\nCounter().display()\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/PPierzc/ColabComponent", "keywords": "python,colab,react,ui,component", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "ColabComponent", "package_url": "https://pypi.org/project/ColabComponent/", "platform": "", "project_url": "https://pypi.org/project/ColabComponent/", "project_urls": { "Homepage": "https://github.com/PPierzc/ColabComponent" }, "release_url": "https://pypi.org/project/ColabComponent/0.0.3/", "requires_dist": null, "requires_python": "", "summary": "A React.js inspired Component for building a simple reactive UI in Google Colaboratory.", "version": "0.0.3" }, "last_serial": 5647197, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "49079eafc5b23554bbf3d61e2031a644", "sha256": "013a6208fc231e5225b1faf638fa178018059acbb84cf1bfecb113f937628dc5" }, "downloads": -1, "filename": "ColabComponent-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "49079eafc5b23554bbf3d61e2031a644", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4182, "upload_time": "2019-08-07T21:56:04", "url": "https://files.pythonhosted.org/packages/4b/bd/c9652cdb11f39c31d6f87e396f2adcbad8d74411aea569265f9b02498b16/ColabComponent-0.0.2-py3-none-any.whl" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "710b825ed72bc5f5bed3df05ffa54385", "sha256": "6173a938868eac422b5f88feaafb1e456a32dce881b3b5e7ada4059043bd32cc" }, "downloads": -1, "filename": "ColabComponent-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "710b825ed72bc5f5bed3df05ffa54385", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4192, "upload_time": "2019-08-07T22:03:12", "url": "https://files.pythonhosted.org/packages/51/5b/ed3db53ed75a9187870df9f49f1c59153952a31c4eb9ae125290da94995a/ColabComponent-0.0.3-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "710b825ed72bc5f5bed3df05ffa54385", "sha256": "6173a938868eac422b5f88feaafb1e456a32dce881b3b5e7ada4059043bd32cc" }, "downloads": -1, "filename": "ColabComponent-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "710b825ed72bc5f5bed3df05ffa54385", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4192, "upload_time": "2019-08-07T22:03:12", "url": "https://files.pythonhosted.org/packages/51/5b/ed3db53ed75a9187870df9f49f1c59153952a31c4eb9ae125290da94995a/ColabComponent-0.0.3-py3-none-any.whl" } ] }