Install & Compatibility
Where this runs
tested against v3.22.8 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.280s · 40.4MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.4s · import 0.278s · 41MB
34MB installed
● package 34MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Document
✓ from odfdo import Document
Top-level import works.
Paragraph
✓ from odfdo import Paragraph
Top-level import works.
ParagraphStyle
✓ from odfdo.style import ParagraphStyle
✗ from odfdo import Style
In v3.x, Style classes moved to submodule.
Element
✓ from odfdo.element import Element
✗ from odfdo import Element
Deprecated flat import, but still works (will be removed in future).
Creates a simple ODT file with a paragraph.
from odfdo import Document, Paragraph
from odfdo.style import ParagraphStyle
# Create a new text document
doc = Document('text')
body = doc.body
# Add content
body.append(Paragraph('Hello, ODF!'))
# Save
doc.save('hello.odt')
print('Document created.')
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'odfdo'
Library not installed or installed for wrong Python environment.
fixRun `pip install odfdo` in the correct environment (e.g., virtualenv).
ImportError: cannot import name 'Style' from 'odfdo'
In v3.x, Style was moved to `odfdo.style`.
fixUse `from odfdo.style import ParagraphStyle` or `from odfdo.style import Style`.
AttributeError: 'Document' object has no attribute 'save'
Misspelled method `save`; correct is `save` (lowercase).
fixUse `doc.save('filename.odt')`. ValueError: Unknown document type 'Text'
Document type must be lowercase: 'text', 'spreadsheet', or 'presentation'.
fixUse `Document('text')` instead of `Document('Text')`. TypeError: 'odfdo.element.Element' object is not callable
Trying to call an Element instance as a function, likely misusing `body()` instead of `body.append()`.
fixUse `body.append(...)` not `body(...)`.
Upgrade
Version history
3.22.8latest on PyPI · released May 8, 2026
Audit
Dependencies
lxmlrequiredXML parsing and serialization required for ODF manipulation.