19 -d, --database database Open this database by pathname/db uri
21 Initialize database and import genres list. Isn’t really needed as
22 the next script does all that too.
30 ml-import.py [-d] [file.inpx ...]
34 -d, --database database Open this database by pathname/db uri
36 Initialize database, import genres list and import a list of INPX files
37 listed in the command line. On subsequent runs doesn’t destroy DB or
38 reimport genres; it also skips already import books but import new ones.
46 ml-search.py [-d] [-i] [-I] [-t] [-s] [-f] [-v] [-c] ...
48 Search through the database and display results. Currently can only
49 search authors by name.
53 -d, --database database Open this database by pathname/db uri
54 -i, --ignore-case ignore case (default is to guess)
55 -I, --case-sensitive don’t ignore case
56 -t, --start search type: substring at the start
58 -s, --substring search type: substring anywhere
59 -f, --full search type: match the full string
60 -c, --count Output count of found objects
61 -v, --verbose Output more details about found objects;
62 repeat for even more details
64 Options ``-i/-I`` cannot be used together as they are the opposite. In
65 case none of them are used the program guesses case-sensitivity by
66 looking at the arguments. If all arguments are lowercase the program
67 performs case-insensitive search. If there are UPPERCASE or MixedCase
68 arguments the program performs case-sensitive search.
70 Options ``-t/-s/-f`` define the search type. Search types are:
72 * start - search for substring at the start of the search field; for
73 example searching for "duck" returns results for "duck" and "duckling"
74 but not for "McDuck"; this is the default search type.
75 * substring - search for any substring; "duck" => "duck", "duckling",
76 "McDuck" (except for case-sensitive search, of course).
77 * full - search for exact match, compare the entire strings;
78 i.e. searching for "duck" returns results for "duck" but not for
87 ml-search.py author [-s surname] [-n name] [-m misc-name] [--id id] [fullname]
89 Search and print a list of authors by surname/name/misc name/full name.
93 -s, --surname surname Search by surname
94 -n, --name name Search by name
95 -m, --misc-name misc. name Search by misc. name
96 --id id Search by database id
100 ml-search.py -i author -s duck
102 Search and print a list of authors whose surname starts with "duck",
105 If a few options are given the search is limited with operator AND.
108 ml-search.py -i author -s duck -n mack
110 Search and print a list of authors whose surname starts with "duck" and
111 name starts with "mack", case insensitive.
113 With one option `-v` it also prints database id.
116 Book searching and downloading
117 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
121 ml-search.py books [-t title] [-s series] [-a archive] [-f file] [-p path] [--get] [--id id] [--surname name] [--name name] [--misc-name name] [--fullname name] [--aid aid] [-e ext] [--eid eid] [--gname name] [--gtitle title] [--gid gid] [-l lang] [--lid lid]
123 Search and print a list of books by title, series, archive or file name.
127 -t, --title title Search by title
128 -s, --series series Search by series
129 -a, --archive archive Search by archive (zip file)
130 -f, --file file Search by file name (without extension)
131 -p, --path path Path to the directory with the library
133 --get Download exactly one book
134 --id id Search by database id
135 --surname surname Search by author’s surname
136 --name name Search by author’s name
137 --misc-name misc. name Search by author’s misc. name
138 --fullname name Search by author’s full name
139 --aid aid Search by author’s id
140 -e, --ext ext Search by file extension
141 --eid eid Search by extension’s id
142 --gname name Search by genre’s name
143 --gtitle title Search by genre’s title
144 --gid gid Search by genre’s id
145 -l, --lang lang Search by language
146 --lid lid Search by language’s id
148 By default the program prints only titles of the found book. With one
149 option `-v` it also prints database id, the list of authors and genres,
150 and also series the book belongs to (if any) and the serial number of
151 the book in the series. With two options `-v` (`-v -v` or simply `-vv`)
152 it also prints the file date and language. With three `-v` it prints
153 archive name, file name, extension and size, and flag if the book is
154 marked to be deleted.
156 Option `-p` provides the path to the directory with the library
157 archives. By default the path is extracted from `m_librarian.conf`,
158 section `[library]`, key `path`::
161 path = /var/lib/archives
163 The option is useful for multiple databases (global option `-d`).
165 Option `--get` allows to download a book from the library to a local
166 file. The option allows to download exactly one book. The simplest way
167 to use it is via option `--id`. The file is downloaded into the current
168 directory with the name from the library.
173 | format = %a/%s/%n %t
175 allows to set format for the download file pathname. Default format is
176 `%f`, i.e. just filename. Other format specifiers are::
178 %a - author (one of if many)
180 %f - file name in archive
181 %G - genre (one of if many), name
182 %g - genre (one of if many), title
184 %n - series number (or 0)
188 Format must not end in directory separator (`/` or `\\`). If specifier
189 `%e` (extension) is not found in the format it is appended
190 unconditionally with a dot. That is, format `%f` is equivalent to
199 ml-search.py ext [name] [--id id]
203 --id id Search by database id
205 Search and print a list of extensions by name.
207 With one option `-v` it also prints database id.
215 ml-search.py genres [-n name] [-t title] [--id id]
217 Search and print a list of genres by name and title.
221 -n, --name name Search by name
222 -t, --title title Search by title
223 --id id Search by database id
225 With one option `-v` it also prints database id.
233 ml-search.py lang [name] [--id id]
235 Search and print a list of languages by name.
239 --id id Search by database id
241 With one option `-v` it also prints database id.