Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > [ANN] FasterCSV 1.0.0 -- The "Sorry it's late, Ara" release!

Reply
Thread Tools

[ANN] FasterCSV 1.0.0 -- The "Sorry it's late, Ara" release!

 
 
James Edward Gray II
Guest
Posts: n/a
 
      11-05-2006
FasterCSV 1.0.0 Released
========================

Ara strikes again, adding his second awesome enhancement to
FasterCSV. Here's some example code showing off FasterCSV::Table:

#!/usr/local/bin/ruby -w

# csv_table.rb
#
# Created by James Edward Gray II on 2006-11-04.
# Copyright 2006 Gray Productions. All rights reserved.
#
# Feature implementation and example code by Ara.T.Howard.

require "faster_csv"

table = FCSV.parse(DATA, :headers => true, :header_converters
=> :symbol)

# row access
table[0].class # => FasterCSV::Row
table[0].fields # => ["zaphod", "beeblebrox", "42"]

# column access
table[:first_name] # => ["zaphod", "ara"]

# cell access
table[1][0] # => "ara"
table[1][:first_name] # => "ara"
table[:first_name][1] # => "ara"

# manipulation
table << %w[james gray 30]
table[-1].fields # => ["james", "gray", "30"]

table[:type] = "name"
table[:type] # => ["name", "name", "name"]

table[:ssn] = %w[123-456-7890 098-765-4321]
table[:ssn] # => ["123-456-7890", "098-765-4321", nil]

# iteration
table.each do |row|
# ...
end

table.by_col!
table.each do |col_name, col_values|
# ...
end

# output
puts table
# >> first_name,last_name,age,type,ssn
# >> zaphod,beeblebrox,42,name,123-456-7890
# >> ara,howard,34,name,098-765-4321
# >> james,gray,30,name,

__END__
first_name,last_name,age
zaphod,beeblebrox,42
ara,howard,34

Thank you Ara!

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. (FasterCSV is
larger now,
but considerably richer in features. The parsing core remains
quite small.)
3. Improve on the CSV interface.

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

(highlights from the CHANGELOG)

* The slurping methods now return the new FasterCSV::Table objects.
* Fixed parser so multibyte :col_sep works now.
* Fixed FasterCSV.rewind() to reset the FasterCSV.lineno() counter.
* Fixed FasterCSV.rewind() to reset the header processing.
* Enhanced FasterCSV::Row.fields() to support Ranges, even for headers.
* Added a few examples for usage.

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:

http://www.velocityreviews.com/forums/(E-Mail Removed)

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=5803

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=7740

James Edward Gray II


 
Reply With Quote
 
 
 
 
ara.t.howard@noaa.gov
Guest
Posts: n/a
 
      11-06-2006
On Mon, 6 Nov 2006, James Edward Gray II wrote:

> FasterCSV 1.0.0 Released
> ========================
>
> Ara strikes again, adding his second awesome enhancement to FasterCSV.
> Here's some example code showing off FasterCSV::Table:


rock on james! thanks for letting this into the wild.

kind regards.

-a
--
my religion is very simple. my religion is kindness. -- the dalai lama

 
Reply With Quote
 
 
 
 
Gregory Brown
Guest
Posts: n/a
 
      11-08-2006
On 11/5/06, James Edward Gray II <(E-Mail Removed)> wrote:
> FasterCSV 1.0.0 Released
> ========================
>
> Ara strikes again, adding his second awesome enhancement to
> FasterCSV. Here's some example code showing off FasterCSV::Table:


Congrats on a 1.0 release James! Great work. And Ara, your additions rock.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with fastercsv install ara.t.howard@noaa.gov Ruby 4 03-30-2006 05:50 PM
[ANN] FasterCSV 0.1.6 -- With Header Support! James Edward Gray II Ruby 25 03-10-2006 10:04 PM
FasterCSV col separator Kev Jackson Ruby 1 12-02-2005 03:08 PM
[ANN] Ruport 0.2.9: Taggable DataSets, FasterCSV integration, and Pretty Printing, Oh my! Gregory Brown Ruby 0 11-29-2005 03:49 AM
[ANN] FasterCSV 0.1.3--CSV parsing without the wait! James Edward Gray II Ruby 0 11-16-2005 08:31 PM



Advertisments