clojure 2026-04-25

I'd like to discuss some things with someone who has know-how for creating excel sheets using clojure. I have a set of function I use which create csv files, and then I manually import them into various excel sheets which contain formulas. It would be interesting if I could do that last step programmatically. BTW I am not using MS except per se, as I understand the xlsx format is (somewhat) open and lots of programs can read it. I'm using Mac Numbers, which has some annoying bugs/limitations. I might be able to avoid those limitations if I generated the sheets programmatically. Looking for someone who I can brainstorm with about the best way to do this, or whether I really need to continue doing it manually.

I know that there are java interfaces for doing this. But before diving into uncharted territory, it would be nice to talk with someone who has done anything similar so I don't completely go off and do something bizarre.

A long time ago I did it via Python. Nothing to it, really. Create a new document, create a sheet, start writing cells, save the doc, that's it. I imagine it's pretty much the same when done via Java. And there are multiple libraries for it in Clojure, e.g. here's how you could create a whole doc in one go with one of them: https://github.com/mjul/docjure#example-create-a-spreadsheet

I played a bit with chatgpt and got some basic code that works for what I can start with. i’ve written a clojure script which takes an excel file and replaces a named sheet with the content of a named csv file. I am generating the csv file by another clojure script.

the script is a bit brittle but should work for the moment until I can better figure out what I really need.

Apache POI is a Java library that can do such things. With a bit of cleverness you can even get "headings" bolded and such. It is mostly a matter of "Create a new document, create a sheet, start writing cells (or maybe it's rows), save the doc, that's it"

I have already used docjure in a personal project. I am mostly consuming spreadsheets but also produced a few. The library is functional, but it does have a learning curve and it's not super well documented. I had to read the source code for some functions. It does have support for formulas, so I would give it a go.

I generate Excel files a lot at work. I use a thin Clojure wrapper on top of the great https://github.com/dhatim/fastexcel/ library

This lib is quite fast and works with GraalVM. I have two functions, briefly: to write a seq of rows into a file, and read it back into a vector of vectors. I even have some end-to-end tests for that.

Not sure how much everyone enjoys talking about data structures, but I’ve put together a “narrative guide” to some of the capabilities of my library. Definitely open to feedback https://github.com/dco-dev/ordered-collections/blob/master/doc/zorp-example.md

1
🆒 1
🫶 1
👾 1