]> git.phdru.name Git - m_librarian.git/blob - docs/before_begin.rst
Update docs: DB URI
[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
12 Software
13 --------
14
15 m_Librarian is written in Python and requires Python 2.7. So install
16 Python 2.7 first. Install required modules: SQLObject and m_lib.
17
18
19 Library archives
20 ----------------
21
22 The program works with local library archives so download some. In
23 addition to the very libraries you need to get INPX indices for them —
24 m_Librarian cannot index libraries yet.
25
26
27 Database
28 --------
29
30 The program needs a database. It can work with any database supported by
31 SQLObject. Preferred ones are: MySQL, PostgreSQL or SQLite. If you plan
32 to use an SQL server you must create a database yourself. For SQLite,
33 the database file will be created by the program, so it's the simplest
34 way of using m_Librarian.
35
36 Database URI
37 ^^^^^^^^^^^^
38
39 For m_Librarian to use an SQL server create a configuration file and put
40 it in $HOME/.config/ (if your OS is POSIX-compatible). Name the
41 configuration file ``m_librarian.conf``. It must be in ``ini``-file
42 format and must have the only section ``[database]`` with the only key
43 ``URI``. The value for the key must be a Database URI in format accepted
44 by SQLObject. Some examples::
45
46    [database]
47    URI = mysql://user:password@host/database
48
49    [database]
50    URI = postgres://user@host/database
51
52    [database]
53    URI = sqlite:///full/path/to/database
54
55 See some more examples in sample/m_librarian.conf. See detailed
56 description for DB URIs in `SQLObject documentation
57 <http://sqlobject.org/SQLObject.html#declaring-a-connection>`_.
58
59 .. vim: set tw=72 :