A pure-Python full text indexing search library based on sqlite and the FTS5 extension.
Project description
pocketsearch
pocketsearch is a pure-Python full text indexing search library based on sqlite and the FTS5 extension. It provides
- A simple API (inspired by the ORM layer of the Django web framework) for defining schemas and searching - no need to write SQL
- Multi-field indices using schemas including text, numeric and date/datetime search
- Prefix, phrase and initial token queries
- Spell checking and query auto correction
- Boolean search queries
- Highlightning search results and extracting snippets
- Autocomplete features
It does not have any external dependencies other than Python itself. pocketsearch has been tested on Python 3.8, 3.9, 3.10, 3.11 and Python 3.12
Quick start
Install using PIP:
pip install pocketsearch
to install the package.
Create an search index using a PocketWriter and store it to my_db.db:
import pocketsearch
with pocketsearch.PocketWriter(db_name="my_db.db") as pocket_writer:
pocket_writer.insert(text="Hello world")
Open a search index using a PocketReader to perform searches:
import pocketsearch
with pocketsearch.PocketReader(db_name="my_db.db") as pocket_reader:
for result in pocket_reader.search(text="Hello world"):
print(result.text)
Read the complete documentation at https://pocketsearch.readthedocs.io/
Status
The package is currently in Beta status.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pocketsearch-0.21.0.tar.gz
.
File metadata
- Download URL: pocketsearch-0.21.0.tar.gz
- Upload date:
- Size: 33.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73e117fe160cf2a4101155a7b1c29148adf42c2863965594d12e699d66ec6036 |
|
MD5 | 5f6710ea2c6aa296ffd0ea2e9c78bf36 |
|
BLAKE2b-256 | 63e4b6b74ee3c5b1c4effb7555f4c649606acf48573d34744d95a494a509eaf7 |
File details
Details for the file pocketsearch-0.21.0-py3-none-any.whl
.
File metadata
- Download URL: pocketsearch-0.21.0-py3-none-any.whl
- Upload date:
- Size: 33.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd2097c6d1c46ea0270037f931f85f05ff969dcdb59c73d2f14c1488b7fab7ef |
|
MD5 | 67144666971bb8428fc8ffd0aaa17710 |
|
BLAKE2b-256 | 21de1770ac9d6384b08aa0cdefa4c6ccd9bc54ca38eebb591792c8d9e7666473 |