Forum: Ruby FasterCSV 0.2.0 -- The user requests release!

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
4299e35bacef054df40583da2d51edea?d=identicon&s=25 James Gray (bbazzarrakk)
on 2006-04-01 22:42
(Received via mailing list)
FasterCSV 0.2.0 Released
========================

FasterCSV has a ton of new features from requests (some even provided
patches) by you!  It's very  hard for me to pick what to show off
here, but if I had to pick two favorites it would be using an Array
of headers and the new shortcut interface.

Since 0.1.6, FasterCSV has allowed named access for columns.  Now you
can say goodbye to indexes altogether as Dakshinamurthy Karra has
sent in a patch allowing you to specify an Array of headers to use
for any document.  Just setup the headers when you create the
instance and it's nothing but names you'll have to worry about from
then on.

Ara.T.Howard also sent in a patch for a short but powerful interface
extension.  Check this out:

   FCSV            { |csv_out| csv_out << %w{my data here} }  # to
STDOUT
   FCSV(csv = "")  { |csv_str| csv_str << %w{my data here} }  # to a
String
   FCSV(STDERR)    { |csv_err| csv_err << %w{my data here} }  # to
STDERR

You can wrap IO objects with that, change options, or whatever.  It
also caches the instance so subsequent calls won't invent another
FasterCSV object.

There's a lot more in this release though, including serialization
similar to what Hal Fulton described in his metaprogramming article
and a CSV compatibility layer for easy transitioning.

If you work with CSV data, you want to download this release, trust me!

What is FasterCSV?
------------------

(from the README)

FasterCSV is intended as a replacement to Ruby's standard CSV
library.  It was designed to address concerns users of that library
had and it has three primary goals:

1.  Be significantly faster than CSV while remaining a pure Ruby
library.
2.  Use a smaller and easier to maintain code base.  (We're about
even now,
     but not if you compare the features!)
3.  Improve on the CSV interface.

What's New?
-----------

(highlights from the CHANGELOG)

* Made FasterCSV#lineno CSV aware.
* Added line numbers to MalformedCSVError messages.
* <tt>:headers</tt> can now be set to an Array of headers to use.
* <tt>:headers</tt> can now be set to an external CSV String of
headers to use.
* Added an <tt>:unconverted_fields</tt> options, so those can be
returned
   when needed.
* Provided support for the serialization of custom Ruby objects using
CSV.
* Added CSV drop-in interface.
* Added header information to FieldInfo Struct for conversions by
header.
* Added an alias to support <tt>require "fastercsv"</tt>.
* Added FasterCSV::instance and FasterCSV()/FCSV() shortcuts for easy
output.

Migrating from CSV to FasterCSV?
--------------------------------

The README includes a section on the differences and you can read
that here:

http://fastercsv.rubyforge.org/

You call also see general usage in the documentation of the
interface, right here:

http://fastercsv.rubyforge.org/classes/FasterCSV.html

For quick and dirty switching, try:

   begin
     require "faster_csv"
     FasterCSV.build_csv_interface
   rescue LoadError
     require "csv"
   end
   # ... use CSV here ...

If FasterCSV isn't meeting your needs, I want to here about it:

james@grayproductions.net

Where can I learn more?
-----------------------

FasterCSV is hosted on RubyForge.

Project page:   http://rubyforge.org/projects/fastercsv/
Documentation:  http://fastercsv.rubyforge.org/
Downloads:      http://rubyforge.org/frs/?group_id=1102

How do I get FasterCSV?
-----------------------

FasterCSV is a gem, so as long as you have RubyGems installed it's as
simple as:

$ sudo gem install fastercsv

If you need to install RubyGems, you can download it from:

http://rubyforge.org/frs/?group_id=126&release_id=2471

FasterCSV can also be installed manually.  Just download the latest
release and follow the instructions in INSTALL:

http://rubyforge.org/frs/?group_id=1102&release_id=4758

James Edward Gray II
E75cda3e915fa209386fae3de962cb6a?d=identicon&s=25 Michael Schoen (Guest)
on 2006-04-02 16:45
(Received via mailing list)
Awesome, thank you!
This topic is locked and can not be replied to.