Skip to content

Create highly interactive web pages purely in Python

License

Notifications You must be signed in to change notification settings

sylvoslee/idom

 
 

Repository files navigation

IDOM

Tests Version Info License: MIT

A package for building highly interactive user interfaces in pure Python inspired by ReactJS.

Be sure to read the Documentation

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!

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[stable]

At a Glance

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

import idom

@idom.component
def Slideshow():
    index, set_index = idom.hooks.use_state(0)
    url = f"https://picsum.photos/800/300?image={index}"
    return idom.html.img({"src": url, "onClick": lambda event: set_index(index + 1)})

idom.run(Slideshow, port=8765)

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

You can even display the same thing in a Jupyter Notebook, just use idom_jupyter:

About

Create highly interactive web pages purely in Python

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 90.2%
  • JavaScript 9.7%
  • HTML 0.1%