--- id: pagefind version: "1.5.2" license: MIT license_treatment: permissive maintenance: active --- # pagefind — Python API for Pagefind License: permissive · Maintenance: active · Downloads: 2.7M/mo ## What it is and what it does Pagefind is an async Python wrapper that lets you build searchable indexes from HTML files and custom content records. It exposes a clean async API for adding HTML files, custom records, or entire directories, and retrieving indexed file metadata. The package handles communication with an underlying binary process, letting you control output paths, logging, and which DOM elements to index through the IndexConfig object. You use it when you need full-text search on static content—typically for documentation sites, blogs, or knowledge bases where you want to avoid running a separate search service. The async design means you can index multiple sources concurrently, making it suitable for batch indexing pipelines and build-time content processing. Use it for: - Index a static documentation site and expose search to readers without a backend search service. - Build a searchable archive of HTML pages or exported content in a batch indexing pipeline. - Add full-text search to a static site by pre-indexing content during the build step. - Index custom metadata records alongside HTML files to create a unified search index. - Programmatically index and re-index content as part of a content management workflow. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides an async Python API to index and search HTML content, enabling full-text search indexing of static sites and custom content. Yes. Low install friction, no runtime dependencies, active maintenance, MIT license, and zero known vulnerabilities make it a safe choice. Install it if you need to index HTML or custom content for search—particularly valuable for static site generators and documentation platforms where you want search without infrastructure overhead. ## Install pip install pagefind uv add pagefind poetry add pagefind ## Installing pagefind Before you install: Low friction install with no runtime dependencies. Active maintenance status with recent releases. License in practice: MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects. Quickstart: pip install 'pagefind[bin]' import asyncio from pagefind.index import PagefindIndex, IndexConfig async def main(): config = IndexConfig(output_path="./output") async with PagefindIndex(config=config) as index: result = await index.add_html_file( content="Example", url="https://example.com" ) asyncio.run(main()) Requires Python 3.9 or later; the [bin] extra installs the underlying binary. Verify before relying: - Whether the binary is automatically downloaded or requires separate installation when using the [bin] extra. - Performance characteristics when indexing large HTML document collections. - Search query syntax and filtering capabilities available through the API. - Whether add_directory, add_html_file, and add_custom_record methods support concurrent execution beyond the example shown. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 2.7M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags static site search indexing, full-text search python, html content indexing, async search index, site search engine, python indexing api, search-indexing, async-api, static-sites [View on SkillFed](https://skillfed.io/packages/pagefind) · [View on PyPI](https://pypi.org/project/pagefind/)