]> git.phdru.name Git - m_librarian.git/blob - docs/before_begin.rst
Add option -C|--config file
[m_librarian.git] / docs / before_begin.rst
1
2 Before you begin
3 ================
4
5 Before you begin you need some preparations.
6
7
8 .. contents::
9    :local:
10
11 .. highlight:: none
12
13 Software
14 --------
15
16 m_Librarian is written in Python and requires Python 2.7. So install
17 Python 2.7 first. Install required modules: SQLObject and m_lib.
18
19
20 Library archives
21 ----------------
22
23 The program works with local library archives so download some. In
24 addition to the very libraries you need to get INPX indices for them —
25 m_Librarian cannot index libraries yet.
26
27 Configuration file
28 ------------------
29
30 m_librarian looks up configuration file in $HOME/.config/ (if your OS is
31 POSIX-compatible). The configuration file must be named
32 ``m_librarian.conf``. It must be in ``ini``-file format. The following
33 sections and keys are now understood::
34
35     [database]
36     URI = "database URI"
37
38     [library]
39     path = "path to the library archives"
40
41     [download]
42     format = "download file format"
43
44 Most programs have an option `-C|--config file` to use a non-default
45 configuration file.
46
47 Database
48 --------
49
50 The program needs a database. It can work with any database supported by
51 SQLObject. Preferred ones are: MySQL, PostgreSQL or SQLite. If you plan
52 to use an SQL server you must create a database yourself. For SQLite,
53 the database file will be created by the program, so it's the simplest
54 way of using m_Librarian.
55
56 Database URI
57 ^^^^^^^^^^^^
58
59 In configuration file define section ``[database]`` with the only key
60 ``URI``. The value for the key must be a Database URI in format accepted
61 by SQLObject. Some examples::
62
63    [database]
64    URI = mysql://user:password@host/database
65
66    [database]
67    URI = postgres://user@host/database
68
69    [database]
70    URI = sqlite:///full/path/to/database
71
72 See some more examples in sample/m_librarian.conf. See detailed
73 description for DB URIs in `SQLObject documentation
74 <http://sqlobject.org/SQLObject.html#declaring-a-connection>`_.
75
76 .. vim: set tw=72 :