Giter VIP home page Giter VIP logo

google-spreadsheet-ruby's Introduction

This is a Ruby 1.8/1.9 library to read/write Google Spreadsheet.

How to install

$ sudo gem install google-spreadsheet-ruby

Note that gimite-google-spreadsheet-ruby at gems.github.com is no longer updated, because github stopped hosting it.

How to use

Example:

require "rubygems"
require "google_spreadsheet"

# Logs in.
# You can also use OAuth. See document of GoogleSpreadsheet.login_with_oauth for details.
session = GoogleSpreadsheet.login("[email protected]", "mypassword")

# First worksheet of http://spreadsheets.google.com/ccc?key=pz7XtlQC-PYx-jrVMJErTcg&hl=en
ws = session.spreadsheet_by_key("pz7XtlQC-PYx-jrVMJErTcg").worksheets[0]

# Gets content of A2 cell.
p ws[2, 1] #==> "hoge"

# Changes content of cells. Changes are not sent to the server until you call ws.save().
ws[2, 1] = "foo"
ws[2, 2] = "bar"
ws.save()

# Dumps all cells.
for row in 1..ws.num_rows
  for col in 1..ws.num_cols
    p ws[row, col]
  end
end

# Yet another way to do so.
p ws.rows #==> [["fuga", ""], ["foo", "bar]]

# Reloads the worksheet to get changes by other clients.
ws.reload()

API document: gimite.net/gimite/rubymess/google-spreadsheet-ruby/

Source code

github.com/gimite/google-spreadsheet-ruby

The license of this source is “New BSD Licence”

Supported environments

Ruby 1.8.x and Ruby 1.9.x. Checked with Ruby 1.8.7 and Ruby 1.9.3.

Author

Hiroshi Ichikawa - gimite.net/en/index.php?Contact

google-spreadsheet-ruby's People

Contributors

bpot avatar er1c avatar gimite avatar iamruinous avatar nalanj avatar norgg avatar sirupsen avatar stympy avatar swhitt avatar wkang avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.