22 ms·
Isn’t this already in the csv module with dictreader? Xlsx I know nothing about.
by gpapilion 5y ago
Isn’t this already in the csv module with dictreader?
Xlsx I know nothing about.
- werds 5y agoyes. if you are only going to be working with CSV files then this is overkill
- pytlicek 5y agoIt is true. I usually use it in tandem with flask / fast-api to parse both: CSV and XLSX. In the near future I will add XLS (yes, someone still uses it) and also the open document format.
- thebigspacefuck 5y agoopenpyxl has good xlsx support and is easy to use. This seems to be an abstraction layer on top of both. Unfortunately this will use a lot of RAM working with large files.
- dragonwriter 5y agoThere are several light (compared to pandas) xlsx/xls libraries for Python, but none that I know of have a simple read-to-dict API.
- barbazoo 5y agoCorrect, it's a wrapper around csv.DictReader https://github.com/Pytlicek/sheet2dict/blob/main/sheet2dict/main.py#L51 https://github.com/Pytlicek/sheet2dict/blob/main/sheet2dict/...