Home > Back-end >  Is there a way to embed pandas analysis into a html page?
Is there a way to embed pandas analysis into a html page?

Time:01-22

I've done some analysis using Pandas on a csv file and have created a number of graphs using matplotlib and plotly.

I'm trying to get these graphs in a html page so my team can see them on a dashboard.

I know it's possible to download the image and embed into html, however, the csv file I performed my analysis on will be constantly updated i.e. I need a way of include the graphs on a html page which auto refreshes.

Is this possible?

CodePudding user response:

I think it would be possible and check pyscrpit

https://pyscript.net/

where you can use python in html

https://github.com/pyscript/pyscript/blob/main/docs/tutorials/getting-started.md

here are some tutorials to get and idea of what I am talking about and to start

Then you can host the html page anywhere you like and they will see when you update it

CodePudding user response:

Voila or Panel to make a dashboard is another way to go. That needs an active Python kernel at this time. (That is as opposed to the pyscript / webassembly route. JupyterLite currently works in WASM and Voila in WASM is in development.) Examining demonstrations available at the Voila Gallery will give you a sense of how it can work. All those example demos are served via MyBinder. And you can use that too, if your code and data can be public. If it cannot be public, you'd need to host a server that only your team can access.

JupyterLite would also be possible if you don't mind your team being able to see the code cells and things. That would not require an active Python kernel server-side because it is based on WebAssembly that would run inside the client machine, like PyScript. So all you would need to do was a have a server that can serve static files. That's a lower bar than Voila that would run on the server. How to get started deploying JupyterLite is here.

  • Related