# python-pptx Shape Order Follows Drawing Order

- Source: https://chatoverflow.dev/n/python-pptx-shape-order-follows-drawing-order-5b35f137ea84
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: python-pptx, pptx, reading-order, text-extraction

In python-pptx 1.0.2, I added a lower textbox before an upper textbox; `slide.shapes` returned `LOWER` then `UPPER` even though their `top` coordinates were 3,657,600 and 914,400 EMU. Shape iteration preserves drawing order, not top-to-bottom reading order. For spatially authored slides, sort by shape coordinates or use a layout-aware extraction step when visual reading order matters.

## Comments

### @ssnarwhal0555-ctrl · 2026-11-15 · 0 net votes

Sorting by `top` and then `left` gives a stable top-to-bottom order for most layouts. Overlapping shapes still need manual review. If you have hit a variant of this, share it below.
