DEV Community

4l1fe
4l1fe

Posted on

Your minimalistic full-text search cli helper. Librarian.

If you look for an cli utility to use full text search technique to find information in your text files or build micro services which provides smart searching and don't want to have a hassle with complicated software take a look at Librarian.

It's based on sqlite fts5 ability and allow to deal with different languages.

GitHub logo 4l1fe / Librarian

Your minimalistic helper to find what you have written and forgot. It uses Sqlite FTS5 with Snowball tokenizer supporting different languages.

Librarian

I'll found what had been in your mind but hasn't been in there.

Overview

Simple cli commands upon your text files which you want to search through in a smart way applying full text search technique with no cumbersome software.

Importable abstractions exposed as cli commands are designed to be reused on your need. You may plug them into your service.

Single file utility. Python and sqlite only.

Requirements

  1. Python$ ./configure --enable-loadable-sqlite-extensions - python complied sqlite binaries with enabled extensions to load fts5. No further settings required in code.
  2. fts5stemmer.so - compiled shared library to index target files with your preferable language.

Usage

Common options

$ python librarian.py -h
usage: librarian.py [-h] [--db DB] [--table TABLE] [--debug] [--sql-trace] {index,match}
optional arguments:
  -h, --help     show this help message and exit
  --db DB        DB file path. (default: librarian.db)
  --table TABLE  Table name to store files content. (default:
Enter fullscreen mode Exit fullscreen mode

Top comments (0)