Make a summary slide
python3 -c " from pptx import Presentation prs = Presentation('/tmp/workspace/attachments/d7a15732-e26c-4321-be21-c8311f46b80f/Inherited_Metabolic_Liver_Disorders.pptx') for i, slide in enumerate(prs.slides, 1): print(f'--- Slide {i} ---') for shape in slide.shapes: if shape.has_text_frame and shape.text_frame.text.strip(): print(repr(shape.text_frame.text[:300])) print() "
python /tmp/skills/pptx/scripts/office/unpack.py "/tmp/workspace/attachments/d7a15732-e26c-4321-be21-c8311f46b80f/Inherited_Metabolic_Liver_Disorders.pptx" /tmp/workspace/imld_unpacked/
python3 -c " from pptx import Presentation from pptx.util import Emu prs = Presentation('/tmp/workspace/attachments/d7a15732-e26c-4321-be21-c8311f46b80f/Inherited_Metabolic_Liver_Disorders.pptx') # Check slide 30 layout slide = prs.slides[29] print('Slide 30 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 size = (round(Emu(shape.width).inches,2), round(Emu(shape.height).inches,2)) if shape.width is not None else None print(shape.shape_type, shape.name, pos, size) print() # List all available layout names print('Available layouts:') for layout in prs.slide_layouts: print(' -', layout.name) "
python3 -c " from pptx import Presentation from pptx.util import Emu from pptx.dml.color import RGBColor import lxml.etree as etree prs = Presentation('/tmp/workspace/attachments/d7a15732-e26c-4321-be21-c8311f46b80f/Inherited_Metabolic_Liver_Disorders.pptx') slide = prs.slides[29] # Slide 30 # Check fill colors of first few rectangles for shape in list(slide.shapes)[:10]: if shape.shape_type == 1: # AUTO_SHAPE try: fill = shape.fill print(f'{shape.name}: fill type={fill.type}') if fill.type is not None: try: rgb = fill.fore_color.rgb print(f' color: {rgb}') except: print(' color: cannot read') # Try XML xml = etree.tostring(shape._element, pretty_print=True).decode() # find solidFill idx = xml.find('solidFill') if idx > -1: print(' XML snippet:', xml[idx:idx+200]) except Exception as e: print(f' error: {e}') "
python3 << 'EOF' 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.util import Inches, Pt import copy # Colors from the existing slide BG_COLOR = RGBColor(0xE0, 0xF5, 0xF7) # light teal background HEADER_DARK = RGBColor(0x00, 0x5C, 0x6A) # dark teal header bar ACCENT_ORANGE = RGBColor(0xF5, 0xA6, 0x23) # orange accent line COL_HEADER = RGBColor(0x00, 0x7D, 0x8E) # column headers ROW_EVEN = RGBColor(0xE0, 0xF5, 0xF7) # even row (same as bg) ROW_ODD = RGBColor(0xCC, 0xEC, 0xF0) # slightly darker alternate SECTION_BAR = RGBColor(0x00, 0x5C, 0x6A) # section divider HEMO_BAR = RGBColor(0x7B, 0x3F, 0x00) # brown for hemochromatosis section HEMO_COL = RGBColor(0xA0, 0x55, 0x10) # lighter brown column headers HEMO_ROW_ODD = RGBColor(0xF5, 0xE6, 0xD3) # warm beige for hemo rows WHITE = RGBColor(0xFF, 0xFF, 0xFF) DARK_TEXT = RGBColor(0x1A, 0x1A, 0x2E) prs = Presentation('/tmp/workspace/attachments/d7a15732-e26c-4321-be21-c8311f46b80f/Inherited_Metabolic_Liver_Disorders.pptx') # Add a blank slide at the end blank_layout = None for layout in prs.slide_layouts: if layout.name == 'Blank': blank_layout = layout break slide = prs.slides.add_slide(blank_layout) W = prs.slide_width # 13.33" H = prs.slide_height # 7.5" def add_rect(slide, x, y, w, h, fill_rgb, line_rgb=None, line_width=Pt(0)): from pptx.util import Inches shape = slide.shapes.add_shape(1, Inches(x), Inches(y), Inches(w), Inches(h)) shape.fill.solid() shape.fill.fore_color.rgb = fill_rgb shape.line.width = line_width if line_rgb: shape.line.color.rgb = line_rgb else: shape.line.fill.background() return shape def add_text_box(slide, x, y, w, h, text, font_size, bold=False, color=WHITE, align=PP_ALIGN.CENTER, wrap=True): txBox = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h)) tf = txBox.text_frame tf.word_wrap = wrap tf.auto_size = None p = tf.paragraphs[0] p.alignment = align run = p.add_run() run.text = text run.font.size = Pt(font_size) run.font.bold = bold run.font.color.rgb = color return txBox # ─── BACKGROUND ─────────────────────────────────────────────── add_rect(slide, 0, 0, 13.33, 7.5, BG_COLOR) # ─── HEADER BAR ─────────────────────────────────────────────── add_rect(slide, 0, 0, 13.33, 0.72, HEADER_DARK) # Orange accent line under header add_rect(slide, 0, 0.72, 13.33, 0.04, ACCENT_ORANGE) add_text_box(slide, 0.2, 0.04, 12.9, 0.65, "INHERITED METABOLIC LIVER DISORDERS — MASTER SUMMARY", 15, bold=True, color=WHITE, align=PP_ALIGN.CENTER) # ─── TABLE SETUP ────────────────────────────────────────────── # Columns: Disease | Gene/Defect | Key Clinical Feature | Hallmark Test | Treatment col_x = [0.12, 1.68, 3.85, 6.98, 9.55, 11.55] # left edge of each col col_w = [1.54, 2.15, 3.11, 2.55, 1.98, 1.66] # widths TOP = 0.78 # table top ROW_H = 0.38 # Column header row col_labels = ["Disease", "Gene / Defect", "Key Clinical Feature", "Hallmark Dx Test", "Treatment", "Special Note"] for i, (cx, cw, label) in enumerate(zip(col_x, col_w, col_labels)): add_rect(slide, cx, TOP, cw, ROW_H, COL_HEADER) add_text_box(slide, cx+0.02, TOP+0.03, cw-0.04, ROW_H-0.05, label, 7.5, bold=True, color=WHITE) # ─── SECTION 1 LABEL ────────────────────────────────────────── S1_TOP = TOP + ROW_H add_rect(slide, 0.12, S1_TOP, 13.09, 0.22, SECTION_BAR) add_text_box(slide, 0.15, S1_TOP+0.02, 8.0, 0.19, "▸ PART 1 — INHERITED METABOLIC DISORDERS", 7.5, bold=True, color=WHITE, align=PP_ALIGN.LEFT) # Data rows for Part 1 rows1 = [ ("α1-AT Deficiency", "SERPINA1 / Z-protein misfolding", "Cholestasis (neonatal); cirrhosis; HCC in adults", "Phenotype PiZZ; liver biopsy PAS+ globules", "Supportive; LT", "2nd most common metabolic liver Dx"), ("GSD Type I\n(Von Gierke)", "G6Pase (G6PC / SLC37A4)", "Fasting hypoglycemia + lactic acidosis; hepatomegaly; adenomas", "Fasting glucose test; enzyme assay; G6PC gene", "Cornstarch diet; frequent feeds", "Type Ib: neutropenia"), ("GSD Type III\n(Cori / Forbes)", "Debrancher (AGL)", "Hepatomegaly + myopathy; mild hypoglycemia", "AGL enzyme / gene", "High-protein diet", "Liver improves with age"), ("GSD Type IV\n(Andersen)", "Brancher (GBE1)", "Amylopectin deposits → cirrhosis by age 3", "Liver biopsy PAS+; GBE1 gene", "Liver transplant (cardiac risk)", "Amylopectin may persist in heart post-LT"), ("Tyrosinemia HT-1", "FAH (fumarylacetoacetate hydrolase)", "ALF in infancy; HCC; porphyria-like crises", "Urine succinylacetone (pathognomonic)", "Nitisinone + low-Tyr diet; LT", "Newborn screening: SA on dried blood spot"), ("CDG Type Ib", "Phosphomannose isomerase (MPI)", "Hepatic fibrosis; protein-losing enteropathy", "Serum transferrin IEF", "Oral mannose (only treatable CDG)", "CDG Ia (PMM2) most common; no Rx"), ("Porphyria (AIP)", "PBGD (haploinsufficiency, AD)", "Abdominal pain + autonomic + neuropsychiatric", "Urine ALA & PBG (elevated during attacks)", "IV hemin; carbohydrate loading", "Attacks triggered by drugs/fasting/hormones"), ("PCT", "UROD", "Blistering photosensitivity; HCV-associated", "Urine/plasma uroporphyrins", "Phlebotomy; hydroxychloroquine", "Most common porphyria overall"), ("Galactosemia", "GALT (AR)", "Neonatal jaundice + ALF; cataracts; E. coli sepsis", "RBC GALT enzyme assay; newborn screen", "Lactose-free diet", "Galactitol → cataracts"), ("Hereditary Fructose Intolerance", "Aldolase B (ALDOB)", "Vomiting + hypoglycemia after fructose; sweet aversion", "ALDOB gene testing; fructose tolerance test (obsolete)", "Fructose-free diet", "ATP depletion → hepatocyte necrosis"), ("Gaucher Disease T1", "β-glucocerebrosidase (GBA)", "Hepatosplenomegaly; 'crumpled paper' Gaucher cells", "Leukocyte enzyme assay; GBA gene", "ERT (imiglucerase)", "No neurological involvement in T1"), ] R1_TOP = S1_TOP + 0.22 for idx, row in enumerate(rows1): ry = R1_TOP + idx * ROW_H bg = ROW_ODD if idx % 2 == 0 else ROW_EVEN # Row background add_rect(slide, 0.12, ry, 13.09, ROW_H, bg) for i, (cx, cw, cell) in enumerate(zip(col_x, col_w, row)): add_text_box(slide, cx+0.04, ry+0.02, cw-0.06, ROW_H-0.04, cell, 6.2, bold=(i==0), color=DARK_TEXT, align=PP_ALIGN.LEFT) # ─── SECTION 2 LABEL ────────────────────────────────────────── S2_TOP = R1_TOP + len(rows1) * ROW_H add_rect(slide, 0.12, S2_TOP, 13.09, 0.22, HEMO_BAR) add_text_box(slide, 0.15, S2_TOP+0.02, 8.0, 0.19, "▸ PART 2 — HEMOCHROMATOSIS", 7.5, bold=True, color=WHITE, align=PP_ALIGN.LEFT) # Hemochromatosis rows rows2 = [ ("HH Type 1 (HFE)", "C282Y / H63D (HFE gene, chr 6)", "Bronze diabetes; arthropathy (2nd/3rd MCP); cirrhosis; HCC (8×risk)", "TS >45%; ferritin >300 µg/L; HFE genotyping", "Phlebotomy (weekly until ferritin <50)", "Most common genetic liver Dx in N. Europeans"), ("HH Type 2A/B\n(Juvenile)", "HJV / hepcidin mutations", "Severe iron overload before age 30; cardiomyopathy; hypogonadism", "TS; ferritin; HJV/HAMP genotyping", "Phlebotomy ± chelation", "Hepcidin pathway — most severe form"), ("HH Type 3", "TFR2 mutation", "Similar to Type 1 but earlier onset", "TFR2 gene testing", "Phlebotomy", "Rare"), ("HH Type 4 (Ferroportin Dis.)", "FPN mutation (4A loss-of-fn / 4B gain-of-fn)", "4A: iron trapped in macrophages, high ferritin, low/normal TS\n4B: mimics Type 1", "FPN gene testing; TS & ferritin pattern", "Phlebotomy (may be poorly tolerated in 4A)", "Only AD hemochromatosis"), ("Secondary IO\n(Thalassemia)", "Transfusion-dependent iron loading", "Organ damage from iron overload; hepatic fibrosis", "MRI liver (T2*/R2 quantification); ferritin", "Iron chelation (deferasirox, deferoxamine)", "ICT initiated after >10 PRBC transfusions"), ] R2_TOP = S2_TOP + 0.22 for idx, row in enumerate(rows2): ry = R2_TOP + idx * ROW_H bg = HEMO_ROW_ODD if idx % 2 == 0 else ROW_EVEN add_rect(slide, 0.12, ry, 13.09, ROW_H, bg) for i, (cx, cw, cell) in enumerate(zip(col_x, col_w, row)): add_text_box(slide, cx+0.04, ry+0.02, cw-0.06, ROW_H-0.04, cell, 6.2, bold=(i==0), color=DARK_TEXT, align=PP_ALIGN.LEFT) # ─── FOOTER ─────────────────────────────────────────────────── footer_y = R2_TOP + len(rows2) * ROW_H + 0.04 add_rect(slide, 0, footer_y, 13.33, 0.2, HEADER_DARK) add_text_box(slide, 0.2, footer_y+0.02, 12.9, 0.16, "LT = Liver Transplant | HCC = Hepatocellular Carcinoma | ALF = Acute Liver Failure | TS = Transferrin Saturation | IEF = Isoelectric Focusing | ICT = Iron Chelation Therapy | ERT = Enzyme Replacement Therapy", 5.5, bold=False, color=WHITE, align=PP_ALIGN.CENTER) # ─── SAVE ───────────────────────────────────────────────────── import os os.makedirs('/tmp/workspace/imld_output', exist_ok=True) out_path = '/tmp/workspace/imld_output/Inherited_Metabolic_Liver_Disorders_with_Summary.pptx' prs.save(out_path) print(f"Saved: {out_path}") print(f"Total slides: {len(prs.slides)}") print(f"Summary is slide {len(prs.slides)}") # Quick sanity check of layout total_h = TOP + ROW_H + 0.22 + len(rows1)*ROW_H + 0.22 + len(rows2)*ROW_H + 0.24 print(f"Total height used: {total_h:.2f} inches (slide is 7.5\")") EOF
python3 << 'EOF' from pptx import Presentation from pptx.util import Inches, Pt, Emu from pptx.dml.color import RGBColor from pptx.enum.text import PP_ALIGN import os # Colors BG_COLOR = RGBColor(0xE0, 0xF5, 0xF7) HEADER_DARK = RGBColor(0x00, 0x5C, 0x6A) ACCENT_ORANGE = RGBColor(0xF5, 0xA6, 0x23) COL_HEADER = RGBColor(0x00, 0x7D, 0x8E) ROW_EVEN = RGBColor(0xF0, 0xFB, 0xFC) ROW_ODD = RGBColor(0xCC, 0xEC, 0xF0) SECTION_BAR = RGBColor(0x00, 0x5C, 0x6A) HEMO_BAR = RGBColor(0x7B, 0x3F, 0x00) HEMO_ROW_ODD = RGBColor(0xF5, 0xE6, 0xD3) WHITE = RGBColor(0xFF, 0xFF, 0xFF) DARK_TEXT = RGBColor(0x1A, 0x1A, 0x2E) prs = Presentation('/tmp/workspace/attachments/d7a15732-e26c-4321-be21-c8311f46b80f/Inherited_Metabolic_Liver_Disorders.pptx') blank_layout = next(l for l in prs.slide_layouts if l.name == 'Blank') slide = prs.slides.add_slide(blank_layout) def rect(slide, x, y, w, h, fill, line=False): s = slide.shapes.add_shape(1, Inches(x), Inches(y), Inches(w), Inches(h)) s.fill.solid(); s.fill.fore_color.rgb = fill if line: s.line.color.rgb = RGBColor(0xBB,0xBB,0xBB); s.line.width = Pt(0.3) else: s.line.fill.background() return s def txt(slide, x, y, w, h, text, size, bold=False, color=WHITE, align=PP_ALIGN.LEFT, italic=False): tb = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h)) tf = tb.text_frame; tf.word_wrap = True p = tf.paragraphs[0]; p.alignment = align run = p.add_run(); run.text = text run.font.size = Pt(size); run.font.bold = bold run.font.italic = italic; run.font.color.rgb = color return tb # Layout constants (tweaked to fit 7.5") HEADER_H = 0.60 ACCENT_H = 0.04 COL_HDR_H = 0.33 SEC_H = 0.20 ROW_H = 0.335 # row height FOOTER_H = 0.18 N_ROWS1 = 11 N_ROWS2 = 5 total = HEADER_H + ACCENT_H + COL_HDR_H + SEC_H + N_ROWS1*ROW_H + SEC_H + N_ROWS2*ROW_H + FOOTER_H print(f"Total height: {total:.3f}\"") # target ≤ 7.5" col_x = [0.10, 1.60, 3.72, 6.85, 9.42, 11.42] col_w = [1.48, 2.10, 3.11, 2.55, 1.98, 1.79] # BG rect(slide, 0, 0, 13.33, 7.5, BG_COLOR) # Header rect(slide, 0, 0, 13.33, HEADER_H, HEADER_DARK) rect(slide, 0, HEADER_H, 13.33, ACCENT_H, ACCENT_ORANGE) txt(slide, 0.2, 0.05, 12.9, HEADER_H-0.08, "INHERITED METABOLIC LIVER DISORDERS — MASTER SUMMARY", 14, bold=True, color=WHITE, align=PP_ALIGN.CENTER) # Column headers CY = HEADER_H + ACCENT_H labels = ["Disease", "Gene / Defect", "Key Clinical Feature", "Hallmark Dx Test", "Treatment", "Special Note"] for cx, cw, lb in zip(col_x, col_w, labels): rect(slide, cx, CY, cw, COL_HDR_H, COL_HEADER) txt(slide, cx+0.03, CY+0.04, cw-0.05, COL_HDR_H-0.05, lb, 7, bold=True, color=WHITE, align=PP_ALIGN.CENTER) # ── SECTION 1 ──────────────────────────────────────────────── S1Y = CY + COL_HDR_H rect(slide, 0.10, S1Y, 13.13, SEC_H, SECTION_BAR) txt(slide, 0.15, S1Y+0.02, 9, SEC_H-0.04, "▸ PART 1 — INHERITED METABOLIC DISORDERS", 7.5, bold=True, color=WHITE, align=PP_ALIGN.LEFT) rows1 = [ ("α1-AT Deficiency", "SERPINA1 / Z-protein misfolding", "Cholestasis (neonate); cirrhosis; HCC (adult males)", "Phenotype PiZZ;\nbiopsy PAS+ globules", "Supportive; LT", "2nd most common\nmetabolic liver Dx"), ("GSD Type I\n(Von Gierke)","G6Pase\n(G6PC / SLC37A4)", "Fasting hypoglycemia + lactic acidosis;\nhepatomegaly; adenomas (2nd–3rd decade)", "Fasting glucose;\nenzyme assay; G6PC gene", "Cornstarch diet;\nfrequent feeds", "Type Ib: neutropenia\n+ GI infections"), ("GSD Type III\n(Cori)", "Debranching enzyme\n(AGL)", "Hepatomegaly + myopathy;\nmild hypoglycemia", "AGL enzyme/gene", "High-protein diet", "Liver improves with age;\nmuscle worsens"), ("GSD Type IV\n(Andersen)", "Branching enzyme\n(GBE1)", "Amylopectin deposits;\ncirrhosis by age 3", "Liver biopsy PAS+;\nGBE1 gene", "Liver transplant\n(cardiac risk post-LT)", "Amylopectin may\npersist in heart"), ("Tyrosinemia HT-1", "FAH\n(fumarylacetoacetate hydrolase)", "ALF in infancy; HCC; porphyria-like crises", "Urine succinylacetone\n(pathognomonic)", "Nitisinone + low-Tyr diet; LT", "SA detectable on\nnewborn blood spot"), ("CDG Type Ib", "Phosphomannose\nisomerase (MPI)", "Hepatic fibrosis;\nprotein-losing enteropathy", "Serum transferrin IEF", "Oral mannose\n(only treatable CDG)", "CDG Ia (PMM2) most\ncommon; no specific Rx"), ("Porphyria — AIP", "PBGD\n(haploinsufficiency, AD)", "Abdominal pain + autonomic + neuropsychiatric symptoms", "Urine ALA & PBG\n(elevated during attacks)","IV hemin;\ncarbohydrate loading", "Triggered by drugs/\nfasting/hormones"), ("PCT", "UROD", "Blistering photosensitivity;\nHCV-associated", "Urine/plasma\nuroporphyrins", "Phlebotomy;\nhydroxychloroquine", "Most common\nporphyria overall"), ("Galactosemia", "GALT (AR)", "Neonatal ALF; cataracts;\nE. coli sepsis", "RBC GALT assay;\nnewborn screen", "Lactose-free diet", "Galactitol → cataracts;\novarian failure"), ("Hereditary Fructose\nIntolerance","Aldolase B\n(ALDOB, AR)", "Vomiting + hypoglycemia after fructose;\nsweet aversion", "ALDOB gene testing", "Fructose-free diet", "ATP depletion →\nhepatocyte necrosis"), ("Gaucher Disease T1", "β-glucocerebrosidase\n(GBA, AR)", "Hepatosplenomegaly; 'crumpled paper' Gaucher cells;\nbone marrow infiltration","Leukocyte enzyme assay;\nGBA gene","ERT (imiglucerase)", "No neurological\ninvolvement in Type 1"), ] RY = S1Y + SEC_H for i, row in enumerate(rows1): ry = RY + i * ROW_H bg = ROW_ODD if i % 2 == 0 else ROW_EVEN rect(slide, 0.10, ry, 13.13, ROW_H, bg, line=True) for j, (cx, cw, cell) in enumerate(zip(col_x, col_w, row)): txt(slide, cx+0.04, ry+0.025, cw-0.07, ROW_H-0.04, cell, 5.8, bold=(j==0), color=DARK_TEXT, align=PP_ALIGN.LEFT) # ── SECTION 2 ──────────────────────────────────────────────── S2Y = RY + N_ROWS1 * ROW_H rect(slide, 0.10, S2Y, 13.13, SEC_H, HEMO_BAR) txt(slide, 0.15, S2Y+0.02, 9, SEC_H-0.04, "▸ PART 2 — HEMOCHROMATOSIS (IRON OVERLOAD DISORDERS)", 7.5, bold=True, color=WHITE, align=PP_ALIGN.LEFT) rows2 = [ ("HH Type 1 (HFE)", "C282Y / H63D\n(HFE gene, chr 6)", "Bronze diabetes; arthropathy (2nd/3rd MCP);\ncirrhosis; HCC (8× risk)", "TS >45%; ferritin >300 µg/L;\nHFE genotyping", "Phlebotomy (weekly;\ngoal ferritin <50 µg/L)", "Most common genetic\nliver Dx in N. Europeans"), ("HH Type 2 A/B\n(Juvenile HH)", "HJV / hepcidin mutations\n(HAMP)", "Severe iron overload <30 yrs;\ncardiomyopathy; hypogonadism", "TS; ferritin;\nHJV / HAMP genotyping", "Phlebotomy ± chelation", "Most severe form;\nhepcidin pathway"), ("HH Type 3", "TFR2 mutation", "Similar to Type 1;\nearler onset", "TFR2 gene testing", "Phlebotomy", "Rare"), ("HH Type 4\n(Ferroportin Dis.)", "FPN mutation\n(4A: LOF / 4B: GOF)", "4A: iron in macrophages, high ferritin, normal/low TS\n4B: mimics Type 1", "FPN gene testing;\nTS & ferritin pattern", "Phlebotomy\n(poorly tolerated in 4A)", "Only autosomal\ndominant HH"), ("Secondary IO\n(Thalassemia)", "Transfusion-dependent\niron loading", "Hepatic fibrosis; organ damage;\nhigh HCC risk in Thal. Intermedia", "MRI liver T2*/R2;\nferritin >1000 µg/L", "Deferasirox / deferoxamine\n(after >10 PRBC transfusions)", "ICT started after 2–3 yrs\nof regular transfusions"), ] RY2 = S2Y + SEC_H for i, row in enumerate(rows2): ry = RY2 + i * ROW_H bg = HEMO_ROW_ODD if i % 2 == 0 else ROW_EVEN rect(slide, 0.10, ry, 13.13, ROW_H, bg, line=True) for j, (cx, cw, cell) in enumerate(zip(col_x, col_w, row)): txt(slide, cx+0.04, ry+0.025, cw-0.07, ROW_H-0.04, cell, 5.8, bold=(j==0), color=DARK_TEXT, align=PP_ALIGN.LEFT) # ── FOOTER ─────────────────────────────────────────────────── FY = RY2 + N_ROWS2 * ROW_H rect(slide, 0, FY, 13.33, 0.18, HEADER_DARK) txt(slide, 0.15, FY+0.02, 13.0, 0.15, "LT = Liver Transplant | HCC = Hepatocellular Carcinoma | ALF = Acute Liver Failure | TS = Transferrin Saturation | IEF = Isoelectric Focusing | ICT = Iron Chelation Therapy | LOF/GOF = Loss/Gain of Function | ERT = Enzyme Replacement Therapy", 5, bold=False, color=WHITE, align=PP_ALIGN.CENTER) os.makedirs('/tmp/workspace/imld_output', exist_ok=True) out_path = '/tmp/workspace/imld_output/Inherited_Metabolic_Liver_Disorders_with_Summary.pptx' prs.save(out_path) print(f"Saved: {out_path}") print(f"Total slides: {len(prs.slides)}") print(f"Total height used: {FY + 0.18:.3f}\" / 7.5\"") EOF
python3 -c " from pptx import Presentation prs = Presentation('/tmp/workspace/imld_output/Inherited_Metabolic_Liver_Disorders_with_Summary.pptx') slide = prs.slides[-1] print(f'Slide 71 shapes: {len(slide.shapes)}') texts = [s.text_frame.text[:60] for s in slide.shapes if s.has_text_frame and s.text_frame.text.strip()] for t in texts[:8]: print(' -', repr(t)) print(f'... ({len(texts)} text boxes total)') "
Inherited Metabolic Liver Disorders with Summary
Presentation · PPTX
| Column | Content |
|---|---|
| Disease | Name of the disorder |
| Gene / Defect | Causative gene/enzyme |
| Key Clinical Feature | Cardinal presentation |
| Hallmark Dx Test | Diagnostic gold standard |
| Treatment | Primary management |
| Special Note | Clinically important pearl |