--- id: pynini version: "2.1.7" license: Apache 2.0 license_treatment: permissive maintenance: aging --- # pynini — Finite-state grammar compilation License: permissive · Maintenance: aging · Downloads: 239.1K/mo ## What it is and what it does Pynini is a Python extension module that compiles linguistic grammar rules into weighted finite-state transducers (FSTs), pushdown transducers, and multi-pushdown transducers. It wraps OpenFst and provides a high-level interface for constructing and manipulating automata-based language models. The library is designed for computational linguists and NLP researchers who need to express complex morphological, phonological, or syntactic transformations as formal automata. The package has no runtime dependencies beyond OpenFst itself (which must be installed separately on most platforms). Installation on Linux via pip uses precompiled manylinux wheels for Python 3.9–3.14, but Windows and macOS users typically rely on conda-forge. The library is stable and production-ready, though the last release was 344 days ago, suggesting a mature but slowly-evolving codebase. Use it for: - Build morphological analyzers and generators for inflectional languages by encoding rules as weighted transducers. - Implement phonological rule systems that transform phonemic representations into surface forms. - Compile domain-specific grammar rules for text normalization, transliteration, or dialect conversion. - Prototype and test finite-state models of linguistic phenomena before deploying them in larger NLP pipelines. - Combine multiple FSTs to create complex multi-stage language processing workflows. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Pynini compiles grammar rules into weighted finite-state transducers and related automata structures, enabling programmatic construction and application of complex linguistic transformations. Yes, if you are working on computational linguistics, morphology, or formal language tasks that map naturally to finite-state automata. The library is stable, permissively licensed, and well-suited for research and production use. No, if your project does not require explicit FST manipulation or if you lack the ability to install OpenFst and a C++17 compiler on your system—the installation friction is non-trivial for casual users. ## Install pip install pynini uv add pynini poetry add pynini ## Installing pynini Before you install: Medium friction: requires a C++17 compiler and OpenFst 1.8.4 with grm extensions pre-installed on the system. Precompiled manylinux wheels available for Python 3.9–3.14 on x86_64 Linux, but Windows and macOS users should use conda-forge. Last release 344 days ago; maintenance status is aging. License in practice: Apache 2.0 permissive license allows commercial and private use with minimal restrictions. You must retain license notices but face no copyleft obligations. Quickstart: pip install pynini import pynini # Create a simple FST fst = pynini.string_map([("hello", "hi")]) result = pynini.shortestpath(fst) OpenFst 1.8.4 with grm extensions must be installed and discoverable by the build system; a C++17 compiler (GCC ≥7 or Clang ≥700) is required to build from source. Verify before relying: - Whether precompiled wheels include OpenFst or if it must be installed separately on Linux. - Current maintenance status and whether the 344-day gap since last release signals active development or dormancy. - Availability of comprehensive documentation or tutorials beyond the cited 2016 paper. ## Package facts - License: Apache 2.0 (permissive) - Python support: supports_current - Install friction: medium - Maintenance: aging - Downloads: 239.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags finite-state transducers python, grammar compilation weighted automata, linguistic rule compilation, morphology nlp library, fst grammar rules, computational linguistics toolkit, language rule transducers, finite-state-automata, computational-linguistics, morphology [View on SkillFed](https://skillfed.io/packages/pynini) · [View on PyPI](https://pypi.org/project/pynini/)