--- id: flashtext version: "2.7" license: unclear license_treatment: permissive maintenance: aging --- # flashtext — Extract/Replaces keywords in sentences. License: permissive · Maintenance: aging · Downloads: 2.6M/mo ## What it is and what it does FlashText is a keyword extraction and replacement library that implements a specialized algorithm optimized for finding and replacing multiple keywords in text. Instead of using regex, it builds on Aho-Corasick and Trie data structures to achieve faster performance, especially when working with large keyword dictionaries or processing many documents. The library lets you add keywords with optional clean-name mappings, extract them from text with position information, or replace them with substitutes. It also supports case-sensitive matching, custom word boundaries, and bulk keyword operations via dictionaries or lists. The package has no external runtime dependencies and works as a pure Python implementation. However, it requires compilation during installation and has not received updates since early 2018, though the repository remains accessible. The classifiers indicate support for Python 2.7, 3.5, and 3.6, but actual compatibility with modern Python versions is unclear. Use it for: - Extract named entities or domain-specific terms from documents at scale faster than regex-based approaches. - Replace product names, abbreviations, or aliases with canonical forms in bulk text processing pipelines. - Build keyword-based text classification or tagging systems where you need to match many terms efficiently. - Normalize variations of terms (e.g., 'Big Apple' → 'New York') across large document collections. - Detect and extract keywords with associated metadata (e.g., category labels) from unstructured text. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Extracts or replaces keywords in text using the FlashText algorithm, which is based on Aho-Corasick and Trie data structures and designed to be faster than regex for bulk keyword operations. Yes, if you need fast keyword extraction or replacement on modern Python and can verify compatibility. The algorithm is sound and the library is widely used (2.5M+ monthly downloads), but the lack of updates since 2018 and high install friction (source build required) mean you should test it on your target Python version first. No known security vulnerabilities. Consider it a stable, specialized tool rather than an actively maintained package. ## Install pip install flashtext uv add flashtext poetry add flashtext ## Installing flashtext Before you install: Installation requires building from source (high friction). The package has not been updated since February 2018, though the repository remains active with recent commits as of April 2025. Maintenance is aging but not abandoned. License in practice: Licensed under MIT (permissive), which allows commercial and private use with minimal restrictions. Quickstart: from flashtext import KeywordProcessor kp = KeywordProcessor() kp.add_keyword('Big Apple', 'New York') kp.add_keyword('Bay Area') keywords_found = kp.extract_keywords('I love Big Apple and Bay Area.') # Returns: ['New York', 'Bay Area'] No runtime dependencies, but package requires building from source during installation. Verify before relying: - Current Python 3 compatibility beyond the stated 3.5 and 3.6 support (classifiers are from 2018). - Whether the package works reliably with modern Python versions given the age of the last release. ## Package facts - License: not declared (permissive) - Python support: unspecified - Install friction: high - Maintenance: aging - Downloads: 2.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags keyword extraction from text, keyword replacement in sentences, fast text pattern matching, aho-corasick keyword search, bulk keyword find and replace, trie-based text processing, regex alternative for keywords, text-processing, pattern-matching, nlp-utility [View on SkillFed](https://skillfed.io/packages/flashtext) · [View on PyPI](https://pypi.org/project/flashtext/)