Skip to content

Instantly share code, notes, and snippets.

@kunanit
Created August 2, 2018 18:50
Show Gist options
  • Save kunanit/6ac27276e6ccc10e34e02309ab39303a to your computer and use it in GitHub Desktop.
Save kunanit/6ac27276e6ccc10e34e02309ab39303a to your computer and use it in GitHub Desktop.
Generate slice for every 100th revision
gdoc = gdocrevisions.GoogleDoc(...)
slices = [] # save things here
gdoc.content.reset() # reset document
for i, revision in enumerate(gdoc.revisions):
gdoc.content.apply(revision) # apply revision
if i%100==1: # every 100th revision
slices.append(gdoc.content.render()) # save document state to slices
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment