polars icon indicating copy to clipboard operation
polars copied to clipboard

Read Excel Files in Rust using Polars

Open datainvestor opened this issue 3 years ago • 9 comments

So I am trying to use Polars and Rust for DataFrames and I think the biggest thing missing is the ability to read excel file and save it as dataframe in Rust. I am talking here about Rust version of Polars not Python where you can use Pandas to read in excel file into dataframe and then convert it to polars.

So I think this feature would be a great thing to add in Polars as this is something that could see a great performance improvement over the Python libraries.

datainvestor avatar Dec 20 '21 10:12 datainvestor

Fow at least now you will need to implement your own reader. You can try it with: https://docs.rs/calamine/latest/calamine

ghuls avatar Dec 20 '21 10:12 ghuls

You can use QSV to read a sheet of an Excel file to CSV and read that one with polars: https://github.com/jqnatividad/qsv

They use the Calamine crate: https://github.com/jqnatividad/qsv/blob/master/src/cmd/excel.rs#L11

ghuls avatar Apr 14 '22 15:04 ghuls

This has been implemented in #3567 (early June), so closing this issue.

zundertj avatar Aug 13 '22 10:08 zundertj

@zundertj , the issue is about raeding xlsx files in rust, where the referred implementaiton is for python

sayyedkamran avatar Oct 21 '23 17:10 sayyedkamran

Reading xlsx in Rust (not python) is prefered because lots of data are pre-existed in excel.

wangjiawen2013 avatar Oct 25 '23 06:10 wangjiawen2013

Reopening, as we are considering adding this feature natively in Rust (though we have no timeline for it yet).

alexander-beedie avatar Jan 26 '24 07:01 alexander-beedie

Reopening, as we are considering adding this feature natively in Rust (though we have no timeline for it yet).

Hello @alexander-beedie, I was wondering if this feature was still under consideration?

Thanks, Chris

CHRISCARLON avatar Jul 11 '24 21:07 CHRISCARLON

Hello everyone. I am new to Polars, intermediate to Rust. As I see (current versions) there is no integrated Rust Polars API available to read Excel files. Is this correct, yes? Is the current suggestion therefore is to use the Rust crate [https://docs.rs/calamine/latest/calamine/index.html#] calamine ? And then use my own custom Rust code to make a Polars DataFrame(s) from whatever shape the calamine returns the Excel data using Rust? Thank you.

yuribudilov avatar Jul 20 '24 03:07 yuribudilov