16 ml-initdb.py [-C] [-D]
20 -C, --config config Configuration file
21 -D, --database database Open this database by pathname/db uri
23 Initialize database and import genres list. Isn’t really needed as
24 the next script does all that too.
32 ml-import.py [-C] [-D] [-P] [file.inpx ...]
36 -C, --config config Configuration file
37 -D, --database database Open this database by pathname/db uri
38 -P, --no-pbar Inhibit progress bar
40 Initialize database, import genres list and import a list of INPX files
41 listed in the command line. On subsequent runs doesn’t destroy DB or
42 reimport genres; it also skips already import books but import new ones.
50 ml-search.py [-C] [-D] [-i] [-I] [-t] [-s] [-f] [-v] [-c] ...
52 Search through the database and display results. Currently can only
53 search authors by name.
57 -C, --config config Configuration file
58 -D, --database database Open this database by pathname/db uri
59 -i, --ignore-case ignore case (default is to guess)
60 -I, --case-sensitive don’t ignore case
61 -t, --start search type: substring at the start
63 -s, --substring search type: substring anywhere
64 -f, --full search type: match the full string
65 -c, --count Output count of found objects
66 -v, --verbose Output more details about found objects;
67 repeat for even more details
69 Options ``-i/-I`` cannot be used together as they are the opposite. In
70 case none of them are used the program guesses case-sensitivity by
71 looking at the arguments. If all arguments are lowercase the program
72 performs case-insensitive search. If there are UPPERCASE or MixedCase
73 arguments the program performs case-sensitive search.
75 Options ``-t/-s/-f`` define the search type. Search types are:
77 * start - search for substring at the start of the search field; for
78 example searching for "duck" returns results for "duck" and "duckling"
79 but not for "McDuck"; this is the default search type.
80 * substring - search for any substring; "duck" => "duck", "duckling",
81 "McDuck" (except for case-sensitive search, of course).
82 * full - search for exact match, compare the entire strings;
83 i.e. searching for "duck" returns results for "duck" but not for
92 ml-search.py author [-s surname] [-n name] [-m misc-name] [--id id] [fullname]
94 Search and print a list of authors by surname/name/misc name/full name.
98 -s, --surname surname Search by surname
99 -n, --name name Search by name
100 -m, --misc-name misc. name Search by misc. name
101 --id id Search by database id
105 ml-search.py -i author -s duck
107 Search and print a list of authors whose surname starts with "duck",
110 If a few options are given the search is limited with operator AND.
113 ml-search.py -i author -s duck -n mack
115 Search and print a list of authors whose surname starts with "duck" and
116 name starts with "mack", case insensitive.
118 With one option `-v` it also prints database id.
121 Book searching and downloading
122 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
126 ml-search.py books [-t title] [-s series] [-a archive] [-f file] [--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] [-P path] [-F format] [--get] [--get-many N]
128 Search and print a list of books by title, series, archive or file name.
132 -t, --title title Search by title
133 -s, --series series Search by series
134 -a, --archive archive Search by archive (zip file)
135 -f, --file file Search by file name (without extension)
136 --id id Search by database id
137 --surname surname Search by author’s surname
138 --name name Search by author’s name
139 --misc-name misc. name Search by author’s misc. name
140 --fullname name Search by author’s full name
141 --aid aid Search by author’s id
142 -e, --ext ext Search by file extension
143 --eid eid Search by extension’s id
144 --gname name Search by genre’s name
145 --gtitle title Search by genre’s title
146 --gid gid Search by genre’s id
147 -l, --lang lang Search by language
148 --lid lid Search by language’s id
149 --filters Use filters from config
150 -P, --path path Path to the directory with the library
152 --download-to [path] Download directory
153 -F, --format format Format of the downloaded file name
154 --get Download exactly one book
155 --get-many N Download at most this many books
157 By default the program prints only titles of the found book. With one
158 option `-v` it also prints database id, the list of authors and genres,
159 and also series the book belongs to (if any) and the serial number of
160 the book in the series. With two options `-v` (`-v -v` or simply `-vv`)
161 it also prints the file date and language. With three `-v` it prints
162 archive name, file name, extension and size, and flag if the book is
163 marked to be deleted.
165 Option `-P` provides the path to the directory with the library
166 archives. By default the path is extracted from configuration file,
167 section `[library]`, key `path`::
170 path = /var/lib/archives
172 The option is useful for multiple databases (global option `-D`).
174 Option `--filters` turns on using filters from config. Currently there
175 are two kind of filters: filters on languages and filter on flag
176 `deleted`. They are defined in the config file the following way::
182 `lang` filters is a list of language codes separated by a space.
183 `deleted` is a 0/1 flag; 0 hides deleted books from search.
185 Option `--download-to` provides the path to the download directory.
186 By default the script downloads books to the current directory.
187 If the option is used without `path` argument the path is extracted from
188 configuration file, section `[download]`, key `path`::
193 Option `--get` allows to download a book from the library to a local
194 file. The option allows to download exactly one book. The simplest way
195 to use it is via option `--id`. The file is downloaded into the current
196 directory with the name from the library.
201 | format = %a/%s/%n %t
203 allows to set format for the download file pathname. Default format is
204 `%f`, i.e. just filename. Other format specifiers are::
206 %a - author (one of if many)
208 %f - file name in archive
209 %G - genre (one of if many), name
210 %g - genre (one of if many), title
212 %n - series number (or 0)
216 Format must not end in directory separator (`/` or `\\`). If specifier
217 `%e` (extension) is not found in the format it is appended
218 unconditionally with a dot. That is, format `%f` is equivalent to
221 Option `-F|--format format` allows to overwrite this configuration value.
223 Option `--get-many N` allows to download many books (at most N, where N
224 is an integer). Options `--get-many N` and `--get` are, of course,
225 mutually incompatible.
233 ml-search.py ext [name] [--id id]
237 --id id Search by database id
239 Search and print a list of extensions by name.
241 With one option `-v` it also prints database id.
249 ml-search.py genres [-n name] [-t title] [--id id]
251 Search and print a list of genres by name and title.
255 -n, --name name Search by name
256 -t, --title title Search by title
257 --id id Search by database id
259 With one option `-v` it also prints database id.
267 ml-search.py lang [name] [--id id]
269 Search and print a list of languages by name.
273 --id id Search by database id
275 With one option `-v` it also prints database id.
287 -p, --port port HTTP port to listen to
289 Run a web server. If a port is given listens on the given port else
290 chooses a random port. Starts a browser (or open a new window of a
291 running browser) pointing it to the server.
293 If the program is already running the second instance detects the first
294 one, starts a browser pointing to running instance and exits.