Do Google Doc features really impact the community enough warrant a post? Just seems like marketing to me.
The cool thing about HN is that, by its very nature, any post that gets voted to the front page is warranted.
Google Docs gets an API for task automation
31–40 of 199 posts
Re: Google Docs gets an API for task automation
#32They will have a lot of catchup to do to get where Office is now. I'm frankly amazed by how good Microsoft Flow has been. So many dumb business processes rely on an Excel doc somewhere, or a stupid manual email somewhere else. But with Flow I've seen just a single smarty-pants able to fully streamline an entire department one rule at a time. They don't need to get permission to bring in a new logo - it's part of Offi…
Is it still very desktop centric as all MS Office products? Because if it is you will struggle to keep up with the amount of data, report and automation that need to run on top of various cloud applications.
Re: Google Docs gets an API for task automation
#33I've been looking for a sophisticated way to automatically generate documents for a while (formulas, data tables) with the addition of one crucial feature that I haven't been able to find just yet: the ability to generate a document in addition to allow human editing. For example, this is my desired workflow, Step 1, create a document automatically, Step 2, allow humans to begin editing with tracked changes, and Step…
For Steps 1 & 2 have you looked into generating markup and using Pandoc to convert to, e.g. Word files? https://pandoc.org/
Re: Google Docs gets an API for task automation
#34We spent a lot of time and money building a document generation add-on to our platform. It seems that money might have been better used elsewhere!
Did you look into it already? I have yet to understand what new stuff is there and what old stuff has just been repackaged into "office automation"
Re: Google Docs gets an API for task automation
#35By definition, credentials.json doesn't exist yet and this throws an error. Transcript below.
creds = None
if os.path.exists('token.pickle'):
...
# If there are no (valid) credentials available, let the user log in.
if not creds or not creds.valid:
if creds and creds.expired and creds.refresh_token:
...
else:
flow = InstalledAppFlow.from_client_secrets_file(
'credentials.json', SCOPES)
creds = flow.run_local_server()
https://developers.google.com/docs/api/quickstart/python$ sudo apt install python3-pip Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: grub-pc-bin libpython-all-dev libpython-dev libpython2.7 libpython2.7-dev python-all python-all-dev python-asn1crypto python-cffi-backend python-crcmod python-crypto python-cryptography python-dbus python-dev python-enum34 python-gi python-idna python-ipaddress python-keyring python-keyrings.alt python-secretstorage python-six python-wheel python-xdg python2.7-dev Use 'sudo apt autoremove' to remove them. The following NEW packages will be installed: python3-pip 0 upgraded, 1 newly installed, 0 to remove and 11 not upgraded. Need to get 114 kB of archives. After this operation, 599 kB of additional disk space will be used. Get:1 http://us-east4-c.gce.clouds.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 python3-pip all 9.0.1-2.3~ubuntu1 [114 kB] Fetched 114 kB in 1s (175 kB/s) Selecting previously unselected package python3-pip. (Reading database ... 128010 files and directories currently installed.) Preparing to unpack .../python3-pip_9.0.1-2.3~ubuntu1_all.deb ... Unpacking python3-pip (9.0.1-2.3~ubuntu1) ... Setting up python3-pip (9.0.1-2.3~ubuntu1) ... Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
$ pip3 install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib Collecting google-api-python-client Downloading https://files.pythonhosted.org/packages/55/e9/e8fb2e3a031cb6... (56kB) 100% || 61kB 3.1MB/s Collecting google-auth-httplib2 Using cached https://files.pythonhosted.org/packages/33/49/c814d6d438b823... Collecting google-auth-oauthlib Using cached https://files.pythonhosted.org/packages/46/df/d1f94ee2cffe5a... Collecting six=1.6.1 (from google-api-python-client) Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1... Collecting httplib2=0.9.2 (from google-api-python-client) Using cached https://files.pythonhosted.org/packages/ce/ed/803905d670b52f... Collecting uritemplate=3.0.0 (from google-api-python-client) Downloading https://files.pythonhosted.org/packages/e5/7d/9d5a640c4f8bf2... Collecting google-auth>=1.4.1 (from google-api-python-client) Using cached https://files.pythonhosted.org/packages/4e/85/71b2dfbf5b4241... Collecting requests-oauthlib>=0.7.0 (from google-auth-oauthlib) Using cached https://files.pythonhosted.org/packages/c2/e2/9fd03d55ffb70f... Collecting cachetools>=2.0.0 (from google-auth>=1.4.1->google-api-python-client) Using cached https://files.pythonhosted.org/packages/39/2b/d87fc2369242bd... Collecting pyasn1-modules>=0.2.1 (from google-auth>=1.4.1->google-api-python-client) Using cached https://files.pythonhosted.org/packages/da/98/8ddd9fa4d84065... Collecting rsa>=3.1.4 (from google-auth>=1.4.1->google-api-python-client) Using cached https://files.pythonhosted.org/packages/02/e5/38518af393f7c2... Collecting oauthlib>=3.0.0 (from requests-oauthlib>=0.7.0->google-auth-oauthlib) Using cached https://files.pythonhosted.org/packages/16/95/699466b05b72b9... Collecting requests>=2.0.0 (from requests-oauthlib>=0.7.0->google-auth-oauthlib) Using cached https://files.pythonhosted.org/packages/7d/e3/20f3d364d6c8e5... Collecting pyasn1=0.4.1 (from pyasn1-modules>=0.2.1->google-auth>=1.4.1->google-api-python-client) Using cached https://files.pythonhosted.org/packages/7b/7c/c9386b82a25115... Collecting urllib3=1.21.1 (from requests>=2.0.0->requests-oauthlib>=0.7.0->google-auth-oauthlib) Using cached https://files.pythonhosted.org/packages/62/00/ee1d7de624db8b... Collecting certifi>=2017.4.17 (from requests>=2.0.0->requests-oauthlib>=0.7.0->google-auth-oauthlib) Using cached https://files.pythonhosted.org/packages/9f/e0/accfc1b56b57e9... Collecting chardet=3.0.2 (from requests>=2.0.0->requests-oauthlib>=0.7.0->google-auth-oauthlib) Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e42... Collecting idna=2.5 (from requests>=2.0.0->requests-oauthlib>=0.7.0->google-auth-oauthlib) Using cached https://files.pythonhosted.org/packages/14/2c/cd551d81dbe152... Building wheels for collected packages: httplib2 Running setup.py bdist_wheel for httplib2 ... done Stored in directory: /home/asah/.cache/pip/wheels/6d/41/4b/2b369d6e2b7eaebcdd423516d3fb659c7658c16a2be8fd04ec Successfully built httplib2 Installing collected packages: six, httplib2, cachetools, pyasn1, pyasn1-modules, rsa, google-auth, google-auth-httplib2, uritemplate, google-api-python-client, oauthlib, urllib3, certifi, chardet, idna, requests, requests-oauthlib, google-auth-oauthlib Successfully installed cachetools-3.1.0 certifi-2018.11.29 chardet-3.0.4 google-api-python-client-1.7.8 google-auth-1.6.2 google-auth-httplib2-0.0.3 google-auth-oauthlib-0.2.0 httplib2-0.12.0 idna-2.8 oauthlib-3.0.1 pyasn1-0.4.5 pyasn1-modules-0.2.4 requests-2.21.0 requests-oauthlib-1.2.0 rsa-4.0 six-1.12.0 uritemplate-3.0.0 urllib3-1.24.1
$ python quickstart.py InstalledAppFlow.from_client_secrets_file()... Traceback (most recent call last): File "quickstart.py", line 47, in main() File "quickstart.py", line 32, in main 'credentials.json', SCOPES) File "/home/asah/.local/lib/python2.7/site-packages/google_auth_oauthlib/flow.py", line 171, in from_client_secrets_file with open(client_secrets_file, 'r') as json_file: IOError: [Errno 2] No such file or directory: 'credentials.json'
$ cat quickstart.py from __future__ import print_function import pickle import os.path from googleapiclient.discovery import build from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Request
# If modifying these scopes, delete the file token.pickle. SCOPES = ['https://www.googleapis.com/auth/documents.readonly']
# The ID of a sample document. DOCUMENT_ID = '195j9eDD3ccgjQRttHhJPymLJUCOUjs-jmwTrekvdjFE'
def main(): """Shows basic usage of the Docs API. Prints the title of a sample document. """ creds = None # The file token.pickle stores the user's access and refresh tokens, and is # created automatically when the authorization flow completes for the first # time. if os.path.exists('token.pickle'): with open('token.pickle', 'rb') as token: creds = pickle.load(token) # If there are no (valid) credentials available, let the user log in. if not creds or not creds.valid: if creds and creds.expired and creds.refresh_token: creds.refresh(Request()) else: print("InstalledAppFlow.from_client_secrets_file()...") flow = InstalledAppFlow.from_client_secrets_file( 'credentials.json', SCOPES) creds = flow.run_local_server() # Save the credentials for the next run with open('token.pickle', 'wb') as token: pickle.dump(creds, token)
service = build('docs', 'v1', credentials=creds)
# Retrieve the documents contents from the Docs service.
document = service.documents().get(documentId=DOCUMENT_ID).execute()
print('The title of the document is: {}'.format(document.get('title')))
if __name__ == '__main__':
main()Re: Google Docs gets an API for task automation
#36They will have a lot of catchup to do to get where Office is now. I'm frankly amazed by how good Microsoft Flow has been. So many dumb business processes rely on an Excel doc somewhere, or a stupid manual email somewhere else. But with Flow I've seen just a single smarty-pants able to fully streamline an entire department one rule at a time. They don't need to get permission to bring in a new logo - it's part of Offi…
Is it still very desktop centric as all MS Office products? Because if it is you will struggle to keep up with the amount of data, report and automation that need to run on top of various cloud applications.
It's like IFTTT/Zapier/Huginn, but by Microsoft. It has all the advanced scriptability you'd need, but it's still missing some of the best parts of those solutions.
Definitely cloud-centric, and reaches into on-premises data through an optional on-premises data connection agent.
You'd be surprised at how much you can do with it.
(edit: especially powerful if you're using SharePoint)
Re: Google Docs gets an API for task automation
#37Re: Google Docs gets an API for task automation
#38FYI the Python quickstart.py is broken on Ubuntu 18.04 (tried both python2 and python3). I've notified the eng in the video, and sent her here. By definition, credentials.json doesn't exist yet and this throws an error. Transcript below. creds = None if os.path.exists('token.pickle'): ... # If there are no (valid) credentials available, let the user log in. if not creds or not creds.valid: if creds and creds.expired…
Re: Google Docs gets an API for task automation
#39Re: Google Docs gets an API for task automation
#40Earlier quoted context omitted.
The cool thing about HN is that, by its very nature, any post that gets voted to the front page is warranted.
On the flip-side, it's easier for a large organization like Google to manipulate the post that gets voted to the front page.