lorenzgillner / littools

Scripts for personal library management.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

littools

Collection of scripts for literature management.

Requirements

In addition to Perl 5 (with Tk) and a POSIX-compliant shell with coreutils, the following command line tools are required:

  • parallel
  • zathura PDF viewer
  • fdfind (also known as fd-find or just fd)
  • pdftotext (not pdf2txt)

Installation

Customize PREFIX in the Makefile, if required (~/.local/bin by default). Then, simply run:

make install

Command overview

mklitentry

Usage: mklitentry.sh [FILE]...

Read one or more PDFs and generate a database entry (simple CSV) for each FILE in the following form:

 key,tag1;tag2;tagN,/abs/path,unique words from text

If FILE is - or empty, read from STDIN. Output is written to STDOUT.

mklitdb

Usage: mklitdb.sh <DIR>

Create a literature database recursively from all PDFs inside the directory DIR by calling mklitentry.sh in parallel.

Output is written to STDOUT.

mkiidx

Usage: mkiidx.pl <DATABASE>

Generate an inverse index from database file <DATABASE> (previously generated by either mklitentry.sh or mklitdb.sh) in the following form:

term,key1:/absolute/path/1;key2:/absolute/path/2;...
...

Output is written to STDOUT.

iidxlookup

Usage: iidxlookup.pl <INVERSE_INDEX>

Read an inverse index (CSV file, previously generated by mkiidx.pl) and allow users to search it for all keywords in the query string (AND-search). File paths of matching documents are displayed in a list. When double-clicking a list entry, the absolute path is writen to STDOUT.

litsearch

Usage litsearch.sh>

Wrapper for iidxlookup.pl that opens its output in a default application.

TODO

  1. calculate $TF$ or $TF/IDF$ in mklitentry.sh
  2. rank results in iidxlookup.pl
  3. update database on file system changes (inotifywatch)
  4. command for updating an existing iidx.csv
  5. rebuild index

About

Scripts for personal library management.


Languages

Language:Perl 81.4%Language:Shell 15.5%Language:Makefile 3.1%