2 Somehow friendly API to get and share coffee related data from database.
6 `cbdb` module is used as interface to database. When getting data from
7 database, add methods here.
9 Data got from database are processed in `cbgetter` module. Feel free to add
10 formatting methods here. Also communication to slack is handled in this module.
13 Scripts to be run by systemd timers should by as simple as possible, runnable,
16 There are no tests needed for runnables.
19 For running tasks periodically, please see [Timers][6] and [User][7] pages
20 about systemd on archlinux wiki.
22 The example `top5_mate_stats.service`:
25 Description=Run top 5 Mate drinkers stats
28 Environment=PYTHONPATH=/path/to/coffee-getter
29 ExecStart=/path/to/coffee-getter/run/top5_mate_stats.py
32 The example `top5_mate_stats.timer`:
35 Description=Run top 5 Mate drinkers stats each Mon 9am
38 OnCalendar=Mon *-*-* 09:00:00
42 WantedBy=timers.target
45 Both files must be stored in `~/.config/systemd/user/` directory.
47 Then enable timer and service by:
49 systemctl --user enable top5_mate_stats.timer
50 systemctl --user enable top5_mate_stats.service
55 systemctl --user start top5_mate_stats.timer
60 For quick orientation see the [changelog][1].
62 Please, think about [The seven rules of a great Git commit message][2] when
63 making commit. The project use [OneFlow][3] branching model with the `master`
64 branch as the branch where the development happens.
67 Test Driven Development (TDD) is used in this project. Each *feature* **must**
68 start with adding test and all the tests **must** pass before merge to the
73 python3 -m unittest discover ut/
76 See [unittest][5] for start.
79 By default, sqlite3 `coffee.db` file is needed. You may create testing copy of
83 from ut.test_db import create_test_db
84 create_test_db("coffee.db")
88 Database is needed to pass the tests.
91 This project is developed under [GNU GPLv3 license][4].
94 [2]: https://chris.beams.io/posts/git-commit/
95 [3]: http://endoflineblog.com/oneflow-a-git-branching-model-and-workflow
97 [5]: https://docs.python.org/3.5/library/unittest.html
98 [6]: https://wiki.archlinux.org/index.php/Systemd/Timers
99 [7]: https://wiki.archlinux.org/index.php/Systemd/User