Skip to content
JSX-like syntax in plain Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
htm Remove an unused import Jun 18, 2019
tests
.gitignore
LICENSE
README.md
setup.py

README.md

htm.py CircleCI PyPI

A Python version of developit/htm - JSX-like syntax in plain JavaScript Python.

Installation

$ pip3 install htm

Usage

from htm import htm

@htm()
def html(tag, props, children):
    return tag, props, children

a = 1
b = {"bar": 100}
c = "span"
d = "world"

html("""
  <div foo={a+2} ...{b}>
    <{c}>Hello, {d}!<//>
  </div>
""")
# ('div', {'foo': 3, 'bar': 100}, [('span', {}, ['Hello,', 'world', '!'])])

Development

Running Tests

$ python3 -m unittest discover -s tests

License

This library is licensed under the MIT license. See ./LICENSE.

You can’t perform that action at this time.