FasterCSV 0.2.0 -- The user requests release!

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 K. 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
FCSV(csv = “”) { |csv_str| csv_str << %w{my data here} } # to a
FCSV(STDERR) { |csv_err| csv_err << %w{my data here} } # to

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 F. 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
  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.
  • :headers can now be set to an Array of headers to use.
  • :headers can now be set to an external CSV String of
    headers to use.
  • Added an :unconverted_fields options, so those can be
    when needed.
  • Provided support for the serialization of custom Ruby objects using
  • Added CSV drop-in interface.
  • Added header information to FieldInfo Struct for conversions by
  • Added an alias to support require “fastercsv”.
  • Added FasterCSV::instance and FasterCSV()/FCSV() shortcuts for easy

Migrating from CSV to FasterCSV?

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

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

For quick and dirty switching, try:

require “faster_csv”
rescue LoadError
require “csv”

… use CSV here …

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

[email protected]

Where can I learn more?

FasterCSV is hosted on RubyForge.

Project page:

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:

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

James Edward G. II

Awesome, thank you!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs