docs icon indicating copy to clipboard operation
docs copied to clipboard

Request: tutorial for Socket.IO via `python-socketio` integration

Open jamesbraza opened this issue 1 year ago • 6 comments

Summary

I am trying to use Socket.IO via python-socketio to stream logs from my back end to my Streamlit front end.

There are a few Streamlit discussions on working with Socket.IO, but none are "complete":

  • https://discuss.streamlit.io/t/using-session-state-within-socketio-client-events/45774
  • https://discuss.streamlit.io/t/callback-hook-on-a-state-change/29529
  • https://discuss.streamlit.io/t/is-there-a-way-to-create-a-streamlit-app-thats-the-same-for-everyone-more-in-description/40180

The request is to make a comprehensive demo of Streamlit working with python-socketio. It would be cool if the demo involved my somewhat simple use case, which is streaming logs from the back end to the front end.

Why?

Socket.IO (basically abstraction for WebSockets) is a way of enabling real-time bidirectional communication between back end and front end. I think it's a common tool.

How?

Perhaps an Advanced features article

Additional Context

No response

jamesbraza avatar Nov 06 '23 20:11 jamesbraza

To help Streamlit prioritize this feature, react with a 👍 (thumbs up emoji) to the initial post.

Your vote helps us identify which enhancements matter most to our users.

Visits

github-actions[bot] avatar Nov 06 '23 20:11 github-actions[bot]

@jamesbraza Thanks for this enhancement request.

@sfc-gh-dmatthews we probably want to move this request to our docs repo, or?

lukasmasuch avatar Dec 21 '23 11:12 lukasmasuch

Transferred to docs. Thanks for the suggestion!

sfc-gh-dmatthews avatar Jan 25 '24 19:01 sfc-gh-dmatthews

Is there a tutorial on this after all? I was looking for the same thing just now.

VideoFX avatar May 07 '24 07:05 VideoFX

Inspired by st_route.py, I made the following to enable Socket.IO (server) in streamlit.

st_socketio.py

sefgit avatar May 19 '24 12:05 sefgit

Thank you @sefgit , I will try it!

VideoFX avatar May 19 '24 20:05 VideoFX