Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mericson/tablespoon

Use Google Spreadsheets as your CMS
https://github.com/mericson/tablespoon

Last synced: about 2 months ago
JSON representation

Use Google Spreadsheets as your CMS

Awesome Lists containing this project

README

        

= tablespoon

Access Google Spreadsheets in a vaguely record-like way.

== Requirements

* Google Spreadsheet that is organized like a database table. Fieldnames in the first row, records in the rest of the rows.

== Installation

sudo gem install tablespoon

== How to Use

require 'rubygems'
require 'tablespoon'

Connect to a Google doc

doc = Tablespoon::Doc.new( "0ArhhvPZdTe-WdGpZQ3pEY1hDcEUxWmxwNnJEQ3g4aVE",
:username => google_username, :password => google_password )

Get a worksheet either by name or by id. (Coming soon: Optionally, declare an id field so you can find rows by id later.)

rows = doc.get_table 'Sheet1', :id_field => 'last-name'

Loop thru rows and retrieve data

rows.each do |r|
puts r['full-name']
end

Modify fields and save data back to the spreadsheet.

rows.each do |r|
r['full-name'] = r['full-name'].upcase
end

== Copyright

Copyright (c) 2013 Matt Ericson. See LICENSE.txt for
further details.