Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Great work, any plans to provide higher level api #57

Open
aszenz opened this issue Feb 20, 2025 · 3 comments
Open

Great work, any plans to provide higher level api #57

aszenz opened this issue Feb 20, 2025 · 3 comments

Comments

@aszenz
Copy link

aszenz commented Feb 20, 2025

Awesome work on the library, i tried it and so far it exceeds my expectations in both perf and memory usage (compared to xlsx/sheetjs).

I'm wondering if this library would like to introduce higher level api's for easily transforming js array of objects /objects of arrays into excel tables with proper formatting.

Currently the library only provides wrappers for the xlsx-writer lib, but maybe it should also provide higher level api's that are useful in the js world. I think that would make this library more useful for the js ecosystem.

I realize this can be done manually with the existing lower level api's, but it requires a lot of code and adding another library on top might make it difficult to maintain.

In addition I would like to create an excel table out of Apache Arrow data as efficiently as possible, any clues/hints on that?

@kenkoooo
Copy link
Member

Thank you for your suggestion. I completely agree that high-level APIs, such as converting 2D arrays to sheets, can be very helpful and are definitely worth implementing.

I have no idea how to efficiently convert Apache Arrow data to XLSX. From my understanding, Apache Arrow is designed to handle large amounts of data, whereas XLSX is not. An XLSX sheet can only contain up to 16,000 rows.

@jmcnamara
Copy link

jmcnamara commented Feb 20, 2025

@aszenz

I'm wondering if this library would like to introduce higher level api's for easily transforming js array of objects /objects of arrays into excel tables with proper formatting.

Could you give some examples of what you would envisage as the higher level APIs?

@aszenz
Copy link
Author

aszenz commented Feb 20, 2025

@kenkoooo

An XLSX sheet can only contain up to 16,000 rows.

XLSX sheet can contain much more than 16K rows, the previous format xls was limited to about 65K rows, but xlsx has quite large limits, I recently made a xlsx sheet with this lib that contained more 90k rows, the whole workbook had half a million rows (and over 300 cols).

See https://support.microsoft.com/en-us/office/excel-specifications-and-limits-1672b34d-7043-467e-8e27-269d656771c3 for the limits.

Apache arrow is quite useful as data interchange format and reducing the need to copy data as it's being converted from one format to another, like I have a use-case where another library (perspective) is exporting data in arrow format and I would like to convert it to excel, this is a common use-case in data engine libs like polars/duckdb.

@jmcnamara

Could you give some examples of what you would envisage as the higher level APIs?

Thanks for your interest, I don't have anything concrete in mind, I just worked with this lib and found that for my use case (converting relational data to an excel table with proper formatting/filters), it required a lot of code.

As an example here's the api for creating an excel table in exceljs lib:

https://github.com/exceljs/exceljs?tab=readme-ov-file#tables

The main difference I see is that in the high level api, table creation is just one method call, and has sensible defaults for formatting based on the schema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants