Skip to main content
Pre-release

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, and one engine with no language-specific code turns the specs into transcriptions and ranked pronunciation lattices.

The specs are the files in orthography2ipa/data/. 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.

The runtime extras are hf, lexicons, validation and portuguese, for example 'orthography2ipa[lexicons]'. An extra adds a feature, and its install changes no transcription. docs/guide/getting_started.md lists what each extra adds.

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

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.124.36a2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for orthography2ipa 7.124.36a2
File Size Uploaded Provenance Actions
orthography2ipa-7.124.36a2.tar.gz 9.2 MB Without provenance Details for orthography2ipa-7.124.36a2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for orthography2ipa 7.124.36a2
File Interpreter ABI Platform Actions
orthography2ipa-7.124.36a2-py3-none-any.whl Python 3 none any Details for orthography2ipa-7.124.36a2-py3-none-any.whl

Total release size: 20.5 MB

Release files / orthography2ipa-7.124.36a2.tar.gz

Download URL orthography2ipa-7.124.36a2.tar.gz
Size 9.2 MB
Tags Source
SHA-256 checksum
How to use checksums
8c173c0cdffa6cbed89b3f039b862630f17053d608dbbfb0cee311e8462263f2
BLAKE2b-256 checksum
How to use checksums
32ab4d7487a8f41f0c4e5a101b3c661d0052a392b900aefbf66e23e16d1df703
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.124.36a2-py3-none-any.whl

Download URL orthography2ipa-7.124.36a2-py3-none-any.whl
Size 11.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
25d33b10fc2e2cfa2814a6635b713ca39927f615598f8e94db8c6a611c98d2f5
BLAKE2b-256 checksum
How to use checksums
a79f1fc62d2467dc456e8e400ad2d592e7e1261641bd38c6af23fdaf6ae15449
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.124.36a2

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.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page