Skip to content
Serve up interactive user interfaces with Python
Python JavaScript HTML Shell Batchfile Makefile
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.
.github/ISSUE_TEMPLATE
binder
examples
requirements
scripts
src
.gitignore
.pre-commit-config.yaml Add an HTML dialect (#121) Nov 15, 2019
.travis.yml
CODE_OF_CONDUCT.md
LICENSE
MANIFEST.in
README.md
requirements.txt
setup.py

README.md

IDOM

Build Status Version Info License: MIT

Libraries for creating and controlling interactive web pages with Python 3.6 and above.

IDOM is still young. If you have ideas or find a bug, be sure to post an issue or create a pull request. Thanks in advance!

Try it Now Binder

Click the badge above to get started! It will take you to a Jupyter Notebooks hosted by Binder with some great examples.

Or Install it Now

pip install idom

At a Glance

IDOM can be used to create a simple slideshow which changes whenever a user clicks an image.

import idom

@idom.element
async def Slideshow(self, index=0):

    async def next_image(event):
        self.update(index + 1)

    url = f"https://picsum.photos/800/300?image={index}"
    return idom.html.img({"src": url, "onClick": next_image})

server = idom.server.sanic.PerClientState(Slideshow)
server.daemon("localhost", 8765).join()

Running this will serve our slideshow to "https://localhost:8765/client/index.html"

You could even display the same thing in a Jupyter notebook!

idom.display("jupyter", "https://localhost:8765/stream")

Every click will then cause the image to change (it won't here of course).

You can’t perform that action at this time.