odfdo 3.23.1


pip install odfdo

  Latest version

Released: Jul 22, 2026


Meta
Author: Jérôme Dumonteil
Requires Python: >=3.10, <4

Classifiers

Development Status
  • 5 - Production/Stable

Environment
  • Console

Intended Audience
  • Developers

Programming Language
  • Python
  • Python :: 3
  • Python :: 3 :: Only
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14

Operating System
  • OS Independent

Topic
  • Software Development :: Libraries :: Python Modules

odfdo

Release Build Status License PyPI Downloads

OpenDocument Format (ODF, ISO/IEC 26300) library for Python

logo

odfdo is a Python library for programmatically creating, parsing, and editing OpenDocument Format (ODF) files. It provides an interface for interacting with .odt, .ods, .odp, and other ODF file types. The library comes with a set of utilities and recipes for common actions to make it easier to use.

  • Document Creation: Generate new ODF documents.
  • Content Manipulation: Add, modify, or delete text, paragraphs or tables.
  • Table Operations: Create, populate, and modify tables.
  • Style Management: Control formatting through different ways.
  • Drawing and Presentation: Less advanced features, but allow work with elements in .odg and .odp files.
  • Metadata: Read and write document metadata.

Project: https://github.com/jdum/odfdo

Author: jerome.dumonteil@gmail.com

License: Apache License, Version 2.0

odfdo is a derivative work of the former lpod-python project.

Installation

Installation from Pypi (recommended):

pip install odfdo

Installation from sources:

uv sync

After installation from sources, you can check everything is working. The tests should run for a few seconds and issue no error.

uv sync --dev
uv run pytest -n8

To generate the documentation in the ./docs directory:

uv sync --group doc
uv run python doc_src/generate_doc.py

Dependencies

The project is tested on Python 3.10 to 3.14 (Linux, Mac, Windows). See previous releases for earlier versions of Python. For Python 3.9, see branch support/python39.

A special effort has been made to limit the dependencies of this library: the only (non-development) dependency is lxml. The required versions of lxml depend mainly on the version of Python used; see the pyproject.toml file for details. The project tries to keep up with lxml version updates regularly.

Usage Overview

Creating a "Hello world" Text Document

from odfdo import Document, Paragraph

doc = Document('text')
doc.body.append(Paragraph("Hello world!"))

doc.save("hello.odt")

Modifying a Spreadsheet

from odfdo import Document

doc = Document('existing_spreadsheet.ods')
sheet = doc.body.get_sheet(0)

print(f"Value of A1: {sheet.get_cell('A1').value}")
sheet.set_value('B2', 'Updated Value')

doc.save('modified_spreadsheet.ods')

Utilities

A few scripts are provided with odfdo:

  • odfdo-diff: show a diff between the textual content of two ODT files.
  • odfdo-folder: convert a standard ODF file (zip archive) to a folder structure, or convert a folder structure back to an ODF file.
  • odfdo-flat: convert an ODF file (zip archive or folder) to a flat XML ODF file, or convert a flat ODF XML file back to an ODF zip file.
  • odfdo-headers: display the hierarchical headers (headings) of an ODF text document. The headers are printed with their numbering and can be limited by a specified depth.
  • odfdo-highlight: search for a regular expression pattern in an ODF text document and apply a highlighting style to the matching text. The style can include italic, bold, text color, and background color.
  • odfdo-markdown: convert an ODF text document to Markdown format and print to standard output.
  • odfdo-replace: find and replace text in an ODF file using a regular expression pattern.
  • odfdo-show: display various parts of an ODF document, including text content, styles, and metadata, to standard output or a specified directory.
  • odfdo-styles: manipulate styles within OpenDocument files: display, delete, or merge them.
  • odfdo-table-shrink: optimize the width and height of tables in an ODF spreadsheet by removing empty trailing rows and columns.
  • odfdo-userfield: inspect and modify user-defined fields within an ODF document.
  • odfdo-from-csv: import data from a CSV file into a new ODS (OpenDocument Spreadsheet) file.
  • odfdo-to-csv: export a table from an ODS (OpenDocument Spreadsheet) file to a CSV file.
  • odfdo-meta-print: extract and display the metadata from an ODF file.
  • odfdo-meta-update: update the metadata of an ODF file by merging from a JSON file or stripping to minimal content.

tl;dr

'Intended Audience :: Developers'

Documentation

  • the recipes folder contains more than 60 working sample scripts,
  • the auto-generated documentation exposes public APIs and recipes.

Online documentation: https://jdum.github.io/odfdo

About styles

The best way to apply style is by merging styles from a template document into your generated document (See odfdo-styles script). Styles are a complex matter in ODF, so trying to generate styles programmatically is not recommended. Several recipes provide an example of manipulating styles, including: change_paragraph_styles_methods.py,create_basic_text_styles, add_text_span_styles.

Related project

If you work on .ods files (spreadsheet), you may be interested by these scripts using this library to parse/generate .ods files: https://github.com/jdum/odsgenerator and https://github.com/jdum/odsparsator

Former lpod-python library

lpod-python was written in 2009-2010 as a Python 2.x library, see: https://github.com/lpod/lpod-python

odfdo is an adaptation of this former project to Python 3.x with several improvements.

3.23.1 Jul 22, 2026
3.23.0 Jul 18, 2026
3.22.12 Jul 14, 2026
3.22.11 Jul 11, 2026
3.22.10 Jul 05, 2026
3.22.9 Jul 04, 2026
3.22.8 May 08, 2026
3.22.7 May 04, 2026
3.22.6 Apr 18, 2026
3.22.5 Apr 11, 2026
3.22.4 Apr 04, 2026
3.22.3 Mar 29, 2026
3.22.2 Mar 29, 2026
3.22.1 Mar 22, 2026
3.22.0 Mar 07, 2026
3.21.0 Feb 28, 2026
3.20.2 Feb 07, 2026
3.20.1 Feb 07, 2026
3.20.0 Feb 01, 2026
3.19.0 Jan 02, 2026
3.18.3 Dec 20, 2025
3.18.2 Dec 13, 2025
3.18.1 Dec 07, 2025
3.18.0 Dec 07, 2025
3.17.6 Nov 23, 2025
3.17.5 Nov 15, 2025
3.17.4 Nov 09, 2025
3.17.3 Nov 01, 2025
3.17.2 Oct 25, 2025
3.17.1 Oct 18, 2025
3.17.0 Oct 11, 2025
3.16.8 Oct 05, 2025
3.16.7 Sep 20, 2025
3.16.6 Sep 13, 2025
3.16.5 Sep 06, 2025
3.16.4 Aug 30, 2025
3.16.3 Aug 16, 2025
3.16.2 Aug 15, 2025
3.16.1 Aug 09, 2025
3.16.0 Aug 02, 2025
3.15.1 Jul 26, 2025
3.15.0 Jul 20, 2025
3.14.10 Jul 14, 2025
3.14.9 Jul 08, 2025
3.14.8 Jul 06, 2025
3.14.7 Jul 06, 2025
3.14.6 Jun 29, 2025
3.14.5 Jun 28, 2025
3.14.4 Jun 21, 2025
3.14.3 Jun 14, 2025
3.14.2 Jun 07, 2025
3.14.1 Jun 01, 2025
3.14.0 May 26, 2025
3.13.12 May 17, 2025
3.13.11 May 10, 2025
3.13.10 Apr 20, 2025
3.13.9 Mar 22, 2025
3.13.8 Mar 15, 2025
3.13.7 Mar 08, 2025
3.13.6 Feb 04, 2025
3.13.5 Jan 25, 2025
3.13.4 Jan 22, 2025
3.13.3 Jan 01, 2025
3.13.2 Dec 15, 2024
3.13.1 Dec 14, 2024
3.13.0 Dec 07, 2024
3.12.1 Nov 30, 2024
3.12.0 Nov 30, 2024
3.11.0 Nov 24, 2024
3.10.1 Nov 23, 2024
3.10.0 Nov 23, 2024
3.9.4 Nov 06, 2024
3.9.3 Oct 14, 2024
3.9.2 Oct 05, 2024
3.9.1 Sep 29, 2024
3.9.0 Sep 22, 2024
3.8.0 Aug 25, 2024
3.7.13 Aug 17, 2024
3.7.12 Aug 11, 2024
3.7.11 May 25, 2024
3.7.10 May 04, 2024
3.7.9 May 03, 2024
3.7.8 May 02, 2024
3.7.7 Apr 01, 2024
3.7.6 Mar 30, 2024
3.7.5 Mar 23, 2024
3.7.4 Mar 17, 2024
3.7.3 Mar 10, 2024
3.7.2 Mar 09, 2024
3.7.0 Mar 02, 2024
3.6.0 Feb 25, 2024
3.5.1 Feb 20, 2024
3.5.0 Jan 27, 2024
3.4.7 Jan 15, 2024
3.4.6 Dec 25, 2023
3.4.5 Dec 24, 2023
3.4.4 Dec 23, 2023
3.4.3 Dec 17, 2023
3.4.2 Dec 15, 2023
3.4.1 Oct 28, 2023
3.4.0 Oct 26, 2023
3.3.7 Oct 15, 2023
3.3.6 Oct 07, 2023
3.3.5 Oct 07, 2023
3.3.2 Aug 20, 2022
3.3.1 Mar 30, 2021

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras: None
Dependencies:
lxml (<5.1.1,>=4.8.0)
lxml and (<7,>=4.9.4)
lxml (<7,>=5.3.0)
typing-extensions (>=4.15.0)