Skip to main content

htmlmaster

Project description

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.1

  • Initial release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

htmlmaster-0.0.1-py2.py3-none-any.whl (6.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file htmlmaster-0.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: htmlmaster-0.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.13

File hashes

Hashes for htmlmaster-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 dea2deb802b810388f6afa6e0078134917ac07970f3a8a27c17a9a9fe6f61e02
MD5 61cedeb5ff2bb3c67793abb7abdc362e
BLAKE2b-256 b8e8ff8f9befdddc575ac9434556d18ac061f28fd6d1de7bf30df1fdc5046be6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page