Sha256: d50f6485ef6e80617b695b842d2698fd9dc19389cc1806a5fdfd7de55fb151a5

Contents?: true

Size: 1.54 KB

Versions: 33

Compression:

Stored size: 1.54 KB

Contents

=remote_table

Remotely open and parse Excel XLS, ODS, CSV and fixed-width tables.

==Real-life usage

Used by data_miner (http://github.com/seamusabshere/data_miner)

==Example

Taken from <tt>#{GEMDIR}/test/remote_table_test.rb</tt>:

  >> t = RemoteTable.new(:url => 'http://www.fueleconomy.gov/FEG/epadata/98guide6.zip', :filename => '98guide6.csv')
  => #<RemoteTable:0x359da50 @transform=#<RemoteTable::Transform:0x359d154 @select=nil, @reject=nil>, @file=#<RemoteTable::File:0x35970c4 @delimiter=nil, @headers=nil, @cut=nil, @filename="98guide6.csv", @skip=nil, @schema_name=nil, @crop=nil, @format=:csv, @trap=nil, @sheet=0, @schema=nil>, @package=#<RemoteTable::Package:0x359c538 @url="http://www.fueleconomy.gov/FEG/epadata/98guide6.zip", @filename="98guide6.csv", @compression=:zip, @packing=nil>, @request=#<RemoteTable::Request:0x3596bec @url="http://www.fueleconomy.gov/FEG/epadata/98guide6.zip">>
  >> t.rows.first
  => {"cyl"=>"6", "eng dscr"=>"DOHC VTEC", "trans dscr"=>"2MODE CLKUP", "trans"=>"Auto(L4)", "cmb"=>"20", "2pv"=>nil, "carline name"=>"NSX", "displ"=>"3.0", "ucmb"=>"23.5311", "hpv"=>nil, "4pv"=>nil, "Class"=>"TWO SEATERS", "Manufacturer"=>"ACURA", "fl"=>"P", "2lv"=>nil, "G"=>nil, "hlv"=>nil, "drv"=>"R", "cty"=>"18", "ucty"=>"19.8733", "S"=>nil, "4lv"=>nil, "fcost"=>"1050", "T"=>nil, "hwy"=>"24", "uhwy"=>"30.3612"}

See the test file and also data_miner examples of custom parsers.

==Authors

* Seamus Abshere <seamus@abshere.net>
* Andy Rossmeissl <andy@rossmeissl.net>

== Copyright

Copyright (c) 2010 Brighter Planet. See LICENSE for details.

Version data entries

33 entries across 33 versions & 2 rubygems

Version Path
remote_table-0.2.32 README.rdoc
remote_table-0.2.31 README.rdoc
remote_table-ruby19-0.2.30 README.rdoc
remote_table-0.2.30 README.rdoc
remote_table-0.2.29 README.rdoc
remote_table-0.2.28 README.rdoc
remote_table-0.2.27 README.rdoc
remote_table-0.2.26 README.rdoc
remote_table-0.2.24 README.rdoc
remote_table-0.2.23 README.rdoc
remote_table-0.2.22 README.rdoc
remote_table-0.2.21 README.rdoc
remote_table-0.2.20 README.rdoc
remote_table-0.2.19 README.rdoc
remote_table-0.2.18 README.rdoc
remote_table-0.2.17 README.rdoc
remote_table-0.2.16 README.rdoc
remote_table-0.2.15 README.rdoc
remote_table-0.2.14 README.rdoc
remote_table-0.2.13 README.rdoc