Sastrawi
Library for stemming Indonesian (Bahasa) text
What it is and what it does
Sastrawi is a Python port of the original PHP Sastrawi project for Indonesian language stemming. It takes inflected Indonesian words and reduces them to their root form by removing affixes and morphological markers, which is a common preprocessing step in Indonesian text analysis and natural language processing tasks.
The package provides a factory-based API: you instantiate a StemmerFactory, create a stemmer instance, and call its stem() method on text. It handles both single words and full sentences, stripping prefixes, suffixes, and other morphological variations specific to Indonesian grammar. With no external runtime dependencies and a permissive MIT license, it integrates easily into Indonesian NLP pipelines.
Use it for:
- Preprocess Indonesian text for search engines or information retrieval systems to normalize word variations
- Reduce Indonesian documents to root forms before feeding them into machine learning classifiers or topic models
- Build Indonesian language chatbots or question-answering systems that need to match user queries to base word forms
- Analyze Indonesian social media or news text by normalizing inflected words for frequency analysis or sentiment detection
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Sastrawi reduces inflected Indonesian words to their base form (stem) by removing prefixes, suffixes, and other morphological variations.
Yes, if you need Indonesian stemming. The package is stable, has no dependencies, and carries a permissive license. The 2016 release date is a concern for Python version compatibility—verify it works with your target Python version before relying on it in production.
Install
sastrawi on PyPI
pip
pip install sastrawiuv
uv add sastrawipoetry
poetry add sastrawiInstalling Sastrawi
Before you install
Low friction install with no runtime dependencies. Last release was in 2016, but the repository remains active with recent commits and is marked production-stable.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install Sastrawi
from Sastrawi.Stemmer.StemmerFactory import StemmerFactory
factory = StemmerFactory()
stemmer = factory.create_stemmer()
output = stemmer.stem('Perekonomian Indonesia sedang dalam pertumbuhan')
print(output) # ekonomi indonesia sedang dalam tumbuh
Verify before relying
- Whether the package supports modern Python versions beyond what was current in 2016
- Performance characteristics on large Indonesian text corpora
- Accuracy of stemming against standard Indonesian linguistic benchmarks
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 3,861 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 79,895/month — #14,330 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: Sastrawi-1.0.1-py2.py3-none-any.whl
Keywords: linguistic, stemming, indonesian, bahasa
Tags
More Linguistic packages
Detects and normalizes text encoding from…
permissive · top 100 on PyPI
tiktokentiktoken is a fast BPE tokenizer that converts…
permissive · top 1,000 on PyPI
chardetDetects character encoding and language in byte…
permissive · top 1,000 on PyPI
text-unidecodeConverts Unicode text to ASCII by…
copyleft · top 1,000 on PyPI
larkLark is a parsing library that builds abstract…
permissive · top 1,000 on PyPI
tree-sitterPython bindings to the tree-sitter parsing…
permissive · top 1,000 on PyPI
PyStemmerPyStemmer provides word stemming algorithms for…
permissive · top 5,000 on PyPI
snowballstemmerProvides stemming algorithms for 34 languages,…
permissive · top 1,000 on PyPI
sea-g2pConverts text to phonemes for Vietnamese, Thai,…
permissive · top 15,000 on PyPI
kiwipiepy-modelProvides pre-trained morphological analysis…
copyleft · top 15,000 on PyPI
jiebaJieba segments Chinese text into words using…
permissive · top 5,000 on PyPI
py-rust-stemmersProvides fast, parallel word stemming using…
unclear · top 5,000 on PyPI
lemminflectLemmatizes and inflects English words using…
permissive · top 15,000 on PyPI
kiwipiepyKiwipiepy tokenizes and analyzes Korean text…
copyleft · top 15,000 on PyPI
stemStem is a Python controller library for…
copyleft · top 15,000 on PyPI
wordninjaSplits concatenated words into their…
unclear · top 5,000 on PyPI