Fill writer fields from python

I want to fill the document fields through python from variables and create a document dynamically.
How can I do that?

Install py3o.template:

DOC:

https://py3otemplate.readthedocs.io/en/latest/

EXAMPLES:


Note:
On Linux it is necessary to inform the complete path of the files in the python module, thus:

from py3o.template import Template

t = Template("/home/YOUR_USER/example/py3o_example_template.odt", "/home/YOUR_USER/example/py3o_example_output.odt")

t.set_image_path('logo', '/home/YOUR_USER/example/images/new_logo.png')