Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do we want Google Sheets integration? #49

Open
andymeneely opened this issue Mar 24, 2015 · 8 comments
Open

Do we want Google Sheets integration? #49

andymeneely opened this issue Mar 24, 2015 · 8 comments
Labels

Comments

@andymeneely
Copy link
Owner

Much like xlsx and csv, maybe a method to get data from Google Sheets?

Pros:

  • Many people often use Google Sheets more than Excel these days.

Cons:

  • Yet another dependency
  • Chasing Google's ever-changing APIs

Thoughts? Post your votes here!

@evolve2k
Copy link

I would love this!
Im building our game with a team and we're using google sheets, I've been having to periodically download the sheets into csv and copy them to the project. This would be a great addition.

@andymeneely
Copy link
Owner Author

Thanks for the vote!

I should also point out that we had someone write up a workaround for now: http://andymeneely.github.io/squib/doc/file.README.html#Using_Google_Sheets

Let me know if it doesn't work, though. Google keeps changing its apis.

@bcompter
Copy link

bcompter commented Oct 9, 2015

Love the idea. I use sheets for all of my development now.

@andymeneely
Copy link
Owner Author

It's not looking good for Ruby+Google these days. Google has changed their API and usage rules a lot lately, and I haven't seen any Ruby gems make a concerted effort to keep up.

Google also now requires things like API keys and OAuth, which complicates the process much more than most Squibbers have the stomach for.

But if someone else wants to take that on, it doesn't have to integrate with Squib at all - it could just be a general exporter. I would love to be proven wrong.

@yipcma
Copy link

yipcma commented Oct 16, 2017

perhaps a good time to revisit this issue?
https://developers.google.com/sheets/api/quickstart/ruby

@yipcma
Copy link

yipcma commented Oct 16, 2017

there's also this gem
http://www.rubydoc.info/gems/google_drive/GoogleDrive/Spreadsheet

But basically all one needs is a in ruby way of downloading a .csv from google sheet

@andymeneely
Copy link
Owner Author

Yeah that google_drive gem is the one I was using a while back. I'm glad to see it's back to being regularly updated now.

Honestly, while I know folks would love to have this built into Squib, I'm not quite ready to support it. The OAuth steps, while simple for some folks, can be a little daunting for some and I'm not ready to put the support effort into that.

If someone wants to make this happen, it's easy enough to define your own method that works a lot like the Excel parser. You can always post that as a Gist or on this issue. Or, better yet, you can maintain your own gem called squib_google or something.

If that code gets used a lot and maintaining is easy, then I'd be willing to put it into Squib.

@bbugh
Copy link

bbugh commented Oct 20, 2017

You can use Publish to the web... functionality in Google Sheets to make an url that returns CSV.

In Google Sheets:

  1. File -> Publish to the web...
  2. Pick the sheet you want to publish
  3. Pick the format you want to publish (CSV in this case)
  4. Click Publish
  5. Copy the link that it generates

That link is now something you can curl or directly import from Ruby. Note that it doesn't re-publish immediately, it can take up to a minute or two, so it's not great for rapid iteration. It's usually pretty fast though.

Here's how you'd do it in Squib:

require 'net/http'
uri = URI("https://docs.google.com/spreadsheets/d/e/YOUR_GOOGLE_LINK/pub?gid=0&single=true&output=csv")
data = Squib.csv data: Net::HTTP.get(uri)

It's what I'm using and it works great.

Just say NO to Google APIs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 📋 Backlog
Development

No branches or pull requests

5 participants