skillfed

hyperscan

Python bindings for Hyperscan.

hyperscan v0.8.2 425.8K downloads/30d#6,757 on PyPI203
Permissive license MIT Active released

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 hyperscan

uv

uv add hyperscan

poetry

poetry add hyperscan

Installing 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

Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTopic :: Utilities

Tags

high-performance regex matchingmultiple pattern matching libraryvectorscan python bindingshyperscan python wrapperfast regex enginebulk pattern matchingcompiled regex patterns
regex-engineperformance-critical

More Libraries packages