htmlmaster
Provides tools for making html.
Installation
$ pip install htmlmaster
Usage
Make an html table
>>> from repo.htmlmaster import src as hm
>>> table = hm.HTMLTableMaker(index=[1, 2], columns=["foo", "bar"])
>>> table[0, 0] = "this"
>>> table[0, 1] = "is"
>>> table[1, 0] = "a"
>>> table[1, 1] = "table"
>>> table.make()
'<table class="main">\n<thead>\n<tr>\n<th>foo</th>\n<th>bar</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>this</td>\n<td>is</td>\n</tr>\n<tr>\n<td>a</td>\n<td>table</td>\n</tr>\n</tbody>\n</table>'
If you are using a jupyter notebook, you can run a cell like this:
>>> table.show()
| foo | bar |
|---|---|
| this | is |
| a | table |
Make an html tree
>>> tree = hm.HTMLTreeMaker("this")
>>> tree.add("is")
>>> tree.add("a")
>>> tree.get(-1).add("tree")
>>> tree.make()
'<ul class="main">\n<li class="m"><details open><summary>this</summary>\n<ul class="m">\n<li class="m"><span>is</span></li>\n<li class="m"><details open><summary>a</summary>\n<ul class="m">\n<li class="m"><span>tree</span></li>\n</ul>\n</details></li>\n</ul>\n</details></li>\n</ul>'
If you are using a jupyter notebook, you can run a cell like this:
>>> tree.show()
this
- is
a
- tree
See Also
Github repository
PyPI project
License
This project falls under the BSD 3-Clause License.
History
v0.0.5
- Bugfix for the argument parsing of
HTMLTreeMaker.addspan().
v0.0.4
- Fixed a bug occured when specifying
value=NoneforHTMLTreeMaker().
v0.0.3
- New method for
HTMLTreeMaker:*.addspan(),*.addval(). - Removed methods from
HTMLTreeMaker:*.setstyle(),*.getstyle()
v0.0.2
- New methods for
HTMLMaker:*.setrootstyle(),*.getrootstyle(),*.setrootcls(),*.getrootcls(). - Removed methods from
HTMLMaker:*.set_maincls(),*.get_maincls().
v0.0.1
- Initial release.
Metadata
Release files for htmlmaster 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| htmlmaster-0.0.5.tar.gz | 8.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| htmlmaster-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.8 kB
Release files / htmlmaster-0.0.5.tar.gz
| Download URL | htmlmaster-0.0.5.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
51e954db9e469170ba8d940add333af898c4d980902957eb41a0062207bb137b
|
|
BLAKE2b-256 checksum How to use checksums |
4e6504d98d90b603282c6170cc822d814be2ca2201bd93e152dd1adf81332eee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.7
|
Release files / htmlmaster-0.0.5-py3-none-any.whl
| Download URL | htmlmaster-0.0.5-py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7fb31a6a09ece0415b4c4d518221c64593de487879faec6d2b17f87311b77cc1
|
|
BLAKE2b-256 checksum How to use checksums |
b7fadf2b04e207ca625b9162903f2626e718594fbd39c6e84bdc96653f71a9e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.7
|