gesistsa / rio

🐟 A Swiss-Army Knife for Data I/O
http://gesistsa.github.io/rio/
600 stars 76 forks source link

import from google sheets #60

Closed chainsawriot closed 8 years ago

chainsawriot commented 8 years ago

https://github.com/maxconway/gsheet https://github.com/jennybc/googlesheets

Should we implement this?

e.g.

import("https://docs.google.com/spreadsheets/d/1I9mJsS5QnXF2TNNntTy-HrcdHmIF9wJ8ONYvEJTXSNo/edit#gid=0")
leeper commented 8 years ago

This is a good idea, but I'm hesitant to add a dependency here (those packages have a lot of functionality we don't need just for an import). I think we should be able to identify a spreadsheets URL and then modify it to retrieve the sheet as either XLSX or CSV by appending a format= argument to the URL:

Are Google Spreadsheets URLs always of a standardized form (so we can, for example, regex them)?

jennybc commented 8 years ago

When I revisit googlesheets in the new year, I can try to give you a clean function to do as you say above. You should be able to offer some simple read functionality (as csv and xlsx, at the least) for Sheets that do not require auth w/o needing to depend on googlesheets.

leeper commented 8 years ago

@jennybc :+1:

chainsawriot commented 8 years ago

https://github.com/maxconway/gsheet/blob/master/R/gsheet2text.R

This is the Google Sheets URL parser from the gsheet package. It can be rewritten without rvest and stringr dependency. rvest is only use to check the sheet has been shared or not and those stringr operations can be rewritten with base regex functions.

leeper commented 8 years ago

Closed by https://github.com/leeper/rio/pull/63

leeper commented 8 years ago

This was great! Really nice addition!