{ "info": { "author": "Paolo Gurisatti", "author_email": "paolo@fastmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# tk_html_widgets\nHTML widgets for tkinter\n\n## Overview\nThis module is a collection of tkinter widgets whose text can be set in HTML format.\nA HTML widget isn't a web browser frame, it's only a simple and lightweight HTML parser that formats the tags used by the tkinter Text base class.\nThe widgets behaviour is similar to the PyQt5 text widgets (see the [PyQt5 HTML markup subset](http://doc.qt.io/qt-5/richtext-html-subset.html)).\n\n## Installation\n``pip install tk_html_widgets``\n \n## Requirements\n - [Python 3.4 or later](https://www.python.org/downloads/) with tcl/tk support\n - [Pillow 5.3.0](https://github.com/python-pillow/Pillow)\n\n## Example\n```python\nimport tkinter as tk\nfrom tk_html_widgets import HTMLLabel\n\nroot = tk.Tk()\nhtml_label = HTMLLabel(root, html='

Hello World

')\nhtml_label.pack(fill=\"both\", expand=True)\nhtml_label.fit_height()\nroot.mainloop()\n```\n\n## Documentation\n\n### Classes:\nAll widget classes inherits from the tkinter.Text() base class.\n\n#### class HTMLScrolledText(tkinter.Text)\n> Text-box widget with vertical scrollbar\n#### class HTMLText(tkinter.Text)\n> Text-box widget without vertical scrollbar\n#### class HTMLLabel(tkinter.Text)\n> Text-box widget with label appereance\n \n### Methods:\n#### def set_html(self, html, strip=True):\n> **Description:** Sets the text in HTML format.
\n> **Args:**\n> - *html*: input HTML string\n> - *strip*: if True (default) handles spaces in HTML-like style \n\n#### def fit_height(self):\n> **Description:** Fit widget height in order to display all wrapped lines\n\n### HTML support:\nOnly a subset of the whole HTML tags and attributes are supported (see table below).\nWhere is possibile, I hope to add more HTML support in the next releases.\n\n **Tags** | **Attributes** | **Notes** \n--- | --- | ---\na| style, href | \nb| style | \nbr|| \ncode | style | \ndiv | style | \nem| style | \nh1 | style | \nh2 | style | \nh3 | style | \nh4 | style | \nh5 | style | \nh6 | style | \ni| style | \nimg| src, width, height | local images only \nli| style | \nmark| style | \nol| style, type | 1, a, A list types only\np | style | \npre | style | \nspan| style | \nstrong| style | \nu| style | \nul| style | bullet glyphs only\n\n## Comparison chart\nIn order to check the appearance of the HTML text displayed by the tk_html_widgets, I made some HTML templates and I compared the text displayed by the HTMLText widget with the text displayed by Firefox and the PyQt5 QTextBrowser widget.\nSee details and templates HTML code in the [examples folder](https://github.com/paolo-gurisatti/tk_html_widgets/tree/master/examples).\n\n### Tags template comparison:\n**Firefox** | **tk_html_widgets.HTMLText** | **PyQt5.QtWidgets.QTextBrowser** \n--- | --- | ---\n![](https://github.com/paolo-gurisatti/tk_html_widgets/blob/master/examples/img/tags_firefox.png)|![](https://github.com/paolo-gurisatti/tk_html_widgets/blob/master/examples/img/tags_tk.png)|![](https://github.com/paolo-gurisatti/tk_html_widgets/blob/master/examples/img/tags_pyqt5.png)\n\n### Styles template comparison:\n**Firefox** | **tk_html_widgets.HTMLText** | **PyQt5.QtWidgets.QTextBrowser** \n--- | --- | ---\n![](https://github.com/paolo-gurisatti/tk_html_widgets/blob/master/examples/img/styles_firefox.png)|![](https://github.com/paolo-gurisatti/tk_html_widgets/blob/master/examples/img/styles_tk.png)|![](https://github.com/paolo-gurisatti/tk_html_widgets/blob/master/examples/img/styles_pyqt5.png)\n\n### Images template comparison:\n**Firefox** | **tk_html_widgets.HTMLText** | **PyQt5.QtWidgets.QTextBrowser** \n--- | --- | ---\n![](https://github.com/paolo-gurisatti/tk_html_widgets/blob/master/examples/img/images_firefox.png)|![](https://github.com/paolo-gurisatti/tk_html_widgets/blob/master/examples/img/images_tk.png)|![](https://github.com/paolo-gurisatti/tk_html_widgets/blob/master/examples/img/images_pyqt5.png)\n\n\n## Acknowledgements\nThanks to my mentor, valued collegue and friend [JayZar21](https://github.com/JayZar21).", "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/paolo-gurisatti/tk_html_widgets", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "tk-html-widgets", "package_url": "https://pypi.org/project/tk-html-widgets/", "platform": "", "project_url": "https://pypi.org/project/tk-html-widgets/", "project_urls": { "Homepage": "https://github.com/paolo-gurisatti/tk_html_widgets" }, "release_url": "https://pypi.org/project/tk-html-widgets/0.4.0/", "requires_dist": null, "requires_python": ">=3.4.*", "summary": "HTML widgets for tkinter", "version": "0.4.0" }, "last_serial": 5198011, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "25d2c08270b1e149af96e64046528086", "sha256": "d31867657b7891b08a5a59f1023f1cea0927780182db37b96549d2b8968a55fb" }, "downloads": -1, "filename": "tk_html_widgets-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "25d2c08270b1e149af96e64046528086", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4.*", "size": 9472, "upload_time": "2018-12-09T19:10:46", "url": "https://files.pythonhosted.org/packages/70/6d/699d26911ab33fb654689ad8030dd47b112f3bafbce3f82927e85f9b7d06/tk_html_widgets-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3d6ed5e7e1d8766035e2b24e2cbd2c98", "sha256": "0b5fb4041bb31c0d2f9d8fcdf1cf666101e9cd4e065e8b19f8325e449689b25e" }, "downloads": -1, "filename": "tk_html_widgets-0.1.0.tar.gz", "has_sig": false, "md5_digest": "3d6ed5e7e1d8766035e2b24e2cbd2c98", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4.*", "size": 9780, "upload_time": "2018-12-09T19:10:48", "url": "https://files.pythonhosted.org/packages/06/f7/e43653e543ae4c5a6dc9090e8a99abd6dea9d9c7cff58e95e40e12814771/tk_html_widgets-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "86bc7405e83b264d35baa1ff37b51593", "sha256": "b2a28d68f487f205981e27aaa44228ad3b5592829da85fc2df02b1f9c7980513" }, "downloads": -1, "filename": "tk_html_widgets-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "86bc7405e83b264d35baa1ff37b51593", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4.*", "size": 9535, "upload_time": "2018-12-10T23:16:23", "url": "https://files.pythonhosted.org/packages/f8/79/2b974836afd681846d6d2cf8bce6504bb269815e68128f9e324778c3c3bb/tk_html_widgets-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3b24c6014257b9d820903dd205cab44b", "sha256": "0fba29fedb66d499c10cedeaedfc777476618cf6da13a7d88e7e3364eaad24be" }, "downloads": -1, "filename": "tk_html_widgets-0.2.0.tar.gz", "has_sig": false, "md5_digest": "3b24c6014257b9d820903dd205cab44b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4.*", "size": 9862, "upload_time": "2018-12-10T23:16:25", "url": "https://files.pythonhosted.org/packages/7f/ae/26c900c47463152969d39693bb10f8bc1697ba3b3316649b9d1305151871/tk_html_widgets-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "6807882afb3fc3f22a5963c32dbe0f62", "sha256": "478121d595be35b7788430a24921a29e72e56ef4b95bcecef1a5dce77dfe70e6" }, "downloads": -1, "filename": "tk_html_widgets-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "6807882afb3fc3f22a5963c32dbe0f62", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4.*", "size": 9578, "upload_time": "2018-12-11T23:16:17", "url": "https://files.pythonhosted.org/packages/e7/5c/14148eff2a53ace1bdfde82d7cca44ffb260b761d531b86429ccf5cf7777/tk_html_widgets-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0419a7f0d3a93f59eb99d7f13781b122", "sha256": "64ee6d35b53c92f07cca20fa0cc050077ad77184ff20ddaa8cf3f5ae0a488d0e" }, "downloads": -1, "filename": "tk_html_widgets-0.3.0.tar.gz", "has_sig": false, "md5_digest": "0419a7f0d3a93f59eb99d7f13781b122", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4.*", "size": 9878, "upload_time": "2018-12-11T23:16:20", "url": "https://files.pythonhosted.org/packages/47/d8/76944a9a95295bbc1b822ac61c12e8565edbc69e20ee6b3e2128c7dca960/tk_html_widgets-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "4b3b8aca4d161ada34e7a68a147c7439", "sha256": "ddf63feb83619b9a30e3908b97d5a8acacf618391a372d068225e6bf38b1073f" }, "downloads": -1, "filename": "tk_html_widgets-0.4.0.tar.gz", "has_sig": false, "md5_digest": "4b3b8aca4d161ada34e7a68a147c7439", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4.*", "size": 9896, "upload_time": "2019-04-27T22:54:43", "url": "https://files.pythonhosted.org/packages/d4/52/ac676bd245a608cf93018d56758f378cf70c475007d07d3707fe476f9fcc/tk_html_widgets-0.4.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4b3b8aca4d161ada34e7a68a147c7439", "sha256": "ddf63feb83619b9a30e3908b97d5a8acacf618391a372d068225e6bf38b1073f" }, "downloads": -1, "filename": "tk_html_widgets-0.4.0.tar.gz", "has_sig": false, "md5_digest": "4b3b8aca4d161ada34e7a68a147c7439", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4.*", "size": 9896, "upload_time": "2019-04-27T22:54:43", "url": "https://files.pythonhosted.org/packages/d4/52/ac676bd245a608cf93018d56758f378cf70c475007d07d3707fe476f9fcc/tk_html_widgets-0.4.0.tar.gz" } ] }