Browse documentation
DocsAPI module
lokit.parse
Materialize supported localization inputs into a `BaseStructure`.
01
Public entry points
| Input | Function |
|---|---|
| Auto-detected file | parse.file |
| .lokit | parse.lokit |
| TMX | parse.tmx, parse.tmx_parallel |
| XLIFF | parse.xliff |
| CSV / XLSX | parse.csv, parse.xlsx |
| Multilingual CSV / XLSX split | parse.csv_targets, parse.xlsx_targets |
| PO/POT | parse.po, parse.po_targets |
| JSON i18n / HTML / IDML | parse.json_i18n, parse.html, parse.idml |
| Word / PowerPoint | parse.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.