Does the Google Spreadsheet Python API or gspread allow images or rich text?
Asked Answered
S

1

8

Is it possible with gspread or other Python-based access to Google Spreadsheets to insert an image into a spreadsheet?

Also, is it possible to make rich text cells (e.g., bold, italic, different fontsize, colors, etc.)?

Scorcher answered 14/9, 2015 at 17:28 Comment(0)
A
6

The question is a bit old, but today I had to check this for myself, so this may be useful for people that arrive here.

Insert an image: I'm not sure if inserting images as objects (as in the Google Sheets UI) is possible, but one way of doing it is setting the content of the cell to =IMAGE("<url of image>"). I believe the image here needs to be a public link, so a direct link to a protected Google Drive resource wouldn't work (even if the user has permission to access it).

Formatting cells: Now there is package gspread-formatting to do this, but it could be also done calling the v4 of spreadsheets API.

Altis answered 1/7, 2019 at 15:2 Comment(1)
I made multiple searches before coming across this, and it works perfectly in my case, thanks :)Ponderous

© 2022 - 2024 — McMap. All rights reserved.