Skip to main content

HTM for Python

Project description Tests PyPI

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


The main documentation of this module is located at


$ pip3 install htm


from htm import htm

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

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

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


To install locally:

$ pip install -e .

If you want to run tests and build the Sphinx docs and their examples...that runs into a problem with hyperpython's transitive dependencies. Thus:

$ pip install toolz
$ pip install sidekick
$ pip install -e .[docs]

Running Tests

$ python3 -m unittest discover -s tests

Building Docs

Documentation is available in the docs directory. First install the dependencies then build the docs:

$ pip install -e .[docs]
$ cd docs
$ sphinx-build -b html . _build


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

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

htm-0.1.1.tar.gz (4.0 kB view hashes)

Uploaded source

Built Distribution

htm-0.1.1-py3-none-any.whl (4.9 kB view hashes)

Uploaded py3

Supported by

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