Skip to main content

Provides tools for making html.

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

  • Fixed a bug occured when specifying value=None for HTMLTreeMaker().

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.

Project details


Download files

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

Source Distribution

htmlmaster-0.0.4.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

htmlmaster-0.0.4-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file htmlmaster-0.0.4.tar.gz.

File metadata

  • Download URL: htmlmaster-0.0.4.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for htmlmaster-0.0.4.tar.gz
Algorithm Hash digest
SHA256 548e9cdb775f8a8ba043546dbbccdddf7c9092e66f3c83edf8b9ee38c6cc8570
MD5 4f3dd9bc8bf9638cfce31ac27e159840
BLAKE2b-256 6150082d8d856db19729b189293f9d45b480708a602dddd948c409d0ded0fa84

See more details on using hashes here.

File details

Details for the file htmlmaster-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: htmlmaster-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for htmlmaster-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2e6a9a5988c967940ac9956907471d82b4d8e8979ec1ffd1812e7b41391b585c
MD5 cad306311ec46bf2f6b8fe4faa34a70e
BLAKE2b-256 ea0086d3383c99de8944a6534625f79bc9163cd20ebb016da1b5c767e31bea99

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