mljar / mercury

Convert Jupyter Notebooks to Web Apps
https://RunMercury.com
GNU Affero General Public License v3.0
3.87k stars 243 forks source link

Any way to programatically export .pdfs? #419

Open hmcvieira opened 5 months ago

hmcvieira commented 5 months ago

I would like to use mercury to export reports to .pdf files programmatically, meaning that I want to be able to run a command in which I identify the report name and the widget values and the report gets exported to a certain folder without interacting with the GUI. Is that possible?

pplonski commented 5 months ago

Hi @hmcvieira,

Right now there is no code for this, but it would be a nice feature. I'll be happy to add it. May I ask about details about your use case? Do you plan to run PDF export one time or in periodic schedule?

hmcvieira commented 5 months ago

Hi @pplonski, the idea would be to be able to have an export command/function that would allow the export, giving the desired output path as an argument. Additionally if possible, it would be nice to be able to set the widget values as input as well to that function. For example, if I have to export a report for each client of the 1000 total, I would loop through the list of client, filtering the report by their ID. It would be awesome if possible.

pplonski commented 5 months ago

Maybe you should just check nbconvert tool for this?