forked from scanny/python-pptx
-
Notifications
You must be signed in to change notification settings - Fork 0
[Epic] Modernization & Ergonomics — PathLike, UTC datetimes, dev-tooling #29
Copy link
Copy link
Closed
Labels
area:dxFeature area: dxFeature area: dxepicMulti-feature roadmap epicMulti-feature roadmap epicprior-art:forkActive community fork has shipped thisActive community fork has shipped thisprior-art:upstream-prOpen PR on scanny/python-pptx is candidate cherry-pickOpen PR on scanny/python-pptx is candidate cherry-pickpriority:P0Highest user demand or strategic valueHighest user demand or strategic valuestatus:quick-winHigh user demand, small implementationHigh user demand, small implementation
Milestone
Metadata
Metadata
Assignees
Labels
area:dxFeature area: dxFeature area: dxepicMulti-feature roadmap epicMulti-feature roadmap epicprior-art:forkActive community fork has shipped thisActive community fork has shipped thisprior-art:upstream-prOpen PR on scanny/python-pptx is candidate cherry-pickOpen PR on scanny/python-pptx is candidate cherry-pickpriority:P0Highest user demand or strategic valueHighest user demand or strategic valuestatus:quick-winHigh user demand, small implementationHigh user demand, small implementation
Problem
Developer-experience quality-of-life improvements that don't fit any single feature epic but compound across all of them. python-pptx's API still rejects
pathlib.Pathinputs (scanny/python-pptx#1123), uses naive datetimes (scanny/python-pptx#957), has Python 3.10collectionsdeprecation hits (scanny/python-pptx#771), and lacks a clean shape-by-name lookup (scanny/python-pptx#798, #309, #532). TheFont.colorgetter mutates XML by inserting<a:solidFill/>(scanny/python-pptx#1111, #1074) — a long-standing footgun.Slide.background._elementreturns the wrong element (scanny/python-pptx#1126). Dev-tooling is dated: the upstream is moving towarduv/ruff/pyright(semaverse-pptx fork demonstrates the path) but our fork still uses the older unittest+pytest+behave hybrid.Sub-features
API ergonomics
Presentation()andadd_picture()acceptpathlib.Path(closes scanny/python-pptx#1123 — clean cherry-pick)Shapes.by_name(name)lookup helper (closes scanny/python-pptx#798)Shapes.iter_leaf_shapes()traversal (closes scanny/python-pptx#435)ShapesandSlidePlaceholdersfulfillcollections.abc.Mapping(scanny/python-pptx#800)Shape.find_by_xpath()for power usersBug fixes that pollute every other epic if left unfixed
Font.colorgetter must not mutate XML on access (closes #1111, #1074)Slide.background._elementreturns<p:bg>not<p:cSld>(closes #1126)collections.abcimport paths (closes scanny/python-pptx#771)PERCENT_40enum typo (closes #1127)Dev-tooling modernization
uvfor dependency managementruff checkstrict gatespyrightstrict-mode gate to CIpytest-syrupysnapshot tests for XML fixtures (semaverse-pptx pattern)Prior art
shapes.by_name. scanny/python-pptx#800 Mapping ABC. scanny/python-pptx#1131 PERCENT_40 typo. scanny/python-pptx#1104DelimitedList(cleaner alternative to our pyparsing<3 pin).semaverse-ai/semaverse-pptx— uv / ruff / pyright / pytest-syrupy modernization. The reference for our dev-tooling phase.madflow/python-pptx— pure CI maintenance branch (latest Python versions, deprecation fixes).loadfix/python-pptxiter_leaf_shapes,Slide.clear_shapes.presentation.py,parts/image.py,dml/color.py,text/fonts.py,slide.py,oxml/slide.py,pyproject.toml,tox.ini, GitHub Actions workflows.Acceptance criteria
Presentation(Path("deck.pptx"))works without TypeError.font.coloraccess on an unstyled run does NOT modify the underlying XML (assert with byte-diff).slides[0].shapes.by_name("Title")returns the title shape.pyrightstrict mode runs in CI with zero errors on the public API.Effort: M
Bundle of small wins that compound. Recommend cherry-picking the trivial ones first (scanny/python-pptx#1123 PathLike, scanny/python-pptx#1131 typo, scanny/python-pptx#771 collections) in a single "ergonomics 1" patch release, then bug fixes (Font.color mutation, slide.background) in a second, then dev-tooling modernization (Phase 3).