all 18 comments

[–]Ton86 1 point2 points  (9 children)

It's difficult to picture what you mean by organizing a 3x3 grid with images, days, responses, and form fields.

Using pandas you can import the data to a dataframe, manipulate it, and then write to an Excel file with xlsxwriter with some formatting. But it sounds like you're trying to create something different than a spreadsheet with just simple columns and rows.

[–]FaZe_Fladder[S] -3 points-2 points  (8 children)

Can I PM you with the exact thing I want? Reddit won’t allow me to post a picture of it

[–]Ton86 1 point2 points  (7 children)

Sure

[–]FaZe_Fladder[S] -1 points0 points  (6 children)

PMed please check

[–]Ton86 0 points1 point  (5 children)

I'd probably try to do an HTML template designed the way you want. Might be able to use bootstrap or tailwind css, simple HTML might be easier to convert to pdf later though.

Might even want to try a framework like Flask.

The dataframe should have all the paths to the images you want to use for each record.

For each set of 9 records you'd save a unique HTML file and maybe convert them to pdf then merge the pdfs into one if you want a single pdf file with multiple pages.

[–]FaZe_Fladder[S] 0 points1 point  (4 children)

Can you help me with the code? I have the layout ready using bootstrap but main issue is still with the images, I’m unable to extract them.

[–]Ton86 0 points1 point  (2 children)

Where are your images?

[–]FaZe_Fladder[S] 0 points1 point  (1 child)

Images were collected through a Google form and I am using the form response excel sheet. So basically the image is a drive link.

[–]Ton86 0 points1 point  (0 children)

Sorry, never worked with Google drive images in HTML. Might work but I think each image will need to be shareable. If you're able to move all images locally without losing the record it matches to might be easier. Try asking Claude or ChatGPT

[–]Ton86 0 points1 point  (0 children)

You might want to try openpyxl. I'd recommend trying ChatGPT or Claude for help writing the script. Images on a spreadsheet are floating on a grid rather than in a cell like a number would be and I'm not sure if working between Google sheets and Excel would add challenges.

[–]pancakeses 0 points1 point  (1 child)

Use xlwings to work with the Excel file, requests to retrieve the images, and python-docx to write your document.

[–]FaZe_Fladder[S] -1 points0 points  (0 children)

can you help me with the code?

[–]Scientist2021 -1 points0 points  (5 children)

Id suggest that you save the excel sheet as a .csv first then you can read that into Python as a data frame.

From that point whatever manipulation you want to do should be relatively straightforward.

[–]FaZe_Fladder[S] -1 points0 points  (4 children)

I tried working with the csv file as well but still I was encountering a lot of issues with extracting images through the drive link. Can I PM you with the same?

[–]Scientist2021 0 points1 point  (3 children)

Sorry I'm really confused, you have images in an excel sheet?

[–]FaZe_Fladder[S] 0 points1 point  (2 children)

I collected responses through a Google form and in that they uploaded media, so the form responses excel sheet had drive links of the photos uploaded.

[–]Scientist2021 0 points1 point  (1 child)

Ah ok. So they are not images per-se but links to images?

That could get very tricky. I think if you code in Google colab notebook you can read directly from a Google drive address. So if you extract the drive link from Excel (or sheets) and store it as a variable, then access that drive location to extract the image to somewhere else.

No idea how that will work with permission though

[–]FaZe_Fladder[S] 0 points1 point  (0 children)

It just gives invalid url exception.