{"id":28096,"library":"pypptx-with-oxml","title":"python-pptx with oxml access","description":"A fork of python-pptx (v1.0.3) that exposes the oxml internal module for direct XML manipulation while keeping the same high-level API. Provides create, read, and update support for PowerPoint 2007+ (.pptx) files. Requires Python >=3.8.","status":"active","version":"1.0.3","language":"python","source_language":"en","source_url":"https://github.com/Sidney233/python-pptx","tags":["powerpoint","pptx","oxml","fork"],"install":[{"cmd":"pip install pypptx-with-oxml","lang":"bash","label":"pip install"}],"dependencies":[{"reason":"XML processing core","package":"lxml","optional":false},{"reason":"Image handling for slides","package":"Pillow","optional":false}],"imports":[{"note":"Standard import, same as python-pptx.","symbol":"Presentation","correct":"from pptx import Presentation"},{"note":"In this fork, oxml is exposed as a top-level attribute after import pptx; 'from pptx.oxml' does not work.","wrong":"from pptx.oxml import something  # raises ImportError","symbol":"oxml","correct":"from pptx import oxml"}],"quickstart":{"code":"from pptx import Presentation\nfrom pptx.util import Inches, Pt\n\nprs = Presentation()\nslide = prs.slides.add_slide(prs.slide_layouts[6])  # blank\nslide.shapes.title.text = 'Hello, World!'\nprs.save('test.pptx')","lang":"python","description":"Create a simple presentation with one slide."},"warnings":[{"fix":"Use 'from pptx import oxml' and then access e.g. oxml.parse_xml().","message":"oxml is not a submodule; you must access it via 'from pptx import oxml' after importing pptx, not 'from pptx.oxml import ...'.","severity":"breaking","affected_versions":"all"},{"fix":"Review upstream changelog before relying on new python-pptx features.","message":"This fork may lag behind upstream python-pptx; check for feature parity.","severity":"gotcha","affected_versions":"all"},{"fix":"Prefer high-level API methods; use oxml only when necessary and validate output.","message":"Direct manipulation of oxml bypasses high-level validation; corrupt presentations are possible.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Replace 'from pptx.oxml import element' with 'from pptx import oxml' then use oxml.element.","cause":"oxml is not a package in this fork; it's a module attribute.","error":"ImportError: cannot import name 'element' from 'pptx.oxml'"},{"fix":"Ensure you have installed pypptx-with-oxml (not python-pptx) and use 'from pptx import oxml' after importing pptx.","cause":"Attempted to access oxml before importing pptx or using old import pattern.","error":"AttributeError: module 'pptx' has no attribute 'oxml'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}