JuliaPluto / JuliaPluto/PlutoRESTClient.jl
Ability to export resulting notebook to file (jl, html)
- Dominant language
- Julia
- Stars
- 21
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
I'm thinking about using Pluto for report generation. Basically, there would be a template notebook. For each new report (say each day), we'd load the template notebook, update a few variables, let PlutoRESTClient take care of updating things, store some outputs, and then export jl and/or html versions of the resulting Pluto notebook. On "good days", people would quickly view the html version including visualizations of the outputs and verify that everything went ok. But if they ever wanted to dig into what happened, then they could open the Pluto notebook from the html and jump right into data analysis.
```julia
nb = PlutoNotebook("MyTemplateNotebook.jl") # Open template notebook with PlutoRESTClient
# Set some variables specific to this report
input_file = joinpath(data_path,string(today()),"inputs.csv")
output_file = joinpath(data_path,string(today()),"outputs.csv")
output_notebook_html = joinpath(data_path,string(today()),"report.jl")
output_notebook_html = joinpath(data_path,string(today()),"report.html")
# Set variables in notebook, update notebook, and get results (assumed to be in df_output)
results = nb(; report_date=today(), input_file=input_file ).df_output
# Write output data to table
CSV.write(output_file, results)
# Export resulting Pluto notebook
PlutoRESTClient.save(output_notebook_jl,nb)
# Export html version of notebook using PlutoSliderServer
# Would provide both pretty report and ability to dive into notebook when needed using PlutoSliderServer
PlutoSliderServer.export_notebook(output_notebook_jl)
# or maybe the previous two steps could be merged like
export_notebook(output_notebook_html, nb)
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing the PlutoNotebook, PlutoRESTClient.save, and PlutoSliderServer.export_notebook entry points mentioned in the issue. Determine how the resulting notebook should be exported as both .jl and HTML, and whether one combined export entry point is appropriate. Done means a generated report can be saved in the requested formats after notebook evaluation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100