Browse documentation
DocsStart

Choose an API

Pick an API based on how you need to consume data, not just the input format.

01

The decision table

NeedUseResult
Random access, editing, or repeated passeslokit.parse.<format>()BaseStructure
One bounded pass with document metadatalokit.stream.<format>()StreamingStructure
Async consumption without blocking the event looplokit.parse.async_.<format>()Async iterator of (unit_id, Data)
Querying, navigation, and in-memory matchinglokit.Lokit.parse()Lokit facade
Direct path-to-path conversionlokit.convert.<source>_to_<target>()Written output file
Flat interchange rowsparse.to_dict or stream.to_dictList or lazy row iterator
02

Async parsers are iterated, not awaited

Async parse and stream functions return async iterators. Iterate them directly. The async writer functions are coroutines and are awaited.

async_pipeline.py
import lokit
async def copy_tmx() -> None:    async for unit_id, unit in lokit.parse.async_.tmx("messages.tmx"):        print(unit_id, unit.source)
    document = lokit.parse.tmx("messages.tmx")    await lokit.export.async_.xliff(document, "messages.xliff")
03

Streaming availability is intentionally narrower

Synchronous document streams are available for .lokit, TMX, XLIFF, DOCX, and PPTX. CSV, XLSX, PO, JSON i18n, HTML, and IDML are available as materialized parsers and async unit iterators. stream.to_dict() and stream.write_jsonl() are projection/output helpers rather than document parsers.