Sha256: 1666ea19a303df54ce9bad7cdf02fcd8ab8c5cc036f1d6dc9e1ee9669e4d353b
Contents?: true
Size: 1.17 KB
Versions: 7
Compression:
Stored size: 1.17 KB
Contents
ElectricUtility.class_eval do data_miner do import 'EIA Form 861 records from 2010 (revised)', :url => 'http://www.eia.gov/Ftproot/pub/electricity/f86110.zip', :filename => 'file1_2010.xls', :skip => 7, :errata => { :url => "file://#{Earth::ERRATA_DIR}/electricity/electric_utility/eia_errata.csv" } do key 'eia_id', :field_name => 'UTILITY_ID' store 'name', :field_name => 'UTILITY_NAME' store 'state_postal_abbreviation', :field_name => 'MAIL_STATE', :nullify => true store 'nerc_region_abbreviation', :synthesize => proc { |row| (first_nerc = row['NERC_LOCATION'].match(/^(\w+)/))? first_nerc.captures[0] : nil } store 'second_nerc_region_abbreviation', :synthesize => proc { |row| (second_nerc = row['NERC_LOCATION'].match(/^\w+ ?[&,\/] ?(\w+)$/)) ? second_nerc.captures[0] : nil } end import 'aliases', :url => 'https://docs.google.com/spreadsheet/pub?key=0AtyCBJLCFHlwdEM5WjVxRjBKWVJRcTJ3c1BhUnlSVXc&single=true&gid=0&output=csv' do key 'eia_id', :field_name => 'utility_id' store 'nickname', :field_name => 'alias' end end end
Version data entries
7 entries across 7 versions & 1 rubygems