Control the web with Python
Project description
iDOM
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
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
Built Distribution
File details
Details for the file idom-0.5.1a2-py3-none-any.whl
.
File metadata
- Download URL: idom-0.5.1a2-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.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74ab14d10509022b71cdd9d272009050f809649366e252569f0318cb02a29c8e |
|
MD5 | 2ced0690ed6d95ee430e268bcb3ca0b7 |
|
BLAKE2b-256 | b639a4f4682769222c4d132d617e1f02a9d9b8f6f3562484486b9a7ad2c94bc2 |