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

Discussion in 'Ruby' started by James Edward Gray II, Nov 5, 2006.

  1. 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:



    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
     
    James Edward Gray II, Nov 5, 2006
    #1
    1. Advertising

  2. James Edward Gray II

    Guest

    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
     
    , Nov 6, 2006
    #2
    1. Advertising

  3. On 11/5/06, 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:


    Congrats on a 1.0 release James! Great work. And Ara, your additions rock.
     
    Gregory Brown, Nov 8, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. James Edward Gray II
    Replies:
    0
    Views:
    95
    James Edward Gray II
    Nov 16, 2005
  2. Gregory Brown
    Replies:
    0
    Views:
    94
    Gregory Brown
    Nov 29, 2005
  3. Kev Jackson

    FasterCSV col separator

    Kev Jackson, Dec 2, 2005, in forum: Ruby
    Replies:
    1
    Views:
    241
    James Edward Gray II
    Dec 2, 2005
  4. James Edward Gray II

    [ANN] FasterCSV 0.1.6 -- With Header Support!

    James Edward Gray II, Feb 26, 2006, in forum: Ruby
    Replies:
    25
    Views:
    268
    Sky Yin
    Mar 10, 2006
  5. James Gray
    Replies:
    1
    Views:
    109
    Lloyd Linklater
    Sep 12, 2008
Loading...

Share This Page