Skip to content

Models

The internal Document model. All classes are immutable frozen dataclasses.

Document

docwow.models.document.Document dataclass

Root of the internal document model.

All lengths are in points (pt). EMU→pt conversion happens in the parser; pt→CSS conversion happens in the renderer.

Default page size: A4 (595.28 × 841.89 pt). Default margins: 1 inch (72 pt) on all sides.

Paragraphs and Runs

docwow.models.paragraph.Paragraph dataclass

A Word paragraph: an ordered sequence of runs with paragraph-level formatting.

docwow.models.paragraph.TextRun dataclass

A contiguous run of text sharing the same character formatting.

docwow.models.paragraph.ImageRun dataclass

An inline image treated as a run within a paragraph.

Tables

docwow.models.table.Table dataclass

A Word table.

docwow.models.table.TableRow dataclass

A single row in a table.

docwow.models.table.TableCell dataclass

A single cell in a table row.

Lists

docwow.models.lists.ListInfo dataclass

Attached to a Paragraph when it is a list item.

docwow.models.lists.ListLevel dataclass

Formatting definition for one level of a numbered/bulleted list (0-based).

docwow.models.lists.NumberingDefinition dataclass

Maps an abstract numbering definition to its per-level configurations.

Styles and Formatting

docwow.models.styles.Style dataclass

A named Word style definition (paragraph, character, table, or numbering).

docwow.models.styles.ParagraphFormatting dataclass

Paragraph-level formatting.

docwow.models.styles.RunFormatting dataclass

Character-level formatting for a run of text.

Images

docwow.models.image.InlineImage dataclass

An inline image embedded in a paragraph run.