Questions tagged [python-pptx]

python-pptx is a Python library for creating and updating PowerPoint (.pptx) files.

python-pptx is a Python library for creating and updating PowerPoint (.pptx) files.

Latest documentation

Available from pypi.

734 questions
0
votes
0 answers

Converting Text to AP (Associated Press) Style

I am working on a PPTX formatting project for which I have to convert the text into Associated Press Style. Do we have any library in python which could help me? I have explored options available in pyapa, this only gives me the matching rate and…
0
votes
1 answer

How do I access urls present in a shape or a text run of a Presentation using python?

I am reading data from a pptx file using python. I need to access the hyperlinks/urls present in it. ppt2 = Presentation('../sample dataset/'+ file_name) for slide in ppt2.slides: for shape in slide.shapes: …
0
votes
1 answer

How to change Python code to edit a hyperlink

I wrote a python code to change a text in a powerpoint presentation with python pptx. I want to change my code to edit the hyperlink of an embedded video in Powerpoint but I can't figure out how to do it. Can anyone help? Below is my code Thanks!…
0
votes
2 answers

Getting the x_values from XY Scatter plot in python-pptx

I'm trying to use python-pptx to extract XY scatter data for special cases where the reference excel sheet is not present and my existing VBA code fails to read the data. I can get all the y_values but I haven't been able to figure out how to get…
swalters
  • 173
  • 1
  • 5
0
votes
1 answer

Use python to find text in PowerPoint and replace with image?

Right now I have to add various images/icons next to names in PowerPoint corresponding to the sector in which they work. I found code to find and replace text, but I want to find text (e.g. "Health", "Water", etc.) throughout the powerpoint and…
Erin
  • 1
  • 1
0
votes
0 answers

Python 3.x PPTX can't find placeholder

So my code is: from pptx import Presentation prs = Presentation('template.pptx') title_slide_layout = prs.slide_layouts[0] slide = prs.slides.add_slide(title_slide_layout) title = slide.shapes.title subtitle = slide.placeholders[1] title.text =…
Marci
  • 129
  • 1
  • 13
0
votes
0 answers

Python 3.x -PPTX Why template.pptx object has no attribute 'slides_layouts'

I know this module is not very popular but if you know the answer then please help me out with it. My code is: from pptx import Presentation prs = Presentation('do.pptx') title_slide_layout = prs.slides_layouts[0] #…
Marci
  • 129
  • 1
  • 13
0
votes
2 answers

How can i work with templates in Python-pptx

I know this module is not very popular but if you know the answer then please help me out with it. My code is: from pptx import Presentation prs = Presentation('template.pptx') title_slide_layout = prs.slide_layout[0] #…
Marci
  • 129
  • 1
  • 13
0
votes
1 answer

Python Code runs when I start Anaconda Navigator but not in env

Newbie Anaconda Python question. I installed python-pptx from conda, followed the pptx documentation. I install it to my env which has the dependencies pptx wants i.e Python 2.6, 2.7, 3.3, 3.4, or 3.6 lxml Pillow XlsxWriter (to use charting…
KD_Raj
  • 189
  • 3
  • 16
0
votes
0 answers

python-pptx: extract image with transparent background from PPT

I have a PowerPoint that contains an image with a transparent background. I want to use the python-pptx package to extract it, but it doesn't include the transparent background. Basically I have an image variable which is a python-pptx PICTURE…
vdvaxel
  • 667
  • 1
  • 14
  • 41
0
votes
0 answers

Are series lines possible in python-pptx?

In powerpoint the lines connecting the two columns in the image below are called series lines. Is it possible to create these via python-pptx?
Ludo
  • 2,307
  • 2
  • 27
  • 58
0
votes
2 answers

Remove bold from existing category chart vertical value axis title with python-pptx

I am modifying an existing category chart's vertical value axis title. I can successfully modify the value axis title text using the following code: S2_L_chart= prs.slides[slide_index].shapes[3].chart #select chart S2_L_chart.value_axis.has_title=…
user2529589
  • 330
  • 4
  • 16
0
votes
1 answer

pptx-python unwanted chart title

When creating a new powerpoint slide with a line chart on it, I keep getting a chart title even though I didn't ask for one. I have tried all sorts of ways to get rid of it using combinations of chart.has_title=False or chart.has_text_frame = False…
Ludo
  • 2,307
  • 2
  • 27
  • 58
0
votes
2 answers

How do you replace data for an existing line chart using python-pptx?

I have a prebuilt and populated powerpoint presentation where I am modifying the data for charts and tables. I would like to retain all formatting (and much of the text), but replace the data in a line chart within a slide. I have a function that…
user2529589
  • 330
  • 4
  • 16
0
votes
1 answer

Is there a way to save multiple power-point presentations with different names using a for-loop through python-pptx?

from pptx import Presentation prs = Presentation() prs.save('test2.pptx') So I am using the above code to save a blank ppt in some location. Now if I want to save multiple ppts with names test1.ppt, test2.ppt, test3.ppt and so on, is there a…