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