Browse documentation
DocsAPI module

lokit.parse

Materialize supported localization inputs into a `BaseStructure`.

01

Public entry points

InputFunction
Auto-detected fileparse.file
.lokitparse.lokit
TMXparse.tmx, parse.tmx_parallel
XLIFFparse.xliff
CSV / XLSXparse.csv, parse.xlsx
Multilingual CSV / XLSX splitparse.csv_targets, parse.xlsx_targets
PO/POTparse.po, parse.po_targets
JSON i18n / HTML / IDMLparse.json_i18n, parse.html, parse.idml
Word / PowerPointparse.docx, parse.pptx
02

Format-specific controls

Prefer explicit parsers whenever correctness depends on a locale, target language, spreadsheet column, TMX parse mode, tag policy, or Office option. parse.file() intentionally exposes no format-specific option channel.

parse.py
import lokitfrom lokit.types import TagSyntax, UnsupportedTagPolicy
document = lokit.parse.xliff(    "messages.xliff",    include_tags=True,    tag_syntax=TagSyntax.NATIVE,    unsupported_tags=UnsupportedTagPolicy.ERROR,)
03

Dictionary projection

parse.to_dict() materializes flat, string-only rows for .lokit, TMX, and XLIFF paths. An already parsed BaseStructure can project itself regardless of its original format.