@@ -0,0 +1,1052 @@
+from __future__ import print_function%0Afrom apiclient import discovery%0Afrom httplib2 import Http%0Afrom oauth2client import client%0Afrom oauth2client import file%0Afrom oauth2client import tools%0Aimport json%0A%0A# Set doc ID, as found at %60https://docs.google.com/document/d/YOUR_DOC_ID/edit%60%0ADOCUMENT_ID=YOUR_DOC_ID%0A%0A# Set the scopes and discovery info%0ASCOPES = 'https://www.googleapis.com/auth/documents.readonly'%0ADISCOVERY_DOC = 'https://docs.googleapis.com/$discovery/rest?version=v1&key=%3CYOUR_API_KEY%3E'%0A%0A# Initialize credentials and instantiate Docs API service%0Astore = file.Storage('token.json')%0Acreds = store.get()%0Aif not creds or creds.invalid:%0A    flow = client.flow_from_clientsecrets('credentials.json', SCOPES)%0A    creds = tools.run_flow(flow, store)%0Aservice = discovery.build('docs', 'v1', http=creds.authorize(%0A    Http()), discoveryServiceUrl=DISCOVERY_DOC)%0A%0A# Do a document %22get%22 request and print the results as formatted JSON%0Aresult = service.documents().get(documentId=DOCUMENT_ID).execute()%0Aprint(json.dumps(result, indent=4, sort_keys=True))%0A

Create output-json.py (#98)