Release v0.1.2 (What’s new?).

Documentation Status https://github.com/MacHu-GWU/sayt2-project/actions/workflows/main.yml/badge.svg https://codecov.io/gh/MacHu-GWU/sayt2-project/branch/main/graph/badge.svg https://img.shields.io/pypi/v/sayt2.svg https://img.shields.io/pypi/l/sayt2.svg https://img.shields.io/pypi/pyversions/sayt2.svg https://img.shields.io/badge/✍️_Release_History!--None.svg?style=social&logo=github https://img.shields.io/badge/⭐_Star_me_on_GitHub!--None.svg?style=social&logo=github
https://img.shields.io/badge/Link-API-blue.svg https://img.shields.io/badge/Link-Install-blue.svg https://img.shields.io/badge/Link-GitHub-blue.svg https://img.shields.io/badge/Link-Submit_Issue-blue.svg https://img.shields.io/badge/Link-Request_Feature-blue.svg https://img.shields.io/badge/Link-Download-blue.svg

Welcome to sayt2 (Search As You Type) Documentation

https://sayt2.readthedocs.io/en/latest/_static/sayt2-logo.png

sayt2 is a Python library that provides a Google-like search-as-you-type experience on your own dataset. It lets you quickly build a full-text search index from a list of dictionaries and start searching immediately. Powered by tantivy (a Rust-based search engine), it delivers fast indexing and querying with minimal setup.

Features:

  1. Multiple search modes: ngram (substring matching), full-text (BM25), fuzzy (typo-tolerant), field-specific, and range queries.

  2. Sorting: single-field and multi-field sorting on numeric and datetime fields.

  3. Query language: Lucene-style syntax with boolean operators (AND, OR), range expressions (year:[2020 TO 2025]), and field-specific queries (author:smith).

  4. Two-layer disk cache: automatic caching of data freshness (L1) and query results (L2), with schema-aware invalidation.

  5. Cross-process safety: SQLite-backed atomic locking prevents concurrent index corruption.

  6. Pydantic configuration: all settings are validated pydantic models with IDE autocompletion support.

Install

sayt2 is released on PyPI, so all you need is to:

$ pip install sayt2

To upgrade to latest version:

$ pip install --upgrade sayt2

Table of Content

About the Author

(\ (\
( -.-)o
o_(")(")

Sanhe Hu is a seasoned software engineer with a deep passion for Python development since 2010. As an author and maintainer of 150+ open-source Python projects, with over 15 million monthly downloads, I bring a wealth of experience to the table. As a Senior Solution Architect and Subject Matter Expert in AI, Data, Amazon Web Services, Cloud Engineering, DevOps, I thrive on helping clients with platform design, enterprise architecture, and strategic roadmaps.

Talk is cheap, show me the code:

API Document