evrial / python-hyperscan

A CPython extension for the Hyperscan regular expression matching library.

Home Page:https://python-hyperscan.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hyperscan for Python

python-hyperscan workflow PyPI - Python Version PyPI - Wheel PyPI - Status PyPI - License Read the Docs

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, and hs_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 if BUILD_SHARED_LIBS is also on, in the event there are other applications colocated with python-hyperscan that need the shared libraries. Otherwise ignore this flag, as by default Hyperscan will build static libraries.
  • CMAKE_C_FLAGS and CMAKE_CXX_FLAGS set to -fPIC

See the documentation for more detailed build instructions.

Resources

About

A CPython extension for the Hyperscan regular expression matching library.

https://python-hyperscan.readthedocs.io/en/latest/

License:MIT License


Languages

Language:C 80.0%Language:Python 19.7%Language:Dockerfile 0.3%