What is the best way to get data from a LocalResource?
For my application, I am treating a Pluto notebook just like a Julia script, and am packaging it alongside some data that is being analyzed. The files are small-medium size, so the data: URI technique employed by this package is an ideal fit for export to HTML later.
One of the files is a .csv file, and I need to parse it. Currently, I am doing something like this with the help of a new method currently in this PR as a straw-man:
f = PlutoUI.LocalResource("data.csv")
d = CSV.read(Vector{UInt8}(f), DataFrame)
(One problem with this approach is that it will only work for Resources that are generated using the LocalResource function; perhaps the type should be forked?)
Happy to implement something and propose it here, but I am wondering if there are better ways to do what I am trying to do. Ideas:
What is the best way to get data from a
LocalResource
?For my application, I am treating a Pluto notebook just like a Julia script, and am packaging it alongside some data that is being analyzed. The files are small-medium size, so the
data:
URI technique employed by this package is an ideal fit for export to HTML later.One of the files is a
.csv
file, and I need to parse it. Currently, I am doing something like this with the help of a new method currently in this PR as a straw-man:(One problem with this approach is that it will only work for
Resource
s that are generated using theLocalResource
function; perhaps the type should be forked?)Happy to implement something and propose it here, but I am wondering if there are better ways to do what I am trying to do. Ideas:
PlutoUI.as_text
function in a way I don't yet understandLocalResource
- e.g. if it is going to be deprecated or externalized in the future