$npx skillfedfor your agent

ahocorasick-rs

Search for multiple substrings at the same time, and quickly too

With conditionsPyPI Text ProcessingReleased Oct 2025534.7K downloads / moApache 2.0Platform wheel

Decision gist · record as of 2026-08-14

platform wheels — ahocorasick_rs-1.0.3-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl · ahocorasick_rs-1.0.3-cp310-cp310-macosx_10_12_x86_64.whl · ahocorasick_rs-1.0.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
v1.0.3 · released 2025-10-08 · Python >=3.10 · 1 runtime deps: typing-extensions

Yes, if you need to search for multiple patterns in text or bytes. The Aho-Corasick algorithm is significantly faster than sequential pattern matching. Install friction is moderate (compiled wheels) but well-supported across platforms. No vulnerabilities reported, actively maintained, and permissive license. Not necessary if you only search for single patterns or have very few patterns where overhead isn't a concern.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.10 or later.
  • Medium install friction due to compiled wheels; prebuilt binaries available for Python 3.10 through modern versions on macOS, Linux, and Windows.
  • Actively maintained with recent commits and no reported vulnerabilities.

License · maintenance · safety

Apache 2.0 (permissive) — Licensed under Apache 2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions.

last release 2025-10-08 (310 days) · last repo commit 2026-08-10 · 233 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 534,741 downloads/mo, #6,131 on PyPI

Verify before relying

pip install ahocorasick-rs

import ahocorasick_rs
patterns = ["hello", "world"]
ac = ahocorasick_rs.AhoCorasick(patterns)
matches = ac.find_matches_as_strings("hello world")
# Returns: ['hello', 'world']
  • Performance comparison with pyahocorasick under realistic workloads and pattern counts.
  • Memory overhead of different Implementation choices for typical use cases.
  • Thread safety guarantees beyond the documented mutable-buffer constraint.
Same gist for agents: .md · .json

What it is and what it does

ahocorasick_rs is a Python wrapper around the Rust aho-corasick library that finds all occurrences of multiple patterns in a single pass through a text or byte string. It implements the Aho-Corasick automaton algorithm, which is significantly faster than searching for patterns sequentially, especially when you have many patterns or large haystacks. The package supports both string and bytes searching, with configurable matching strategies (Standard, LeftmostFirst, LeftmostLongest) and optional overlapping match detection.

The library exposes two main classes: AhoCorasick for string patterns and BytesAhoCorasick for byte patterns. You can tune performance by choosing between different underlying automaton implementations (NoncontiguousNFA, ContiguousNFA, DFA) and control memory usage through pattern caching. It has one runtime dependency (typing-extensions) and requires Python 3.10 or later.

Use it for

  • Scanning log files or documents for multiple keywords or error codes in a single pass.
  • Filtering or redacting sensitive terms from text or data streams.
  • Building search indices or content-matching systems that need to detect many patterns efficiently.
  • Detecting multiple signatures or indicators in binary or text data.
  • Tokenizing or lexing source code by matching multiple reserved words and operators simultaneously.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you need to search for multiple patterns in text or bytes.

The Aho-Corasick algorithm is significantly faster than sequential pattern matching. Install friction is moderate (compiled wheels) but well-supported across platforms. No vulnerabilities reported, actively maintained, and permissive license. Not necessary if you only search for single patterns or have very few patterns where overhead isn't a concern.

Install

ahocorasick-rs on PyPI

Before you install

Medium install friction due to compiled wheels; prebuilt binaries available for Python 3.10 through modern versions on macOS, Linux, and Windows. Actively maintained with recent commits and no reported vulnerabilities.

Requires Python 3.10 or later.

License in practice

Licensed under Apache 2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions.

Quickstart

pip install ahocorasick-rs

import ahocorasick_rs
patterns = ["hello", "world"]
ac = ahocorasick_rs.AhoCorasick(patterns)
matches = ac.find_matches_as_strings("hello world")
# Returns: ['hello', 'world']

Verify before relying

  • Performance comparison with pyahocorasick under realistic workloads and pattern counts.
  • Memory overhead of different Implementation choices for typical use cases.
  • Thread safety guarantees beyond the documented mutable-buffer constraint.

Package facts

LicenseApache 2.0 permissive
Python supportSupports the current Python release >=3.10
Install frictionMedium. Platform-specific wheel
Runtime dependencies
1 package
typing-extensions
MaintenanceActively maintained 310 days since the last release
Last repo commit
First released
Downloads534,741 / month, #6,131 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14

Evidence: ahocorasick_rs-1.0.3-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl; ahocorasick_rs-1.0.3-cp310-cp310-macosx_10_12_x86_64.whl; ahocorasick_rs-1.0.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; ahocorasick_rs-1.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; ahocorasick_rs-1.0.3-cp310-cp310-win_amd64.whl; ahocorasick_rs-1.0.3-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl; ahocorasick_rs-1.0.3-cp311-cp311-macosx_10_12_x86_64.whl; ahocorasick_rs-1.0.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; ahocorasick_rs-1.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; ahocorasick_rs-1.0.3-cp311-cp311-win_amd64.whl; ahocorasick_rs-1.0.3-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl; ahocorasick_rs-1.0.3-cp312-cp312-macosx_10_12_x86_64.whl; ahocorasick_rs-1.0.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; ahocorasick_rs-1.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; ahocorasick_rs-1.0.3-cp312-cp312-win_amd64.whl; ahocorasick_rs-1.0.3-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl; ahocorasick_rs-1.0.3-cp313-cp313-macosx_10_12_x86_64.whl; ahocorasick_rs-1.0.3-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; ahocorasick_rs-1.0.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; ahocorasick_rs-1.0.3-cp313-cp313-win_amd64.whl

Tags

Capabilities
multiple substring searchaho-corasick algorithmpattern matching in textfast multi-pattern searchstring matching librarybulk text searchoverlapping pattern detection
Topics
string-matchingperformance-criticalrust-backed

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “pattern matching in text”

  • ahocorasick-rsSearches for multiple substrings in text or bytes using the…
  • pyahocorasickFinds multiple keyword strings in text efficiently using an…
  • onigurumacffiProvides Python bindings to the Oniguruma regex engine via CFFI,…

Give your agent the search over MCP, or paste the wish link into any chat.

More Text Processing packages

regex Worth it
PyPI · Python Modules · released Jul 2026

A drop-in replacement for Python's standard `re` module that adds advanced regex features like nested sets, fuzzy matching, lookaround in conditionals, and full Unicode case-folding while maintaining backward compatibility.

Apache-2.0 AND CNRI-Pythoncompiled wheel · 3.10+
437.7Mdownloads / mo
pyparsing Worth it
PyPI · Text Processing · released Jan 2026

pyparsing provides a library for building text parsers directly in Python code using composable grammar classes, handling quoted strings, whitespace variation, and embedded comments without regex or lex/yacc.

Install it if you need to parse text or define grammars programmatically.

MITpure Python · 3.9+
412.7Mdownloads / mo
fonttools Worth it
PyPI · Text Processing · released May 2026

fonttools manipulates font files in multiple formats (TrueType, OpenType, AFM, Type 1, Mac-specific) and includes TTX, a tool to convert fonts to and from XML text format.

Install it if you need to read, write, or manipulate fonts programmatically or via the TTX command-line tool.

permissive licensepure Python · 3.10+
235.9Mdownloads / mo
docutils With conditions
PyPI · Software Development · released May 2026

Docutils converts plaintext documentation in reStructuredText format into multiple output formats including HTML, XML, and LaTeX using a modular processing system.

BSD-3-Clausepure Python · 3.9+
225.6Mdownloads / mo
RapidFuzz Worth it
PyPI · Text Processing · released Apr 2026

RapidFuzz provides fast fuzzy string matching using Levenshtein Distance and related metrics, implemented mostly in C++ with Python bindings for rapid similarity scoring and approximate string matching.

Install it if you need fuzzy string matching; it's a solid replacement for FuzzyWuzzy with better licensing and performance.

MITcompiled wheel · 3.10+
184.2Mdownloads / mo
tinycss2 Worth it
PyPI · Text Processing · released Nov 2025

tinycss2 parses CSS strings into token and block objects, and generates CSS strings from those objects, following the CSS Syntax Level 3 specification without enforcing specific properties or values.

Install it if your project requires CSS tokenization or syntax manipulation.

BSD-3-Clausepure Python · 3.10+
113.2Mdownloads / mo

See also ahocorapy · pyahocorasick · multiregex · rebulk · flashtext · fuzzyfinder · wcmatch · strsimpy · farm-haystack · django-haystack