hyperscan
Python bindings for Hyperscan.
What it is and what it does
Hyperscan is a CPython extension that wraps Vectorscan, Intel's high-performance regex engine designed to match many patterns at once. Unlike Python's built-in `re` module, which compiles and tests patterns sequentially, Hyperscan compiles multiple patterns into a single state machine and scans text in a single pass, making it much faster for workloads that need to test dozens or hundreds of patterns simultaneously. The package ships with pre-built wheels that include Vectorscan statically linked, so you don't need to install system libraries separately.
The library exposes most of Vectorscan's C API, including Chimera support for advanced matching modes. It supports Python 3.8 through 3.14 on macOS, Linux, and Windows. The main limitations are lack of stream compression and custom allocator support, and a few specialized C functions not yet exposed to Python.
Use it for:
- Intrusion detection or network traffic analysis where you need to match many malicious patterns against packet payloads in real time.
- Log aggregation or security event filtering, scanning incoming logs against a large set of rules or signatures.
- Content scanning or data loss prevention, checking documents or data streams against many forbidden patterns simultaneously.
- Regex-based data extraction or validation at scale, where you need to test many patterns against large text corpora efficiently.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python bindings for Vectorscan (an open-source fork of Intel's Hyperscan), a high-performance library for matching multiple regex patterns simultaneously against text.
Yes, if you need to match many regex patterns against text and performance is a concern. The pre-built wheels make installation straightforward on common platforms. The MIT license and active maintenance are favorable. Install it only if your workload genuinely requires bulk pattern matching; for single-pattern or simple regex tasks, Python's built-in `re` module is sufficient and simpler.
Install
hyperscan on PyPI
pip
pip install hyperscanuv
uv add hyperscanpoetry
poetry add hyperscanInstalling hyperscan
Before you install
Medium install friction due to compiled C extension wheels, but pre-built wheels are available for common platforms (macOS, Linux, Windows) and Python versions (3.8–3.14), eliminating the need to build Hyperscan locally. Repository is actively maintained with recent commits.
License in practice
MIT license is permissive; you may use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions.
Quickstart
pip install hyperscan
import hyperscan
db = hyperscan.compile([(b"pattern1", 0), (b"pattern2", 0)])
matches = db.scan(b"text to search")
Requires Python 3.9 or later; compiled wheel must match your platform and Python version.
Verify before relying
- Performance benchmarks or throughput comparisons versus standard Python regex or other high-performance regex libraries.
- Whether stream compression and custom allocator support are planned for future releases.
- Real-world latency or memory overhead for typical pattern sets and text sizes.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0,>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 148 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 425,769/month — #6,757 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: hyperscan-0.8.2-cp310-cp310-macosx_10_9_x86_64.whl; hyperscan-0.8.2-cp310-cp310-macosx_11_0_arm64.whl; hyperscan-0.8.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; hyperscan-0.8.2-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; hyperscan-0.8.2-cp310-cp310-musllinux_1_2_aarch64.whl; hyperscan-0.8.2-cp310-cp310-musllinux_1_2_x86_64.whl; hyperscan-0.8.2-cp310-cp310-win_amd64.whl; hyperscan-0.8.2-cp311-cp311-macosx_10_9_x86_64.whl; hyperscan-0.8.2-cp311-cp311-macosx_11_0_arm64.whl; hyperscan-0.8.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; hyperscan-0.8.2-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; hyperscan-0.8.2-cp311-cp311-musllinux_1_2_aarch64.whl; hyperscan-0.8.2-cp311-cp311-musllinux_1_2_x86_64.whl; hyperscan-0.8.2-cp311-cp311-win_amd64.whl; hyperscan-0.8.2-cp312-cp312-macosx_10_13_x86_64.whl; hyperscan-0.8.2-cp312-cp312-macosx_11_0_arm64.whl; hyperscan-0.8.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; hyperscan-0.8.2-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; hyperscan-0.8.2-cp312-cp312-musllinux_1_2_aarch64.whl; hyperscan-0.8.2-cp312-cp312-musllinux_1_2_x86_64.whl
Keywords: regex, hypercan
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
rebulkReBulk provides a fluent API for building…
permissive · top 15,000 on PyPI
flpcflpc wraps the Rust regex crate to provide…
permissive · top 5,000 on PyPI
multiregexMatches multiple regex patterns against a…
permissive · top 15,000 on PyPI
interegularInteregular checks whether pairs of Python…
permissive · top 5,000 on PyPI
real-regexA drop-in replacement for Python's `re` module…
permissive · top 15,000 on PyPI
pygrokParses strings and extracts structured data…
permissive · top 15,000 on PyPI
keyphrase-vectorizersExtracts keyphrases from text documents using…
permissive · top 15,000 on PyPI
retrieBuilds efficient Trie-based regex patterns for…
permissive · top 15,000 on PyPI
onigurumacffiProvides Python bindings to the Oniguruma regex…
permissive · top 15,000 on PyPI
spdlogProvides a Python wrapper around the C++ spdlog…
permissive · top 15,000 on PyPI