[Csv] CSV implementation in C

Skip Montanaro skip.montanaro at gmail.com
Sat Feb 15 06:54:03 EST 2020


(Apologies for not responding directly to Max's email. It got stuck in the
moderation queue and I no longer know the admin password for the group to
release it. I stumbled on his messages while reviewing messages held by
SpamBayes.)

Max wrote two messages, this:

> I've written CSV implementation in ANSI C. It works very fast and
> requires no dependencies. Is there's a way to use C functions from
> inside python?

and this:

> I see the last post from 2013. Is this group still active?
> What about current implementation of CSV in Python. It's the most
> efficient version or it could be replaced with C implementation?

As you noticed, the csv at python.org mailing list is more-or-less defunct. It
was developed during the original development of Python's csv module, but
has been idle for years. I should probably ask to have it decommissioned.
Python's csv module is written in C and is reasonably efficient.*

As for how to call your CSV library functions from Python, you could write
your own extension module. You could also use the ctypes module
<https://docs.python.org/3.8/library/ctypes.html> to interact with your
library's raw C API. If you have questions about that, you're almost
certainly going to get more useful help from python-list at python.org.

Skip Montanaro

* The Pandas people have their own implementations (one in Python, one in
C). I'm not sure if they fall back to Python's csv module for the C
implementation or not. Their Python implementation has more features which
stray from the Excel-based definition of "CSV" which better suit the needs
of the scientific community.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/csv/attachments/20200215/5638eded/attachment.html>


More information about the Csv mailing list