-
Notifications
You must be signed in to change notification settings - Fork 950
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
Feature Request: Support accessing previous sheet revisions #294
Comments
Looking through the RESTful API (the one gspread uses) and the Apps Script API (JS-based Spreadsheet extensions) I couldn't find support for revision history. That's not to say support for this feature doesn't exist in a Google API but that it likely falls out of scope of this project. One hacky solution would be to snapshot the spreadsheet with a cronjob or some such. You could store these snapshots indexed by date/time and access the revisions that way. Better yet, you could add a hook into your gspread startup that takes a snapshot before any modification can be made to the sheet (assuming you only make modifications through the API). Wish there were a better answer I could give. |
D'oh. Totally missed the Drive RESTful API section on revisions. It seems feasible but would require using the full Drive API instead of just the limited Spreadsheets API. As mentioned in #293, it's possible but represents a very large change in scope and would require some thought. As of now, thanks for bringing this up and I'll mark it as a feature request :-) |
Any updates on the topic? currently doing it with export Links , but it requires further authentication to retrieve the csv of a revision |
Hi @eranmaoz44 I will look into it. The google drive API has now been integrated to Gspread (in order to create/share/delete spreadSheets). It might be possible now to access older revision of a spreadSheet. |
Great news!
…On Fri, May 14, 2021, 11:54 AM Lavigne958 ***@***.***> wrote:
Hi @eranmaoz44 <https://github.com/eranmaoz44> I will look into it. The
google drive API has now been integrated to Gspread (in order to
create/share/delete spreadSheets). It might be possible now to access older
revision of a spreadSheet.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#294 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADALJXT3HMDKNQ5G3VWQC3DTNTQK3ANCNFSM4BPPRX6Q>
.
|
Hi I found the documentation in GoogleAPI about revisions. Here but I can't quiet understand how to use it.
@eranmaoz44 does one of the above API suits what you are looking for ? Looking at it quickly make me think it needs some time to be designed. This returns a complex object and need to be organized but it can sure be done ! 🙂 If you understand the use of the API please help if you can think of some use cases. |
Hey @lavigne958, I think that use-case that was missing at the time / not working was the get_revision_content method. It required an extra authentication step (even though already authenticated via o2auth with the relevant resources) that required you to login again to your google account, or that it didn't work entirely. I can't fully remember since it was almost two years ago and now things may havve changed. The authentication metod used was I think the emphasis should be on getting the content of a revision not only the metadata Update seems completely unnecessary and harmful tbh, a revision should be immutable, if one wishes to update it should be done through the main spreadsheet Furthermore, I think another nice method to have would be to calculate a 'delta' between two revisions. i.e. between revision id=x and revision id=y the field AA changed from 1 to 3 and the field BC was changed from "hello" to "hey" Either that or have a method that that given two dates and a spreadsheet, returns records of the changes with dates, using the underlying diff between every two subsequent revisions Hope that helps, |
Thank you very much for this. I agree what is useful is: getting a spreadSheet at a certain point in time. Computing a delta will come once we do the previous action. Sobfar it looks like something quiet complicated to do and other issues are waiting and PRs too. Until then the issues stays open and any help is welcome 😊 Edit:
What wee need:
|
HI @jkrauska |
I have a use case where it would be helpful to use gspread to compare changes before and after a revision change.
It looks like the Drive API supports retrieving previous revisions of a document.
Could you add this feature request to be able to load a sheet from a previous date.
The text was updated successfully, but these errors were encountered: