# WojciechMula/pyahocorasick

Python module (C extension and plain python) implementing Aho-Corasick algorithm

Repository: https://github.com/WojciechMula/pyahocorasick
Canonical: https://ross.abutalabs.com/products/pyahocorasick
Language: C
License: BSD-3-Clause
License Family: permissive
Topics: string-manipulation, automaton, aho-corasick, trie
Last push: 2026-04-27T15:57:04+00:00

## Health v2 (maintenance only)
Score: 76/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 79, release rhythm 57, longevity 100
- inputs: {"age_days": 4843, "days_push": 128, "days_rel": 128, "gap_med": 156.5, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1120, forks 140 (observed 2026-08-28T04:03:39.726147+00:00)

## What it is
A Python module (implemented as a C extension with a pure-Python fallback) implementing the Aho-Corasick algorithm for fast multi-pattern string search. It can be used as a dict-like trie or converted to an automaton to find all occurrences of many key strings at once, with the index serializable via pickle.

## Use cases
- find multiple keywords at once in a large text
- count occurrences of thousands of DNA guide sequences in sequencing reads
- build a fast dictionary-like trie of terms and search text for all of them
- match a large list of patterns against streaming input efficiently
- implement entity or term extraction over documents in Python

## When to avoid
- you need approximate/fuzzy matching with edit distances beyond what the library supports
- you cannot install C extensions and need a pure-Python solution for very large workloads
- you need Unicode-aware normalization or tokenization on top of raw string matching
- you only need to search for a handful of patterns, where a simple regex or str.find is enough

## Facets
- artifact type: library
- maturity: stable
- function: parser, search-engine, nlp
- domain: developer-tools, bioinformatics
- platform: python, windows
- tags: aho-corasick, string-search, trie, automaton, multi-pattern-matching, c-extension, text-processing, keyword-matching, natural-language-processing, linux, macos

## Member repositories
- WojciechMula/pyahocorasick (main) score 76

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:39.726147+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:41:04.512625+00:00, confidence not recorded.
  - readme: https://github.com/WojciechMula/pyahocorasick (fetched 2026-08-28T04:03:39.726147+00:00, sha 3d35144d4df3)
- Data as of 2026-08-30T08:39:29.467469+00:00.
