Skip to main content

Recently I have been playing/fooling/struggling around with the creation and modification of Word documents using a combination of MSWordStylers and the Python docx library, called from a PythonCaller. A very instructive journey :-)

To make sure I don't forget immediately everything I've learned, I have decided to summarize my findings in a template. And because a lot of input has come from this community I will share the results here. Please see the zip file attached: images-to-table-python-docx.zip

It starts by reading Parcel information from a database (gpkg) and it creates a summary table in a word document, including a little image with the parcel plotted on an aerial image.

Inspiration has been taken from these to discussions:

With some slight modifications I have integrated these two examples in my own workflow.

What do you think?

Cheers,

Egge-Jan

 

Edit 2024-04-05: attachment added again in zip file format (apparently the new community environment does not support the uploading of fmwt files).

Thanks for sharing. Personally, I don't like renaming transformers, as this makes it harder to review workspaces.


This post is just what I was looking for, but where is the template attached?


Hi @mathiku it probably got lost in translation going to the new community site

Best to report here I guess and hope someone at Safe can recover it


Hi @mathiku, Hi @becchr,

Thanks for letting me know that the attachment was gone… The original attachment was a Safe Software *.fmwt (Template) file. But apparently the new community environment does not support this file format anymore.

I have added the example again, both the workspace and an input geopackage, but in a zip file this time. See the original, edited post above.

@mathiku: please let me know if this works for you.

Cheers,

Egge-Jan


Reply