1. Iñigo Serna
  2. bidebarrieta

Overview

HTTPS SSH
Bidebarrieta
============
Copyright (C) 2010-16  Iñigo Serna
Time-stamp: <2016-07-29 01:18:41 inigo>


Description
-----------
Bidebarrieta is an ebook manager.


Requirements
------------
. python 2.7 (does not work with 3.x due to puch and MobiUnpack dependencies)
. pychm
. MobiUnpack (included)
. cairo
. pygtk 2.16+, pypoppler for Gtk2 interface
. gobject-instrospection for Gtk3 interface


Database schema
---------------
Library
  . name
  . base path
  . books *

File
  . path (no filename, only dir, none for physical books)
  . filename (no ext, none for physical books)
  . format (ext or physical)
  . size (none for physical books)
  . added
  . mtime

Book
  . id = sha1
  . path
  . format
  . size
  . numpages
  . added
  . modified
  . title
  . author(s) *
  . publisher *
  . pubdate
  . edition
  . isbn
  . lang. ISO 639-1, http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
  . rating
  . cover *
  . comments
  . tags *


Formats
-------
pdf, ps, djvu, dvi
epub
mobi, prc, azw, azw3, azw4
fb2
chm
html
txt
odt, rtf, doc
zip, rar, ...
physical book (not ebook)


Application fs
--------------
/po
/ui
/formats
  pdf
  epub
  fb2
  chm
  mobi
  ...
/internet
  googlebooks,
  isbndb
  wikipedia
db
main


Searching
---------
Syntax:

Search accepts multiple terms, each term is separated by one or more spaces, and can be of the form:

       [PREFIX]_FreeValue    OR    [PREFIX]_Field_SELECTOR_Value

no spaces are allowed between the elements (those _ chars must not be present)

where:

* Prefix:
  . (nothing)  OR clause, term can appear unless inclusions or exclusions forced in or out from results
  . +  inclusion clause, term must appear in results, if not, out from results
  . -  exclusion clause (term can not appear, exclusion), if match, out from results

* FreeValue:
  . a (partial or complete) text will be searched in fields: title, author, tag, publisher, format

* Fields: title, author, tag, publisher, format, id, path, format, size, numpages, added, modified, pubdate, edition, isbn, lang, rating, comments


size: number is interpreted as bytes, XXXK, XXXM (no decimals

* Selector:
  . =  match exact value
  . :  match partial value (LIKE in SQL queries)
  . >  greater-than, used with numbers or dates
  . <  less-than, used with numbers or dates
  . != different-than
  . >= greater-or-equal-than, used with numbers or dates
  . <= less-or-equal-than, used with numbers or dates

Notes:
. order of terms is not important
. in case a book appear both in inclusion and exclusion lists, exclusion takes preference
. no spaces allowed between Prefix and FreeValue or between Prefix, Field, Selector and Value
. FreeValue or Value must be enclosed in " if it contains spaces or any special characters
. string FreeValue matches ignoring words case, to force case check use complex form with = selector
. rating values are integers between 0..5
. with added, modified or pubdate and = or : selectors, date can only be year, year/month, year/month/day (various formats supported)
  and it will be translated to a date range.
  Examples: 2016 -> from 01/01/2016 to 31/12/2016
            Apr 2016 -> from 01/04/2016 to 30/04/2016
            17/01/2016 -> from 17/01/2016 at 00:00:00 to 17/01/2016 at 23:59:59
. can't use != with dates
. can't use = or : with relative dates, as relative dates always imply from that date to now
. after books editing filtering is not changed automatically, to have the chance to see the changes


Examples:
* Simple:
  . science -asimov +epub                          ->  science books only in epub format except Asimov's
  . +"William Shakespeare" -Othello -Macbeth -pdf  ->  all non-pdf books by William Shakespeare except Othello and Macbeth
  . classics +tbr                                  ->  supposing 'classics' and 'tbr' (to-be-read) are both tags, return only books marked as 'classics' and 'tbr'
  . classics tbr                                   ->  supposing 'classics' and 'tbr' (to-be-read) are both tags, return books marked as 'classics' or 'tbr'
* Complex:
  . +author=Unknown +rating>3                      ->  author 'Unknown' (match upper U) with 3 or more stars
  . +author:borges +added<1d
  . added>"2016/07/01 22:37:00"                    ->  books added since 22:37 hours of 1st of July 2016. Seconds are optional. As there is a space, it must be enclosed between "
  . added>01-07-2016                               ->  books added since 1st of July 2016. Day-month-year order in this case, can use - instead of /, time is optional
  . added>"July 2016"                              ->  equivalent. Month name can appear in short version as well
  . added>-2w                                      ->  books added since 2 weeks ago, relative since now
  . added>"-2 weeks"                               ->  equivalent
  . added>"2 weeks ago"                            ->  equivalent
  . added < -1y                                    ->  books added until 12 months ago
  . modified>-2d +tag:science                      ->  books modified since 2 days ago with tag science
  . modified<2d +tag:science                       ->  equivalent
  . +lang=eu pubdate>2000                          ->  books in Basque language (EU) edited since year 2001
  . +lang=eu +pubdate>2000                         ->  same, are both terms are of the same type
  . -comments=""                                   ->  all books without comments

Common errors:
  . +William Shakespeare                           ->  Shakespeare's books *plus* books from any William (such as William Gibson). If you only want William Shakespeare use "William Shakespeare"
  . added > -2d                                    ->  spaces are not allowed
  . added<"2 weeks ago                             ->  missing " at end
  . added>"2016/05/01 22"                          ->  if hour is supplied, minutes are needed. Seconds are optional
  . added="1 week ago"                             ->  can't use relative dates with = or :


============================================================================