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
2 answers

Using loops in python-pptx to create multiple slides and writing dataframe to slides

I have the below code for creating ppt out of dataframes: Below is a snippet of the code for 3 slides: title_slide_layout = prs.slide_layouts[1] slide = prs.slides.add_slide(title_slide_layout) slide2 =…
RSM
  • 645
  • 10
  • 25
2
votes
1 answer

How to edit slides based on slide_id Python pptx

Problem I have been looking for a solution but can't find enough documentation to figure it out. I am trying to edit a slide that I had copied into a directory. (I have make sure to clean out all the data only leaving behind some logo) What I did is…
Shreamy
  • 341
  • 2
  • 16
2
votes
1 answer

Why does python library "python-pptx" doesn't get all selection data?

I am writing a python script using the pptx library, where I try to get the text at Title 4 box. Unfortunately python is not able to identify all the shape in the some slides, thus missing some of the shapes. Here is my code from pptx import…
Prashant Kumar
  • 501
  • 8
  • 26
2
votes
1 answer

How to change Title position using pptx-python library?

I am trying to move the text box with the title from the center to the top of the slide deck. I am not able to find the right parameters for my script. Here are some lines that relate to it: #setting slide type "Title and Content" title_only_layout…
LaLaTi
  • 1,455
  • 3
  • 18
  • 31
2
votes
1 answer

Changing format of Connector to an arrow one in python pptx

I'm using python-pptx library and connecting shapes in a slide. I'm trying to create an arrow Connector shape like this: But I couldn't find any attribute to change the straight line to an arrow line. I've already read in the documentation about…
cilopez
  • 75
  • 2
  • 9
2
votes
1 answer

How to set picture to bottom layer in PPT?

There are Text and Picture in one slide of PPT. I would like to set Picture to bottom layer/set Text to top layer and see Text content. How to do that? text_frame = shape.text_frame text_frame.vertical_anchor = MSO_ANCHOR.TOP text_frame =…
Alex Ho
  • 23
  • 4
2
votes
3 answers

Is there a way to add a column to a table in PowerPoint slide through Python?

I have a powerpoint template which I want to use to create a monthly report. The number of columns in one of the table on the slide can change based on some logic and I would like to add new column during runtime. I was looking for a method to add a…
Kamlesh Kishor
  • 121
  • 1
  • 15
2
votes
0 answers

How to change the way Connector Shape looks like when connected to other shapes?

I am trying to create PowerPoint presentations with python-pptx and currently I am trying to create shapes and connectors in a for loop. Even though the Connector is created and it does connect to shapes, it looks unnatural when I open the…
2
votes
1 answer

How to change font size for all cells in a table with no text?

I've successfully created a blank table in a Presentation (7x9) and currently all cells are blank. Before I put anything in them, I want to change the font size (currently 18) to 10.5. While someone has already asked/answered this question, and I've…
KingT753
  • 81
  • 1
  • 5
2
votes
2 answers

extract all the headings(titles) from a ppt slides

I am looking for code to extract only the titles from every power point slides. Is there any python function available. Any help is appreciated.
2
votes
0 answers

How to populate Bullet points in a Table cell in PPT Slide using python-pptx

I am trying to populate some values in a PPT Slide which has a table. These values are in a list and want to show them as bullet points. I am using python-pptx module for coding. How can I do this? I tried the code below which creates a slide from…
Kir An
  • 21
  • 1
2
votes
0 answers

Replacing pie chart data causes corruption

Replacing data in a certain pie chart with the python-pptx library causes an error. However, replacing the data in another pie chart on the same slide causes no problems. If I replace the data in only the second pie chart (the one which I…
2
votes
0 answers

Change Placeholder Shape

Can we change a placeholder shape from normal rectangle to rounded rectangle ? I tried below code: from pptx import Presentation from pptx.enum.shapes import MSO_SHAPE prs = Presentation(path) title_slide_layout = prs.slide_layouts[4] slide =…
Rahul Agarwal
  • 4,034
  • 7
  • 27
  • 51
2
votes
1 answer

How do u get left,right,bottom and top values from a bar or datalabel

I have a barchart of the type BAR_Clustered. So basicly a Horizontal barchart. I would like to display the category inside the bar and the value outside end. I think its not possible to set 2 diffrent positions for the same datalabel. That's why I…
2
votes
1 answer

How to print all the chart properties in Python-pptx

I have a existing chart in pptx file, i just want to update its values on daily basis, these charts are already plotted from excel and paste into pptx, i just want to modify the charts , but i don't know how many properties are there in charts like…
R__raki__
  • 847
  • 4
  • 15
  • 30