Embed image into xls sheet via python - python

Currently I have a data export going on that does a CSV file like:
name, file
foo, http://www.google.com/favicon.ico
But now I need to make something that embeds the image in a way that it would be visible in excel. How can I accomplish that?

xlwt is a nice package for creating .xls files. And as these examples (1, 2) suggest, it can embed images. Though it can only embed Windows Bitmap format, namely .bmp files. If you have images in a different format, you may need to process them first.

Related

How to move and duplicate multiple images in Excel worksheets using Python?

I have Excel worksheets that I would like to move / duplicate multiple images in using Python (choosing Python due to reasons of existing infrastructure and technology choices).
Using xlwings, I can insert an image from either a .png or .jpg file, but cannot insert an image that comes from another worksheet in the workbook.
I am aware of the ability to insert a fig, but this appears to work only for matplotlib generated figures. Looking through the documentation or searching online have not found relevant answers.
Using Openpyxl, I can insert images into a worksheet from a file (.png or .jpg file), but multiple copies of the same image causes the file to be corrupted upon save due to Zip issues - and the images still need to come from a file not elsewhere in the workbook.
Any help on either of these modules or an explanation of how to do it another way in Python would be great.

How to copy from Excel and paste as image in Word using Python?

How do I copy a set of cells from Excel and paste them as image in Word using Python ?
I am trying to automate some reports (in docx format). The excels are auto generated and then I have to manually copy cells from Excel and paste as image in Word.
I have done some research and found there are some libraries like python-docx (for word) and openpyxl (for excel). What I am not able to figure out is the copy and paste as image from excel to word.
I don't think this is an easy task. Because conversion Excel to image probably means the Python package/codes need to know how to render the excel content, which is a big step beyond read/write excel format. I don't know any Python package can do that.
Assume you're running Python codes in Windows, you may try to call COM to copy/paste directly from Excel to Word. I guess that would behave just like you manually Ctrl+C/V. Reference
If you prefer to convert to an image, may try a VBA script. Reference

Read JHOVE attributes From TIFF And JPEG-2000 Files using Python?

I am trying to read JHOVE attribues from TIFF and JP2 files. Is there a python library that makes this possible?
I would use the tifflib python binding (for TIFF file) and jpylyzer (for JP2 file). You should be able to extract all meta data from the input file, just select the one you need.

Python : Convert multiple images as multiple pages in pdf for windows

How to convert multiple images(jpeg) as a pdf file with multiple pages in windows.
Using Image library, i can convert every image as single pdf, i can merge those converted files to a single pdf file using pdfminer, but it is two way work.
I try to download MagicK, but couldn't get binary for windows. Is it possible to achieve using PIL ?
I'm not totally sure, but you can create a report with jasperReport and create a pdf file after. I believe python also can work with jasper reports.
what do you think? maybe is too much work.

How can I extract the tables, text and the pictures in ODT(OpenDocumentText) format using Python?

How can I extract the tables, text and the pictures in an ODT(OpenDocumentText) file to output them to another ODT file using Python on Ubuntu?
OOoPy seems to be a good fit. I've never used it, but it comes with documentation and code examples, and it can read and write ODT files.
An easy way is to just rename the foo.odt to foo.zip and then extract it. the extracted directory contains many files including Pictures.
However I think it's better to change it's type to docx and then do the process on docx (extract it). Because it extract images with better name (image1, image2, ...).

Categories