TuftsCTSI / TRDW.jl

This is a Pluto environment with FunSQL for use in Research Requests
Other
2 stars 0 forks source link

Implement TRDW.XLSX.write() #60

Closed xitology closed 6 months ago

xitology commented 6 months ago

This is csv2xlsx implemented in Julia with JavaCall. To avoid making TRDW.jl dependent on Java, it is implemented as an optional extension activated on importing of JavaCall.

To use:

  1. You must set environment variable JULIA_COPY_STACKS=1 to run any Julia code that uses JavaCall.
  2. Run ]add JavaCall in Julia shell to add JavaCall to your Julia environment.
  3. In the source code, you should import JavaCall and initialize it. In Pluto, do both in the same cell:
    begin
       using JavaCall
       JavaCall.init()
    end
  4. Now you can use the function TRDW.XLSX.write(filename, table; password = "..."), where table is a DataFrame or any Tables.jl-compatible dataset.

Compared to csv2xlsx, I enabled formatting for numbers and dates. We could change it or disable it if needed. It would also be easy to pack several datasets into the same XLSX file as separate sheets.

clarkevans commented 6 months ago

So, yes, a significant advantage (over CSV) is that we could also include WIISE Archive links encoded...

We need to test with @encrypt macro. Note that almost every chart abstraction will use this. Only cohort discoveries will generally not need this.

clarkevans commented 6 months ago

Integrated in 750ba6b for encrypt macro and tested. Thank you.