darvid / python-hyperscan

🐍 A CPython extension for the Hyperscan regular expression matching library.
https://python-hyperscan.readthedocs.io/en/latest/
MIT License
165 stars 28 forks source link
hyperscan python python3 regex regexp regular-expressions

Hyperscan/Vectorscan for Python

GitHub Actions Workflow Status PyPI - Version PyPI - Downloads PyPI - Python Version PyPI - Wheel PyPI - License Read the Docs

A CPython extension for Vectorscan, an open source fork of Hyperscan, Intel's open source (prior to version 5.4), high-performance multiple regex matching library.

Installation

# 🪄 Installing libhs is NOT required, because python-hyperscan is statically linked
pip install hyperscan

Build Optimization

If you'd like to use Intel's Hyperscan rather than Vectorscan, or if you'd like to enable native CPU detection to build optimized non-FAT libraries (default off in Vectorscan), extending the manylinux-hyperscan Docker image used to build the binary wheels for this library should be fairly straightforward.

API Support

python-hyperscan currently exposes most of the C API, with the following caveats or exceptions:

See the documentation for more detailed build instructions.

Resources