xflr6 / gsheets

Pythonic wrapper for the Google Sheets API
https://gsheets.readthedocs.io
MIT License
121 stars 17 forks source link

Ability to get formula values (allows for fetching image urls) #23

Open TheBoroer opened 2 years ago

TheBoroer commented 2 years ago

Hey! Could we please have an option to specify the valueRenderOption setting for the v4 sheets request? https://github.com/xflr6/gsheets/blob/2c47e1993bc5ffa345bbbd1eed136a53851082fb/gsheets/backend.py#L80

Another method called formula_values() could work too where it just has valueRenderOption: 'FORMULA'. The reason I need to access formulas is because it's the only way to fetch the image url for cells that hold image content (yup, google sheets cells can hold images now!!). The regular .values() method only returns an empty string.

xflr6 commented 2 years ago

Hey,

spounds good to me. Upstream docs:

Not sure if we should also add DateTimeRenderOption.

I think WorkSheet.values() could just always fetch the values instead of using the loaded ones if a different format is requested.

WDYT?

Let me know if you want to give it a try.