2 ms·
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
by asadjb 6y 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 https://github.com/python/cpython/blob/3.8/Lib/csv.py
[2] https://github.com/python/cpython/blob/4a21e57fe55076c77b0ee454e1994ca544d09dc0/Modules/_csv.c https://github.com/python/cpython/blob/4a21e57fe55076c77b0ee...
- JoBrad 6y agoI 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.