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.)?
gspread is a Python API for Google Sheets. Features: Google Sheets API v4. Open a spreadsheet by title, key or url. Read, write, and format cell ranges.
We have successfully Read Data from the Google Sheets using Python. For creating the GUI of the project we used Tkinter Module. And we have done a little setup and using oauth2 library, we have established connection with the google sheet. In this way now we know how to read data from a google sheet using Python.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With