Nick
Nick

Reputation: 81

How do you parse and modify a .odg file using Python?

I have an existing odg file that I need to modify through Python.

I've looked at ezodf library, but it's not well documented for odg files:

https://github.com/T0ha/ezodf

I don't see any relevant examples to go off of.

import ezodf
draw = ezodf.opendoc('diagram.odg')
# can't get any further than here

draw will print <ezodf.document.PackagedDocument object at 0x7f50f295a550>, but I need to parse this and modify it.

Upvotes: 1

Views: 1020

Answers (1)

Jim K
Jim K

Reputation: 13819

It sounds like you may be looking for a third-party solution, but have you considered straight Python-UNO? Use the method oDoc.getDrawPages().

To get started with Python-UNO, use APSO and an introspection tool such as MRI.

Upvotes: 1

Related Questions