Fork me on GitHub
#babashka
<
2024-01-17
>
danm10:01:47

This is potentially the same answer as @markaddleman got yesterday, but I was hoping to use a bb script to get some data from an API and spit it out in Excel format for our finance people, using dk.ative/docjure, which is a Clojure wrapper around (and thus transitively includes) the Java Apache POI libs. If bb is closed for Java libs, I assume that's not going to work? I actually came here because I was getting an error about java.util.Calendar not being found, and that's a class in Java core. I didn't realise any of that was excluded from bb and came here to ask if there was any way to pull it in or something I should be doing differently to reference it. But even if I got that working I guess I would hit the same problem as Mark as soon as it tried to (:import (apache.poi ...))

borkdude10:01:23

@U6SUWNB9N There is a bb excel library. poi won't work. https://github.com/kbosompem/bb-excel

danm10:01:39

Oh magic! Thanks 😄

danm10:01:10

Aah, oh well 😞 > 2. No write planned at this moment

borkdude10:01:38

There's also #C029PTWD3HR which supports using any Node.js library, if you need the more light-weight fast-starting nature of bb. Else I'd just use the JVM

danm10:01:09

Yeah, that's fair

borkdude10:01:36

adding java.util.Calendar won't fix poi support

jeroenvandijk10:01:13

Maybe relevant, I played with the idea of starting a clj pod from babashka some time ago (https://github.com/jeroenvandijk/pod-babashka-clj). I didn't use it much in practise but I can see some use cases. The advantage over going for JVM only is that you sometimes can benefit from the fast startup time of Babashka. E.g. to validate input arguments or other parts that don't require the jvm lib.

leifericf21:01:18

Perhaps you could write to CSV? Excel can easily import CSV. That's what I usually do.

danm09:01:44

I was mostly looking at Excel because it's quite a complex doc so I want a summary tab and then a tab per user, rather than spitting out mutliple different CSV docs.

vlad_poh13:01:50

@U6SUWNB9N i added basic writing to excel in bb-excel. give it a try.

🎉 1
👀 1