Skip to content

Importing functions into Cython with cimport #202

Closed Answered by maxbachmann
YevgeniySimonov asked this question in Q&A
Discussion options

You must be logged in to vote

There are a couple of ways this can be done:

  1. maybe the process functions already do what you need
    -> call e.g. process.cdist instead of calling partial_ratio multiple times
  2. The python project is just a wrapper for the C++ library. So you can directly use https://github.com/maxbachmann/rapidfuzz-cpp inside your application in a similar way to this wrapper.
  3. RapidFuzz provides a C-API, which is just not documented yet. Every scorer in rapidfuzz provides a PyCapsule which allows you to directly call scorers. This API is e.g. used inside the process module (see https://github.com/maxbachmann/RapidFuzz/blob/main/rapidfuzz/cpp_process.pyx). Large parts of this C-API can be used without the GIL,…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by YevgeniySimonov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants