Hacker News new | ask | show | jobs
by asadjb 2229 days ago
My initial comment was going to be that "The Python CSV library is only 448 lines (378 LOC) [1]".

Only later did I realize that the bulk of the work is done by the C library, which is ~1500 LOC [2].

I guess parsing CSVs reliably is a reasonably difficult undertaking.

[1] https://github.com/python/cpython/blob/3.8/Lib/csv.py [2] https://github.com/python/cpython/blob/4a21e57fe55076c77b0ee...

1 comments

I have a base “library” I’ve used for several years that wraps the csv module (specifically DictReader/Writer) to handle encoding issues as well as data parsing. Have run into minor issues, but think that module alone is one of Python’s best use-cases.