Skip to main content

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 and Python 3.11.

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:

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.

License: MIT Unit tests main Unit tests development Documentation Status

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pocketsearch-0.20.1.tar.gz (32.2 kB view details)

Uploaded Source

Built Distribution

pocketsearch-0.20.1-py3-none-any.whl (32.0 kB view details)

Uploaded Python 3

File details

Details for the file pocketsearch-0.20.1.tar.gz.

File metadata

  • Download URL: pocketsearch-0.20.1.tar.gz
  • Upload date:
  • Size: 32.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for pocketsearch-0.20.1.tar.gz
Algorithm Hash digest
SHA256 d22b7a595710abcffcb08813e6451f3b4b56bf7981d700089c32f8e9e18bd190
MD5 8cf29e53c2600cd7a09114ea5baa4e0e
BLAKE2b-256 fd44223c1681743f028b04ce85e6def42a226470b976cec8ec99eb73ee327cc9

See more details on using hashes here.

File details

Details for the file pocketsearch-0.20.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pocketsearch-0.20.1-py3-none-any.whl
Algorithm Hash digest
SHA256 205658532655e57886acc0bab2c344c098f4549c65ec74975168bd9db4f680d3
MD5 fd0e2d8dfa73d93eb34d3f9a6c481022
BLAKE2b-256 8478d1a6006a46707a58f554b65365347510982afda1ecd8d7cefa938cd217d9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page