This release is a pre-release and may not be stable for production use.
orthography2ipa
orthography2ipa (o2i) turns the spelling of a language into the
International Phonetic Alphabet
(IPA), and it measures how languages relate to each other. Each language is a
cited JSON spec in orthography2ipa/data/. A shared engine with no
language-specific code turns the specs into transcriptions and into ranked
pronunciation lattices. The library ships no trained weights and no word
lists.
The registry holds thousands of language codes: major standard languages,
regional dialects, creoles and reconstructed proto-languages. Run
orthography2ipa list for the live list. Most of these codes are stubs. The
language explorer shows each spec,
its tier and its sources.
Install
uv pip install --prerelease=allow orthography2ipa
The project installs with uv. CONTRIBUTING.md sets up a clone of the repository for development.
Quick start
import orthography2ipa
orthography2ipa.transcribe("olá mundo", "pt") # 'ɔˈla ˈmũdu'
docs/guide/getting_started.md is the tutorial that starts from this call. It covers the dependencies and the optional extras, the two maps of a spec, beam search, language lookup, the command line, plugins and the explorer.
Documentation
docs/index.md is the front door of the documentation. It states what the library does and where its accuracy stops, and it sets the reading order of every page. The table below goes straight to the page for a common task.
| You want to | Read |
|---|---|
| Rank the readings of an ambiguous spelling, or rescore them | docs/engine/lattice.md |
| Export the lattice as features for a CRF or another ML model | docs/engine/lattice.md |
| Measure how two languages differ in sound, spelling, script, ancestry, time or place | docs/guide/distance.md |
| See the PER, the word count and the provenance of each gold set | docs/evaluation/generated/scoreboard.md |
| Compare the same rows with other G2P systems | docs/evaluation/generated/comparison.md |
| Learn what a gold set can prove, and the reliability tiers | docs/evaluation/benchmarks.md |
Read the full --help output |
docs/reference/cli.md |
| Look up an exported name | docs/reference/api.md |
| Read every field of a spec | orthography2ipa/data/SCHEMA.md |
| Write a spec, a citation, a board change or an engine change | docs/contributing/ |
| Learn the repository map, the setup and the hard rules | AGENTS.md |
| Follow the branch model and the commit messages | CONTRIBUTING.md |
| Give a language model a map of the repository | llms.txt, or llms-full.txt with every language page |
How it compares
The comparison board scores o2i and other grapheme-to-phoneme (G2P) systems on the same gold words, language by language. The general systems on the board are espeak-ng, epitran and gruut. The board also scores engines for one language or one region: pycotovia for Galician and Spanish, ahotts-g2p for Basque and Spanish, and africa-g2p and ghana-g2p for African languages. The ranking counts rules only. A system's bundled word lexicon is shown on the board, but it never wins a row, because o2i ships no lexicon of its own.
o2i keeps its knowledge in a different place from these systems. espeak-ng keeps a rules file and an exception dictionary for each language. gruut keeps a lexicon and a trained guesser for each language. epitran keeps a mapping table for each language and returns one reading. o2i keeps every language in one schema, cites each mapping, and returns a ranked lattice of readings that a downstream engine can rescore.
Ecosystem
Several engines build on the o2i lattice. Each one adds, for one language, the context that spelling alone cannot give.
| Project | What it adds |
|---|---|
| tugaphone | Portuguese: a curated lexicon, a rule fallback and output for each Lusophone dialect |
| arbtok | Arabic: short-vowel restoration (tashkeel), stress and dialect output |
| euskaphone | Basque: dialect output for a TTS front end |
For Barranquenho, the contact variety of Barrancos, use
G2P("ext-PT-x-barranco"). For Mirandese, use G2P("mwl"), or
G2P("mwl-x-sendim") and G2P("mwl-x-ifanes") for the Sendinês and Ifanês
varieties.
Other packages supply data or steps that o2i does not hold.
o2i-lexicons ships residual
lexicons, which a caller enables in code.
silabificador is a
Portuguese syllabifier that plugs into a Pipeline.
bifonia chooses the reading of a
European Portuguese homograph from its sentence.
scriptconv converts between
scripts and phoneme notations, which o2i does not do.
phoonnx is a TTS engine that offers
o2i as one of its phonemizers. C++ ports of o2i and of several of these
engines are in loom-ai-org, for example
orthography2ipa.cpp
and tugaphone.cpp.
AI transparency
Large language models (Anthropic Claude) wrote most specs, under the direction of a human maintainer. No small project can recruit a native-speaker linguist for thousands of languages, so the choice was between an AI-written spec and no spec. Every mapping must trace to a published description: a reference grammar, a peer-reviewed paper or a university dataset. The engine stays language-agnostic, so a spec cannot hide logic. The tests check the structure, and the benchmarks score the output against external data.
A cited spec that a model wrote is still not native-speaker validation, and
the quality tier records that. If you speak a language and its spec is
wrong, open an issue
with a citation or a native-speaker judgment. Corrections have priority over
all other work here.
License
Apache 2.0. See LICENSE.
Metadata
Release files for orthography2ipa 7.123.5a2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| orthography2ipa-7.123.5a2.tar.gz | 9.1 MB | Without provenance | Details for orthography2ipa-7.123.5a2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| orthography2ipa-7.123.5a2-py3-none-any.whl | Python 3 | none | any | Details for orthography2ipa-7.123.5a2-py3-none-any.whl |
Total release size: 20.4 MB
Release files / orthography2ipa-7.123.5a2.tar.gz
| Download URL | orthography2ipa-7.123.5a2.tar.gz |
|---|---|
| Size | 9.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7c62c1986b940e469c65b7c3bee973d2e5d6079779b4b11f8d1b9352afe6b4fc
|
|
BLAKE2b-256 checksum How to use checksums |
ce287099e6e169808f15580031c8c8cb00325336fc98543b58fc133928b3a174
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / orthography2ipa-7.123.5a2-py3-none-any.whl
| Download URL | orthography2ipa-7.123.5a2-py3-none-any.whl |
|---|---|
| Size | 11.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
16c473fa9c6e0c44f17dfbe7c01904502740ed534508d9c09b4be3f7c615396f
|
|
BLAKE2b-256 checksum How to use checksums |
0a893d61a12cd7279d84710c876007d9fe27f09b79ffb884fe611a9d9d5a395b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for orthography2ipa 7.123.5a2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.