Hyperscan for Python
A CPython extension for Hyperscan, Intel's open source, high-performance multiple regex matching library. Currently only supports manylinux-compatible Linux distributions.
Installation
pip install hyperscan
API Support
python-hyperscan
currently exposes most of the C API, with the
following caveats or exceptions:
- No stream compression support.
- No custom allocator support.
hs_expression_info
,hs_expression_ext_info
,hs_populate_platform
, andhs_serialized_database_info
not exposed yet.
β¨ As of v0.3.0, python-hyperscan
statically links against Hyperscan,
so having the library installed on your system is not required. Prior
versions of python-hyperscan
require Hyperscan v5.2 or newer.
Building from source requires Hyperscan compiled and installed with the following CMake flags set:
FAT_RUNTIME=OFF
BUILD_STATIC_AND_SHARED=ON
only ifBUILD_SHARED_LIBS
is also on, in the event there are other applications colocated withpython-hyperscan
that need the shared libraries. Otherwise ignore this flag, as by default Hyperscan will build static libraries.CMAKE_C_FLAGS
andCMAKE_CXX_FLAGS
set to-fPIC
See the documentation for more detailed build instructions.