Skip to content

Repository files navigation

Interscript: Interoperable Script Conversion Systems for Python

Purpose

The official Python runtime for Interscript — deterministic transliteration over the interscript map corpus (300+ authority-backed systems: BGN/PCGN, ISO, UN, ALA-LC, ODNI, ICAO, DIN, and others).

This version (0.2.0) parses the .imp map DSL directly — no pre-compiled Python map modules or monorepo bootstrap required. Point it at the map corpus and go.

Maps that need vocalized input (undiacritized Arabic, nikud-less Hebrew, unsegmented Thai) dispatch to a secryst crystal through the optional phonological layer; see the phonological-layer documentation on our site.

Install

pip install interscript

Usage

importinterscriptinterscript.add_load_path(".../interscript/maps/maps")
interscript.transliterate("un-bul-Cyrl-Latn-1977", "нос Бяга БЯГА")
# -> "nos Byaga BYAGA"

API

  • add_load_path(path) — register a directory containing .imp/.isc map files

  • map_exist(name) — check whether a map is available

  • map_list() — list all discoverable map names

  • load_map(name) — parse and cache a map (returns an Engine)

  • transliterate(name, text) — apply a map to text

Measured coverage (2026-08-20)

The engine passes maps' own embedded tests with the following scores; remaining gaps are documented in the test suite:

mapembedded testsgap

un-bul-Cyrl-Latn-1977

98/98

none

un-ell-Grek-Latn-1987-ts

206/242

posix letter-class guards

bgnpcgn-prs-Arab-Latn-2007

loads, runs

proper-noun capitalization

Architecture

  • parser.py.imp DSL parser: metadata (incl. | block scalars), tests, dependency declarations, stages, parallel groups, sub expressions

  • expr.py — expression layer: any("…") char classes, any("a".."z") ranges, any(["x","y"]) alternations, maybe("…"), space, boundary, line_start/line_end, + concatenation, before:/after: context guards

  • engine.py — executor: parallel subs (longest-match-wins + word-aware casing), subst regex, run (dependency-aliased dotted targets), compose/decompose, downcase/upcase/titlecase

Sibling runtimes

License

BSD-2-Clause. See LICENSE.adoc.

About

Python engine for deterministic Interscript transliteration — direct .imp DSL parsing

Resources

Stars

0 stars

Watchers

11 watching

Forks

Releases

Packages

Used by

Contributors

Languages