TimeTagger起動手順 - aktnk/til GitHub Wiki
TimeTaggerとは
- Webブラウザを使い、自分の行動を記録するアプリで URL https://timetagger.app/ にて有料サービスとして公開されている(但し、オープンソースとして公開しているソースコードを使い自分でサーバを立ち上げて使用すれば(self-hosted)無料で利用可)
- ソースコードもGithub https://github.com/almarklein/timetaggerにGPL-3.0で公開されている
- 同リポジトリにはdockerfileやdocker-compose.ymlも含まれており、Dockerコンテナを使いTimeTaggerサーバを起動可能
- Pythonモジュール Timetagger https://pypi.org/project/timetagger/もGPL-3.0で公開されている
- Python環境上にtimetaggerモジュールをインストールすれば、
python -m timetagger
コマンドを実行することでTimeTaggerサーバを起動可能
- Python環境上にtimetaggerモジュールをインストールすれば、
Python モジュール版TimeTaggerを使いTimeTaggerサーバを起動する
なお、以下はWSL2のUbuntu20.04LTS上のPython 3.10.5を使い実行した
- Pythonの仮想環境を準備する
$ python -m venv venv310 $ source venv310/bin/activate
- timetaggerモジュールをインストールする
なお、pipの更新も実施(venv310) $ pip install -U timetagger Collecting timetagger Downloading timetagger-24.7.1-py3-none-any.whl (3.0 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.0/3.0 MB 19.2 MB/s eta 0:00:00 Collecting asgineer>=0.8.0 Downloading asgineer-0.8.3-py3-none-any.whl (21 kB) Collecting pscript>=0.7.6 Downloading pscript-0.7.7-py3-none-any.whl (126 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 126.7/126.7 KB 16.3 MB/s eta 0:00:00 <省略> Installing collected packages: pscript, iptools, typing-extensions, pyjwt, MarkupSafe, markdown, itemdb, h11, click, bcrypt, asgineer, uvicorn, jinja2, timetagger Successfully installed MarkupSafe-3.0.2 asgineer-0.8.3 bcrypt-4.2.0 click-8.1.7 h11-0.14.0 iptools-0.7.0 itemdb-1.2.0 jinja2-3.1.4 markdown-3.7 pscript-0.7.7 pyjwt-2.9.0 timetagger-24.7.1 typing-extensions-4.12.2 uvicorn-0.32.0 WARNING: You are using pip version 22.0.4; however, version 24.3.1 is available. You should consider upgrading via the './venv310/bin/python -m pip install --upgrade pip' command.
(venv310) $ python -m pip install --upgrade pip Requirement already satisfied: pip in ./venv310/lib/python3.10/site-packages (22.0.4) Collecting pip Downloading pip-24.3.1-py3-none-any.whl (1.8 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 18.9 MB/s eta 0:00:00 <省略> Successfully installed pip-24.3.1 (venv310) $
- TimeTaggerサーバを起動する
なお、WSL2上で
python -m timetagger
として起動すると、下記のエラーがでてサーバは停止してしまう
そこで、ERROR: [Errno 13] error while attempting to bind on address ('0.0.0.0', 80): permission denied [INFO 2024-11-02 15:57:15] Server is shutting down
--bind
オプションで8080ポートを指定して起動する(venv310) $ python -m timetagger --bind=0.0.0.0:8080 [INFO 2024-11-02 15:59:57] Collected 14 assets from /home/tanaka/pytimetagger/venv310/lib/python3.10/site-packages/timetagger/common/. [INFO 2024-11-02 15:59:57] Compiled pscript from dialogs.py [INFO 2024-11-02 15:59:57] Compiled pscript from dt.py [INFO 2024-11-02 15:59:57] Compiled pscript from front.py [INFO 2024-11-02 15:59:57] Compiled pscript from stores.py [INFO 2024-11-02 15:59:57] Compiled pscript from tools.py [INFO 2024-11-02 15:59:57] Compiled pscript from utils.py <省略> [INFO 2024-11-02 15:59:59] Server is starting up