A Python library providing curated lists of stop words across 34+ languages. Stop words are common words (like “the”, “is”, “at”) that are typically filtered out in natural language processing and text analysis tasks. It offers extensive language support, built-in caching for performance, and zero external dependencies. The current version is 2025.11.4 and it maintains a regular release cadence. [1, 9]
pip install stop-wordsVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to fetch stop words for English and Spanish and apply them to a simple text string. It highlights the importance of lowercasing and punctuation removal for effective filtering. [1, 9]
Interact with the returned list (e.g., `my_list = get_stop_words('en'); my_list.append('custom_word')`) or explicitly clear the cache (`from stop_words import STOP_WORDS_CACHE; STOP_WORDS_CACHE.clear()`).Always check if the returned list is empty, or use `safe_get_stop_words()` if an empty list is the desired fallback for unsupported languages. Consult documentation for available language codes.
Always normalize your input text by converting words to lowercase (e.g., `.lower()`) and stripping punctuation before comparing them to the stop word list.
Ensure all words in your input text are converted to lowercase (e.g., `word.lower()`) before checking them against the stop words.
Strip punctuation from words (e.g., using `str.strip(string.punctuation)` or regular expressions) before checking them against the stop word list.
Instead of modifying package files, get the list programmatically and add/remove items (e.g., `my_stop_words = set(get_stop_words('en')) | {'my_new_word'}`). If absolutely necessary, clear the cache using `from stop_words import STOP_WORDS_CACHE; STOP_WORDS_CACHE.clear()`.Verify the language code/name against the library's available languages (often listed in the GitHub README or PyPI page). If the language is truly unsupported, you'll need to provide your own stop word list.
No dependency data recorded yet.