pygwalker icon indicating copy to clipboard operation
pygwalker copied to clipboard

Add support for streamlit

Open goncaloalves opened this issue 2 years ago • 1 comments

Is it possible to add support for Streamlit?

I think that using the components API from streamlit and a Jinja template that puts the HTML and Javascript file into one this is possible.

goncaloalves avatar Feb 20 '23 18:02 goncaloalves

PyGWalker is an amazing library. Congrats for your job. I have the same issue the @goncaloalves . For me will be very useful if it could use PyGWalker together streamlit.

leandroimail avatar Feb 21 '23 12:02 leandroimail

Hello, welcome to make an early trial of Streamlit support with

!pip install git+https://github.com/Kanaries/pygwalker.git@streamlit-dev

import pygwalker as pyg
pyg.walk(df, env='Streamlit')

UPD: the branch streamlit-dev was only for trial and has been deleted after being merged into main.

Asm-Def avatar Mar 09 '23 08:03 Asm-Def

released in pygwalker>=0.1.4.9.

Asm-Def avatar Mar 09 '23 19:03 Asm-Def

thank you, it seems I can only visit on localhost, but from network url, it returns error:

tornado.websocket.WebSocketClosedError
tornado.iostream.StreamClosedError: Stream is closed

fyenne avatar Mar 13 '23 04:03 fyenne

thank you, it seems I can only visit on localhost, but from network url, it returns error:

tornado.websocket.WebSocketClosedError
tornado.iostream.StreamClosedError: Stream is closed

Thanks for your feedback, we'll take care of it later.

Asm-Def avatar Mar 13 '23 05:03 Asm-Def

谢谢老哥, 这个包真的很棒!

fyenne avatar Mar 13 '23 05:03 fyenne

thank you, it seems I can only visit on localhost, but from network url, it returns error:

tornado.websocket.WebSocketClosedError
tornado.iostream.StreamClosedError: Stream is closed

I'm sorry I don't have a lot of experience with streamlit. But the problem seems to arise frequently during use. One problem is that I'm not sure what network means. Does it mean access to streamlit that someone else has deployed, or some streamlit that is in the cloud, or some service that integrates stremlit Is there a link to your code that you can provide, so that we can try to troubleshoot?

ysj0226 avatar Mar 13 '23 07:03 ysj0226

hi, this one it means access to streamlit that someone else has deployed, I developed some streamlit apps so that my collegues can use it. other elements rendered fine, only [pygwalker] not responsing correctly with regard to above error msg. some code:

#app.py
import streamlit as st
import pandas as pd
import pygwalker as pyg
df = pd.read_csv(' ./data.csv') 
pyg.walk(df, env='Streamlit') 

then host in command line: streamlit run app.py the returned msg would be:

You can now view your Streamlit app in your browser.
  Local URL: http://localhost:8504
  Network URL: http://123.45.6.78:8504

on local host side : say http://localhost:8504/ everything works fine. on my other machine http://123.45.6.78:8504 no return.,


plus: I did not use pip install git+https://github.com/Kanaries/pygwalker.git@streamlit-dev since it seems not working. I simply pip isntall pygwalker

thank you!

fyenne avatar Mar 13 '23 08:03 fyenne

I did not use pip install git+https://github.com/Kanaries/pygwalker.git@streamlit-dev since it seems not working.

The branch streamlit-dev has been deleted after being merged into main and released in pygwalker>=0.1.4.9.

Asm-Def avatar Mar 13 '23 08:03 Asm-Def

hi, this one it means access to streamlit that someone else has deployed, I developed some streamlit apps so that my collegues can use it. other elements rendered fine, only [pygwalker] not responsing correctly with regard to above error msg. some code:

#app.py
import streamlit as st
import pandas as pd
import pygwalker as pyg
df = pd.read_csv(' ./data.csv') 
pyg.walk(df, env='Streamlit') 

then host in command line: streamlit run app.py the returned msg would be:

You can now view your Streamlit app in your browser.
  Local URL: http://localhost:8504
  Network URL: http://123.45.6.78:8504

on local host side : say http://localhost:8504/ everything works fine. on my other machine http://123.45.6.78:8504 no return.,

plus: I did not use pip install git+https://github.com/Kanaries/pygwalker.git@streamlit-dev since it seems not working. I simply pip isntall pygwalker

thank you!

Hello! I did not find similar situation after many experiments. I first turned on streamlit on my win11 machine, and the network url got the correct data. Then I used ec2 of aws for testing, and network url was also able to obtain data correctly. I found some of the similar bugs you mentioned on the web, and I wonder if this is a problem caused by the configuration of streamlit or some other component.

PS: The python version of win11 is 3.10 The python version of ec2 is 3.7

ysj0226 avatar Mar 15 '23 03:03 ysj0226

@fyenne You can update the module to 0.1.6.0

ysj0226 avatar Mar 15 '23 06:03 ysj0226

thanks, it works now. turns out that its just slow.... sorry for all the troubles.

fyenne avatar Mar 15 '23 07:03 fyenne