Save table to path on the remote server (not on the host running the browser): with JS?

I have been able to modify the export_csv example to pick only a few columns that I select from a CheckboxButtonGroup. My only issue with that is that it makes me a CSV and saves it on the machine running the browser. Instead I would like to have it saved (or turned into pickle) on the machine that serves the page.

I would know what to write for a python callback, but here in the events docs it is explained I might not be able to do that if I do not run a bokeh sever.

So, two questions:

  • do I really got it right that I must run a bokeh server?
  • can I instead accomplish this via JavaScript? (possible to add jquery, node.js, if needed it’s a page to be run only in the intranet, but I’d prefer to avoid this)

If I must go for a bokeh server, what would be the suggestion to incorporate it in my current design? At the moment I put bokeh html output into iframes (so that I can create a fully responsive page with bootstrap and CSS with each plot or table into its own iframe)

Thanks for the directions!

do I really got it right that I must run a bokeh server?

Yes. Or any other web server, but that would be even more complicated.

can I instead accomplish this via JavaScript? (possible to add jquery, node.js, if needed it’s a page to be run only in the intranet, but I’d prefer to avoid this)

Going back to the previous sentence - it’s possible if you run at least some kind of web server. With Bokeh server, you can just use a Python callback that writes the data to a file. With some other server, you can create a POST endpoint that you send your data to from the webpage using JavaScript. That web server can be written in anything.

If I must go for a bokeh server, what would be the suggestion to incorporate it in my current design?

There’s plenty of examples in the documentation about using Bokeh server. Personally, I wouldn’t use iframes, but if they work for you, you don’t have to change anything.

1 Like