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