GordonKit Document Converter

Getting Started

GordonKit Document Converter

Convert DOCX and other document formats to PDF, HTML, Markdown, images, and more through a Python library, CLI, or HTTP API.

About this project

This open-source GordonKit project orchestrates Microsoft Word, LibreOffice, Gotenberg, or Pandoc for document rendering. It keeps engine selection, validation, fallback reporting, and conversion results explicit and diagnosable.

Ways to use it

Choose the interface that fits your workflow. Every interface enters through the same application service and preserves structured results, engine policy, and diagnostics.

Python Library

Use typed public contracts for single conversions, isolated batches, engine probes, and service injection.

from gordon_doc_converter import convert

CLI

Convert, compare, inspect engines, and emit stable JSON results for scripts and CI workflows.

gordon-doc convert report.docx --to pdf

HTTP API

Install the FastAPI extra for private deployments with authentication hooks, rate limits, and bounded concurrency.

POST /conversions

Format support: local install

What a deployment can convert depends on the engines it carries, not on the interface it is driven through. This matrix assumes LibreOffice, Pandoc, and wkhtmltopdf on PATH, the images extra installed for page images, and, for the Word COM policy, an interactive Windows desktop with Word.

Supported input and output formats
InputDOCXPDFODTHTMLMarkdownYAMLJSONImages
DOCXNot applicableAutoLO✓✓✓✓PDF
PDFRNot applicableR✓✓✓✓✓
ODTLOLONot applicable✓✓✓✓PDF
HTMLPWLONot applicable✓✓✓PDF
MarkdownPWLO✓Not applicable✓✓PDF

Format support: container image

The published image installs libreoffice-writer with the api and gotenberg extras, so every route that prefers wkhtmltopdf or Pandoc is served by LibreOffice instead and reports an ENGINE_FALLBACK warning naming the substituted engine. The HTTP API the image serves converts DOCX to PDF only; the rest of this matrix is reached through the cli Compose profile.

Formats the container image converts
InputDOCXPDFODTHTMLMarkdownYAMLJSONImages
DOCXNot applicableAutoLO✓✓✓✓—
PDFR!Not applicableR✓✓✓✓—
ODTLOLONot applicable✓✓✓✓—
HTMLLO!LO!LONot applicable✓✓✓—
MarkdownLO!LO!LO✓Not applicable✓✓—

Install

Install the core package, then add only the optional capabilities required by your deployment.

uv add gordon-doc-converter
uv add 'gordon-doc-converter[images,gotenberg]'

First conversion

Create a request from a source path. The service selects an allowed engine, validates staged output, and publishes only after validation succeeds.

from pathlib import Path
from gordon_doc_converter import ConversionRequest, convert

request = ConversionRequest.from_source(Path("report.docx"))
result = convert(request)
print(result.artifacts[0].path)