Pagefind provides an interface to the indexing binary as a Python package you can install and import. There are situations where using this Python package is beneficial: Integrating Pagefind into an existing Python project, e.g. writing a plugin for a static site generator that can pass in-memory HTML files to Pagefind.