]> rtime.felk.cvut.cz Git - hubacji1/coffee-getter.git/blob - README.md
Merge branch 'rework-runs'
[hubacji1/coffee-getter.git] / README.md
1 Coffee getter is somehow friendly API to get and share coffee related data from
2 the database.
3
4 This project is published under [GNU AGPLv3 license](./LICENSE).
5
6
7 ## Running tasks periodically
8 Please, see [Timers][6] and [User][7] pages about systemd.
9
10 Service example:
11
12     [Unit]
13     Description=Run top 5 Mate drinkers stats
14
15     [Service]
16     Environment=PYTHONPATH=/path/to/coffee-getter
17     ExecStart=/path/to/coffee-getter/run/top5_mate_stats.py
18
19 Timer example:
20
21     [Unit]
22     Description=Run top 5 Mate drinkers stats each Mon 9am
23
24     [Timer]
25     OnCalendar=Mon *-*-* 09:00:00
26     Persistent=true
27
28     [Install]
29     WantedBy=timers.target
30
31 Store both files in:
32
33     ~/.config/systemd/user/
34
35 Enable timer and service:
36
37     systemctl --user enable top5_mate_stats.timer
38     systemctl --user enable top5_mate_stats.service
39
40 Start the timer:
41
42     systemctl --user start top5_mate_stats.timer
43
44
45 ## Contribute
46 Use Test Driven Development. Run test with:
47
48     python3 -m unittest discover ut
49
50 Send patches with git-send-email:
51
52     git config format.subjectPrefix "PATCH coffee-getter"
53     git config sendemail.to "jiri.vlasak.2@cvut.cz"
54
55 You need the database for the development. You may create it by:
56
57     python3 -c '
58         from ut.test_db import create_test_db
59         create_test_db("coffee.db")'