Make a Summary Slide max 5-6 lines

Reading File
Running Command

python3 -c " from pptx import Presentation prs = Presentation('/tmp/workspace/attachments/4c8b1d91-1f03-4260-aa65-5734c958917e/Inherited_Metabolic_Liver_Disorders.pptx') for i, slide in enumerate(prs.slides, 1): texts = [] for shape in slide.shapes: if shape.has_text_frame and shape.text_frame.text.strip(): texts.append(shape.text_frame.text.strip()) if texts: print(f'--- Slide {i} ---') for t in texts: print(t) "

Reading File
Running Command

python /tmp/skills/pptx/scripts/office/unpack.py /tmp/workspace/attachments/4c8b1d91-1f03-4260-aa65-5734c958917e/Inherited_Metabolic_Liver_Disorders.pptx /tmp/workspace/imld_unpacked/

Running Command

python3 -c " from pptx import Presentation from pptx.util import Emu prs = Presentation('/tmp/workspace/attachments/4c8b1d91-1f03-4260-aa65-5734c958917e/Inherited_Metabolic_Liver_Disorders.pptx') # Check slide 30 (summary table) as reference for layout slide = prs.slides[29] # 0-indexed print(f'Layout: {slide.slide_layout.name}') for shape in slide.shapes: pos = (round(Emu(shape.left).inches,2), round(Emu(shape.top).inches,2)) if shape.left is not None else None sz = (round(Emu(shape.width).inches,2), round(Emu(shape.height).inches,2)) if shape.width is not None else None print(f' {shape.shape_type} | {shape.name} | pos={pos} | sz={sz}') if shape.has_text_frame: tf = shape.text_frame for para in tf.paragraphs: for run in para.runs: if run.font.size: print(f' font size: {run.font.size.pt}pt | bold: {run.font.bold} | color: {run.font.color.rgb if run.font.color and run.font.color.type else None}') break break "

Running Command

python3 -c " from pptx import Presentation from pptx.util import Emu from pptx.dml.color import RGBColor prs = Presentation('/tmp/workspace/attachments/4c8b1d91-1f03-4260-aa65-5734c958917e/Inherited_Metabolic_Liver_Disorders.pptx') # Check slide 4 (Why it matters) slide = prs.slides[3] print(f'Layout: {slide.slide_layout.name}') for shape in slide.shapes: pos = (round(Emu(shape.left).inches,2), round(Emu(shape.top).inches,2)) if shape.left is not None else None sz = (round(Emu(shape.width).inches,2), round(Emu(shape.height).inches,2)) if shape.width is not None else None fill = None try: if shape.fill.type is not None: fill = shape.fill.fore_color.rgb except: pass print(f' {shape.name} | pos={pos} | sz={sz} | fill={fill}') if shape.has_text_frame: tf = shape.text_frame txt = tf.text[:80] print(f' text: {txt}') for para in tf.paragraphs: for run in para.runs: try: color = run.font.color.rgb if run.font.color and run.font.color.type else 'inherited' print(f' run font: size={run.font.size.pt if run.font.size else None}pt bold={run.font.bold} color={color}') except: pass break break "

Running Command

python3 << 'EOF' import copy from pptx import Presentation from pptx.util import Inches, Pt, Emu from pptx.dml.color import RGBColor from pptx.enum.text import PP_ALIGN from pptx.oxml.ns import qn from lxml import etree import shutil src = '/tmp/workspace/attachments/4c8b1d91-1f03-4260-aa65-5734c958917e/Inherited_Metabolic_Liver_Disorders.pptx' dst = '/tmp/workspace/IMLD_with_summary.pptx' shutil.copy(src, dst) prs = Presentation(dst) # Add a new blank slide at the end blank_layout = prs.slide_layouts[6] # Blank layout slide = prs.slides.add_slide(blank_layout) W = Inches(13.33) H = Inches(7.5) # ── Background rectangle (light teal) ── bg = slide.shapes.add_shape(1, 0, 0, W, H) bg.fill.solid() bg.fill.fore_color.rgb = RGBColor(0xE0, 0xF5, 0xF7) bg.line.fill.background() # ── Header bar (dark teal) ── header = slide.shapes.add_shape(1, 0, 0, W, Inches(1.1)) header.fill.solid() header.fill.fore_color.rgb = RGBColor(0x00, 0x5C, 0x6A) header.line.fill.background() # ── Orange accent line ── accent = slide.shapes.add_shape(1, 0, Inches(1.1), W, Inches(0.06)) accent.fill.solid() accent.fill.fore_color.rgb = RGBColor(0xF5, 0xA6, 0x23) accent.line.fill.background() # ── Title text ── title_box = slide.shapes.add_textbox(Inches(0.35), Inches(0.1), Inches(12.5), Inches(0.95)) tf = title_box.text_frame tf.word_wrap = False p = tf.paragraphs[0] run = p.add_run() run.text = "Summary — Key Takeaways" run.font.size = Pt(30) run.font.bold = True run.font.color.rgb = RGBColor(0xFF, 0xFF, 0xFF) run.font.name = "Calibri" # ── Summary bullet points (6 lines) ── bullets = [ ("α1-Antitrypsin Deficiency", "Most common genetic liver disease requiring LT; PiZZ misfolding causes toxic gain-of-function hepatocyte injury; diagnose by phenotype; LT is curative."), ("Glycogen Storage Diseases (I, III, IV)", "GSD I: severe hypoglycemia + lactic acidosis, treat with cornstarch diet. GSD III: myopathy + hepatomegaly, improves with age. GSD IV: amylopectin cirrhosis by age 3, LT required."), ("Hereditary Tyrosinemia Type 1", "FAH deficiency → succinylacetone (pathognomonic); nitisinone (NTBC) is standard of care; high HCC risk even without cirrhosis; LT curative if NTBC fails."), ("Hemochromatosis", "HFE gene (C282Y mutation); iron overload → cirrhosis, HCC, diabetes, cardiomyopathy; diagnose via transferrin saturation + ferritin; treat with therapeutic phlebotomy."), ("CDG, Porphyrias & Lipid Storage Diseases", "CDG Ib (mannose) is the only treatable CDG; AIP: hemin + givosiran; PCT: phlebotomy; Gaucher Type 1: ERT (imiglucerase); Niemann-Pick Type B: olipudase alfa."), ("Diagnostic Approach", "Collect samples DURING acute episodes; key tests: urine succinylacetone (HT-1), transferrin IEF (CDG), PAS stain (α1-AT/GSD), β-glucocerebrosidase assay (Gaucher); NGS panels for confirmation."), ] content_top = Inches(1.25) content_left = Inches(0.45) content_width = Inches(12.4) box_height = Inches(0.91) gap = Inches(0.03) for i, (bold_part, normal_part) in enumerate(bullets): top = content_top + i * (box_height + gap) # Alternating row background row_bg = slide.shapes.add_shape(1, Inches(0.3), top - Inches(0.04), Inches(12.73), box_height) if i % 2 == 0: row_bg.fill.solid() row_bg.fill.fore_color.rgb = RGBColor(0xC2, 0xE8, 0xED) else: row_bg.fill.solid() row_bg.fill.fore_color.rgb = RGBColor(0xF0, 0xFC, 0xFE) row_bg.line.fill.background() # Text box tb = slide.shapes.add_textbox(content_left, top - Inches(0.02), content_width, box_height) tf = tb.text_frame tf.word_wrap = True p = tf.paragraphs[0] # Bold label r1 = p.add_run() r1.text = bold_part + ": " r1.font.size = Pt(13) r1.font.bold = True r1.font.color.rgb = RGBColor(0x00, 0x5C, 0x6A) r1.font.name = "Calibri" # Normal content r2 = p.add_run() r2.text = normal_part r2.font.size = Pt(12) r2.font.bold = False r2.font.color.rgb = RGBColor(0x1A, 0x1A, 0x2E) r2.font.name = "Calibri" prs.save(dst) print("Saved:", dst) EOF

Running Command

python3 -c " from pptx import Presentation prs = Presentation('/tmp/workspace/IMLD_with_summary.pptx') last = prs.slides[-1] print(f'Total slides: {len(prs.slides)}') print('Last slide shapes:') for s in last.shapes: if s.has_text_frame: print(' ', s.text_frame.text[:100]) "

Your credits are exhausted. You can purchase a top-up or subscribe to a plan to continue using Orris. If you're already subscribed, your daily credits will reset tomorrow.
This is a shared conversation. Sign in to Orris to start your own chat.