Browse documentation
Quickstart
Install Lokit, parse a localization file, inspect its typed units, and write another format.
Install the package
The distribution name on PyPI is lokit-python; the import name is lokit. Lokit currently requires Python 3.10 or newer and is classified as beta, so pin the version used by production integrations.
python -m pip install lokit-python==0.5.4Or install with uv
Build locally for better performance using uv pip install lokit-python --no-binary :all:
or pre-compiled wheels using:
uv add lokit-pythonParse, inspect, and write
Materialized parsers return BaseStructure. Every supported input converges on the same unit model, so the write step does not depend on the original file type.
import lokit
document = lokit.parse.tmx( "messages.tmx", source_language="en", target_language="fr",)
for unit_id, unit in document.data.items(): print(unit_id, unit.source, unit.target)
lokit.write.xliff(document, "messages.fr.xliff")Use auto-detection when defaults are enough
lokit.parse.file(path) detects supported inputs from content and extension. Use a format-specific parser when you need target selection, locale mapping, parse modes, inline-tag controls, spreadsheet columns, or progress settings.
import lokit
document = lokit.parse.file("messages.xliff")document.export.lokit("messages.lokit")