skillfed

Sastrawi

Library for stemming Indonesian (Bahasa) text

sastrawi v1.0.1 79.9K downloads/30d#14,330 on PyPI361
Permissive license MIT Active released

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 sastrawi

uv

uv add sastrawi

poetry

poetry add sastrawi

Installing 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

Development Status :: 5 - Production/Stable

Tags

indonesian text stemmingbahasa indonesia stemmerindonesian language processingmorphological analysis indonesianindonesian nlp stemmingreduce indonesian word formsindonesian linguistic preprocessing
indonesian-nlpmorphological-analysis

More Linguistic packages