You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to export programmatically a view as HTML file. Do you know if this is already possible?
My objective is to enable tools without an UI (like an orchestrator) to generate the report and save the HTML File.
Thanks!
The text was updated successfully, but these errors were encountered:
Currently D-Tale supports HTML exports of the current grid (includes the majority of the grid functionality minus anything that requires a call to the server). You can access that functionality by opening the main menu clicking "Export" and then pressing the "HTML" button.
Now this is the part that I'm not 100% sure how it will work programmatically, but essentially if you have a running D-Tale process you can hit the endpoint to generate the file:
import requests
import pandas as pd
import time
ts = time.mktime(pd.Timestamp('now').timetuple())
# 'export_rows' is the number of rows in the dataframe, but you can specify any number
# one thing to be aware of is if your dataframe is large then this file will be really huge and may not work
requests.get(f"http://[hostname]:[dtale port]//dtale/data/1?export=true&export_rows=100&_id={ts}")
Not totally sure what will be returned by the requests.get since it serves up an HTML file. So you'll have to do some work around how to save it down to a specific location. But I'd assume it just returning the bytes of an HTML file which you could pass to a file object and specify the location.
Hi all,
I am trying to export programmatically a view as HTML file. Do you know if this is already possible?
My objective is to enable tools without an UI (like an orchestrator) to generate the report and save the HTML File.
Thanks!
The text was updated successfully, but these errors were encountered: