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
2
votes
1 answer

How to paste data-frame directly to powerpoint using python-pptx module

I have a data-farme which looks like: yyyymm A_growth B_growth 201911 NaN NaN 201912 -1.0 -3.0 202001 14.0 20.0 202002 7.0 …
MAC
  • 1,345
  • 2
  • 30
  • 60
2
votes
0 answers

How to plot particular line chart with labels and titles in power point using python-pptx module?

I have a dataset which looks like this: A B C D AR 20201 1 200 AR 20202 1 300 AR 20203 1 1000 AR 20204 1 3000 AR 20205 1 700 AR 20206 1 800 AR 20207 1 …
MAC
  • 1,345
  • 2
  • 30
  • 60
2
votes
0 answers

Text extracted from presentation files was not in correct order when using python-pptx

I'm trying to extract text from powerpoint text boxes with the following code: from pptx import Presentation from pptx.enum.shapes import MSO_SHAPE_TYPE def iter_textable_shapes(shapes): for shape in shapes: if shape.has_text_frame: …
wbzy00
  • 146
  • 9
2
votes
2 answers

PPTX-Python `insert_chart` incrementally slowing down

We have an application creating large pptx's with over 1000 slides and we are using python-pptx library. The problem we have is that, as the Presentation grows it becomes slower to add Elements and/or charts to it. from pptx import Presentation from…
Diogo
  • 23
  • 5
2
votes
1 answer

Extract presenter notes from PPTx file (powerpoint)

Is there a solution in python or php that will allow me to get the presenter notes from each slide in a power point file? Thank you
Raven
  • 529
  • 7
  • 27
2
votes
1 answer

python-pptx - cannot update one data point's datalabel text

I'm trying to update the text for 1 specific data label but it turns off the data labels for its siblings. #turn on data labels plot = chart.plots[0] plot.has_data_labels = True #add custom text to the 1st series' 1st data point. Ignore the…
Boosted_d16
  • 13,340
  • 35
  • 98
  • 158
2
votes
1 answer

How can I draw a line from shape's connecting point to another shape's connecting point using python-pptx?

I'm trying to draw a line from shape's connecting point to another shape's connecting point using python-pptx. Below is the python source code. When I read the file with PowerPoint and move the shape, the line does not follow. The image is where I…
nori
  • 21
  • 1
2
votes
1 answer

Adding highlighting to a run in python-pptx

I would like to automate adding a highlight to a run of text (really a background colour) using python-pptx. I've done a lot of work with python-pptx and have done a tiny amount of fiddling with _element in the past. Could someone post a quick…
Martin Packer
  • 648
  • 4
  • 12
2
votes
1 answer

How do you iterate through a table and edit information with pptx in python?

How do you iterate through a table and find and replace text? I'm able to go through text boxes as below but need to be able to access and edit information in a table: for slide in prs.slides: for shape in slide.shapes: if…
simplesam
  • 61
  • 7
2
votes
0 answers

Python PPTX workaround function for moving series to secondary axis

Im trying to identify a way with PPTX to move a series to the secondary axis. I know the PPTX library hasn't implemented this yet, but from what i have read its possible with LXML. Has anyone achieved this yet? Or been able to move a series to the…
Dale
  • 43
  • 5
2
votes
1 answer

How to read text boxes inside the chart area python pptx?

I am trying to automate a ppt using pptx-python library. I'm using a template. There are few charts in some of the slides. And charts have text boxes in it. I tried looping over the shapes to get the shape_id of those text boxes but I couldn't find…
Mr Anonymous
  • 75
  • 10
2
votes
3 answers

How to close the presentation without saving it in Python pptx

I have to open multiple presentation using a loop, get some data and close it. I cannot seem to find a way to close the ppt file in python pptx without saving/overwriting it. I use the following to open the ppt file pptfile = addressList[xyz] prs =…
Prashant Kumar
  • 501
  • 8
  • 26
2
votes
0 answers

How to find the real first line of a shape in pptx presentation

At the moment I need to get the actual width of the text, the best solution that I tried was to find the first line of text, and get its width. The presentations given to me were made by different people, and I cannot directly influence them. And…
newfox79
  • 21
  • 2
2
votes
0 answers

Embed a excel object to PPT slide using python

Is there any possibilities to add Excel object in slides of PPT using Python-PPTX? I have searched many sites for this but none helped me. If there is a way to add excel object to slide please let me know. Thanks in advance.
Lavii
  • 63
  • 1
  • 4
2
votes
1 answer

How to send multiple plots generated by matplotlib to a pptx without any overlapping?

I am working on a project where I am generating hundreds of plots using the matplotlib module in Python. I want to put these plots in a pptx using the python-pptx module, let's say four plots on a slide without storing these plots on the local…
Sud_Hashira
  • 29
  • 1
  • 3