Skip to main content

Control the web with Python

Project description

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.node("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).

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

idom-0.6.0a2-py3-none-any.whl (3.2 MB view details)

Uploaded Python 3

File details

Details for the file idom-0.6.0a2-py3-none-any.whl.

File metadata

  • Download URL: idom-0.6.0a2-py3-none-any.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.9

File hashes

Hashes for idom-0.6.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 af37bd098421d589fb0db4e5e2f638d63284d012cecf57e7fa635affdbb75272
MD5 0c2381121c21e576a4d26f6ff46ce496
BLAKE2b-256 91ac22fe1de5a68d458d0cd0b7cff74fe30a2728d5c738866d9b0be774708a6e

See more details on using hashes here.

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