Query external API


I’m creating an overview-sheet for apps I host myself. I would like to set the installed version manually and have grist compare this to the latest release on GitHub so I know when an update is due.

I’ve added the python “request” module manually and set the following formula to get the latest release from a given GitHub repo:

import requests
import json
url = 'https://api.github.com/repos/gristlabs/grist-core/releases/latest'
headers = {'Authorization': 'Bearer <MyToken>'}
response = requests.get(url, headers=headers)
parsed = response.json()
return parsed['name']

“url” will be given by another field, depending on the app, of course.

This works – however: I completely stitched this together and am surprised it works – is this a good idea, can / should this be improved / amended? Is this safe?

Thanks and best regards!