I'm searching for documentation on how to do it properly. Any hints?
if you google "dia python", you'll find https://wiki.gnome.org/Apps/Dia/Python which is a good starting point