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

  • Bugfix for the argument parsing of HTMLTreeMaker.addspan().

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.5.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.5-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: htmlmaster-0.0.5.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.5.tar.gz
Algorithm Hash digest
SHA256 51e954db9e469170ba8d940add333af898c4d980902957eb41a0062207bb137b
MD5 bb59d7b7e5032da117e88bc93ab2bc12
BLAKE2b-256 4e6504d98d90b603282c6170cc822d814be2ca2201bd93e152dd1adf81332eee

See more details on using hashes here.

File details

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

File metadata

  • Download URL: htmlmaster-0.0.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7fb31a6a09ece0415b4c4d518221c64593de487879faec6d2b17f87311b77cc1
MD5 5e63cbcbd157909dee78f5a715d37b52
BLAKE2b-256 b7fadf2b04e207ca625b9162903f2626e718594fbd39c6e84bdc96653f71a9e9

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