scanny / python-pptx

Create Open XML PowerPoint documents in Python
MIT License
2.46k stars 529 forks source link

Powerpoint comparator #451

Open akashsharma03 opened 6 years ago

akashsharma03 commented 6 years ago

Hi Steve,

Is there any way to compare two ppts or their objects such as chart object , table object and all of their properties.

Also, is there any way convert the Presentation object into a dictionary with its attributes as key-value pair?

mszbot commented 6 years ago

Surely you can just write a function to do this yourself...

akashsharma03 commented 6 years ago

I mean the universe of comparison is so huge. Is there any way to optimize this? Compare every instance of charts, its series, its color , markers, borders, everything.

scanny commented 6 years ago

A good place to start would be helping us understand your purposes. What outcome are you pursuing? For example, if it's just raw equality, then a hash comparison would do the trick. You need to do the work of making plain to us what is in your mind and not call upon us to guess.

akashsharma03 commented 6 years ago

Sorry for the vague question. My intent here is that I have a template PowerPoint which has multiple chart, text boxes and table formatted in a particular format with every series in chart having a specific format or every text box or table having their own formatting. Every week the template has to be refreshed with new data which is done through a vba script. After the data refresh is done, some of formatting of the elements are not retained.

I am trying to write a python code that could check the formatting of every element vs the template so that the format of the PowerPoint is reserved.

How should I approach this?

Thanks in Advance.

scanny commented 6 years ago

What would you do if you detected a formatting difference?

akashsharma03 commented 6 years ago

Detecting the formatting difference is kind of an important aspect here.

If there is a formatting difference, that has to made correct. Maybe through a script or manually.