--- id: pythainlp version: "5.3.7" license: Apache-2.0 license_treatment: permissive maintenance: active --- # pythainlp — Thai Natural Language Processing library License: permissive · Maintenance: active · Downloads: 1.4M/mo ## What it is and what it does PyThaiNLP is a Python library for Thai natural language processing, providing standard linguistic analysis tools tailored to Thai language characteristics. It includes sentence, word, and subword segmentation; part-of-speech tagging; transliteration and IPA conversion; spelling correction; and utilities like soundex, collation, and Thai-specific formatting functions. The library ships with built-in Thai character sets, word lists, and stop words, plus a command-line interface. The package depends on importlib-resources and tzdata at runtime and is designed to work with Python 3.9 and later. It downloads linguistic data and models on demand to a local directory (configurable via environment variables), with options for offline and read-only modes. Installation is straightforward with optional extras for machine translation and WordNet support, though the base install covers core tokenization and tagging tasks. Use it for: - Tokenize Thai text into sentences, words, or subwords for downstream NLP pipelines. - Perform part-of-speech tagging on Thai documents for grammatical analysis. - Correct Thai spelling errors and generate spelling suggestions for user input. - Transliterate Thai text to romanized or IPA form for linguistic study or accessibility. - Build Thai language applications with built-in stop words, character sets, and collation utilities. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. PyThaiNLP provides Thai-language natural language processing tools including tokenization, part-of-speech tagging, transliteration, spelling correction, and linguistic utilities, designed as a Thai counterpart to NLTK. Yes. PyThaiNLP is actively maintained, has no known vulnerabilities, carries a permissive Apache-2.0 license, and installs with minimal friction. It is the standard choice for Thai NLP in Python and covers essential tasks like tokenization, tagging, and correction. Install it if you need to process Thai text; the base package is lightweight and the optional extras allow you to add machine translation or WordNet support as needed. ## Install pip install pythainlp uv add pythainlp poetry add pythainlp ## Installing pythainlp Before you install: Low install friction with only two runtime dependencies (importlib-resources and tzdata). The package is actively maintained with a recent release and no known vulnerabilities. License in practice: Licensed under Apache-2.0 (permissive), with data and models covered by CC0-1.0 and CC-BY-4.0. This permits commercial use and modification with minimal restrictions. Quickstart: pip install pythainlp import pythainlp from pythainlp.tokenize import word_tokenize text = "สวัสดีชาวโลก" tokens = word_tokenize(text) Requires Python 3.9 or later. By default, PyThaiNLP downloads linguistic data to ~/pythainlp-data on first use; set PYTHAINLP_OFFLINE=1 or PYTHAINLP_DATA to control this behavior. Verify before relying: - Whether optional extras (translate, wordnet, full) introduce significant additional dependencies or compatibility concerns. - Performance characteristics and memory footprint when processing large Thai text corpora. - Availability and quality of pre-trained models for tasks beyond basic tokenization and tagging. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 1.4M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags thai language processing, thai tokenization, thai nlp library, thai text analysis, thai pos tagging, thai word segmentation, thai spelling correction, thai-language, nlp, tokenization [View on SkillFed](https://skillfed.io/packages/pythainlp) · [View on PyPI](https://pypi.org/project/pythainlp/)