skillfed

odfpy

Python API and tools to manipulate OpenDocument files

odfpy v1.4.1 4.3M downloads/30d#2,327 on PyPI362
License unclear Active released

What it is and what it does

Odfpy is a Python library for reading and writing OpenDocument Format (ODF) files—the standard format used by LibreOffice, OpenOffice, and other office suites. It provides a complete API generated from the ODF RelaxNG schema and hand-edited to cover all valid ODF constructions. The library enforces document validity at the API level, raising exceptions when you attempt invalid operations such as adding unknown attributes, omitting required fields, or placing text in elements that forbid it.

Beyond the core API, odfpy includes command-line tools for common tasks: converting CSV to ODF spreadsheets, transforming ODF documents to HTML or XHTML, extracting and modifying metadata, validating ODF files, and converting between ODF and XML representations. It has no external runtime dependencies, making it lightweight to deploy, though installation friction is high and the package has not seen a release since 2020-01-18 despite active repository commits.

Use it for:

  • Generate ODF spreadsheets or text documents programmatically with built-in validation to catch structural errors before saving.
  • Convert CSV data into OpenDocument spreadsheet files using the csv2odf command-line tool.
  • Transform ODF documents to HTML or XHTML for web viewing or archival using odf2xhtml or odf2mht.
  • Inspect and modify ODF file metadata without opening the document in an office application.
  • Validate ODF files for structural correctness and report problems using the odflint tool.
  • Extract or manipulate user-defined fields in ODF documents via the odfuserfield command.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Odfpy reads and writes OpenDocument v. 1.2 files with validation to prevent invalid document construction, enforcing grammar rules, required attributes, and element content constraints.

Yes, with conditions. Odfpy is stable, actively maintained at the repository level, and has no known vulnerabilities. It is suitable for production use if your target Python version falls within the documented range (2.7, 3.4–3.7) or you verify compatibility with newer versions. The high install friction and gap since the last release (2020-01-18) suggest caution: test thoroughly in your environment, and verify that the unclear license terms (Apache, GPL, LGPL) align with your project's requirements.

Install

odfpy on PyPI

pip

pip install odfpy

uv

uv add odfpy

poetry

poetry add odfpy

Installing odfpy

Before you install

Install friction is high; the package has no runtime dependencies but distribution artifacts suggest build complexity. Maintenance is active with recent commits (2026-04-07), though the latest release dates to 2020-01-18, leaving a gap between release and current repository state.

License in practice

License treatment is unclear: the package declares Apache, GPL, and LGPL in its classifiers but provides no explicit license text or SPDX identifier in metadata. Users should verify the actual license terms before adopting.

Quickstart

pip install odfpy

import odfpy
# Create and manipulate OpenDocument files programmatically
# See https://github.com/eea/odfpy/wiki for documentation and examples

Classifiers indicate support for Python 2.7 and 3.4–3.7; compatibility with modern Python versions is unspecified. Verify compatibility with your target Python version before use.

Verify before relying

  • Whether the package works reliably on Python versions beyond 3.7 (classifiers end at 3.7; last release was 2020-01-18)
  • Current state of the command-line tools (csv2odf, odf2xhtml, odflint, etc.) and whether they are fully functional
  • Whether high install friction reflects missing build dependencies or outdated packaging

Package facts

License not declared (unclear)
Python support not specified
Install friction high — source build required
Runtime dependencies none
Maintenance actively maintained — 2,400 days since the last release
Last repo commit
First released
Downloads 4,332,065/month — #2,327 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: odfpy-1.4.1-py2.7.egg; odfpy-1.4.1.tar.gz

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: End Users/DesktopIntended Audience :: System AdministratorsLicense :: OSI Approved :: Apache Software LicenseLicense :: OSI Approved :: GNU General Public License (GPL)License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)Operating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Topic :: Office/BusinessTopic :: Software Development :: Libraries :: Python Modules

Tags

opendocument file manipulationodf read write libraryodf validationspreadsheet document conversionodf to html conversiondocument metadata editingodf command line tools
document-formatoffice-automationcli-tools

More Python Modules packages