csvreader v1.0 - read tabular comma-separated values (csv) the right way (incl. hash readers, converters, enumerables, dialects, and more)

23 views
Skip to first unread message

Gerald Bauer

unread,
Oct 9, 2018, 11:29:47 AM10/9/18
to www...@googlegroups.com
Hello,

I've uploaded [version 1.0 of the new comma-separated values
csvreader library / gem [1] that lets you read tabular data in the
comma-separated values (csv) format the right way :-), that is, the
basic methods such as `Csv.read `or `CsvHash.read` use best practices
out-of-the-box with zero-configuration.

Under the hood the new library includes purpose-built "backend"
parsers (e.g. `ParserStd`, `ParserStrict`, `ParserTab`, etc.) so you
can handle all the popular comma-separated values (csv) formats / dialects such
as MySQL (use `Csv.mysql.read`) or PostgreSQL (use
`Csv.postgres.read`) exports and more using unix-style escapes and
`\N` or unquoted empty values for null/nil and so on.

Data is the new gold :-) Happy data / gold mining with the new
csvreader library / gem (in ruby). Cheers. Prost.

PS: [What's wrong (broken) in the standard csv library? See the let's
count the ways article series [2].

[1]: https://github.com/csv11/csvreader
[2]: https://github.com/csv11/docs

Peter Boling

unread,
Oct 14, 2018, 11:02:01 AM10/14/18
to wwwmake
I really like the documentation on the project, and after reading through it I wandered over to the csv11 organization, and looked through some of the other projects.  I found a library called csv11 (which says it is a gem, but has no gemspec?).  The short description of the project makes it sounds very similar to csvreader.  It looks like you developed both of them, and around the same time.  Can you elaborate on the relationship?  Is csv11 an early aborted attempt?  Does one underpin the other?

Gerald Bauer

unread,
Oct 14, 2018, 11:14:50 AM10/14/18
to www...@googlegroups.com
Hello,
Thanks for your kind words. Sorry for the confusion. It all
started with csv 1.1, thus, the csv11 org.

> it is a gem, but has no gemspec?

All gems (100+) that help to maintain use rake tasks (with hoe) to
"manage" the gemspec, releases, etc. use:

$ rake debug_gem # to generate auto-generate the gemspec

For the the "long" story, see the (online, free) booklet title
"Hoe Developer's Guide - Build, Package and Publish Gems with Rake
Tasks - Ready-to-Use Build Scripts (Book Edition)" [1]

> csv11 an early aborted attempt?

Yes, the csv11 library / gem is an in-progress under-construction
attempt for a "generic" csv version 1.1 parser - the worlddb, sportdb
etc. already use variants that live inside the textutils library / gem
[2]

> Does one [csv11] underpin the other [csvreader]?

No, they are completly separate. The "newer" csvreader is now
version 1.0 and "production-ready".
It reads csv in "v1.0" variants e.g. classic, excel, postgres,
numeric and more.

Yes, it's built on purpose to add your own parser. I try to add the
csv <3 json format next [3]
and eventually v1.1 too (but that is a long way off as the v1.1
format / parser is not yet ready (see above) and there's only so much
I can do.

Hope that answers your questions. All the best. Cheers. Prost.

[1] http://yukimotopress.github.io/gem-tasks
[2] https://github.com/textkit/textutils
[3] https://github.com/csv11/csv-json
Reply all
Reply to author
Forward
0 new messages