项目作者: yuu-eguci
项目描述 :
📊 Update a pinned gist to contain your weekly WakaTime stats by Python
高级语言: Python
项目地址: git://github.com/yuu-eguci/waka-box.git

waka-box
📊 Update a pinned gist to contain your weekly WakaTime stats


Description
- Python script
- Converts WakaTime stats to bar charts and publishes on specified gist
- Intended to run by GitHub Actions
Use on your own GitHub overview
- Register WakaTime account at https://wakatime.com/.
- Install WakaTime plugins into your editors following plugin install instructions.
- Create your own waka-box repository by pushing Use this template button at waka-box top page.
- GitHub Actions workflow automatically runs and it shows
EnvNotFoundError
this time.
- Register three env variables as repository secrets.
- WAKATIME_SECRET_API_KEY: Get your WakaTime Secret API Key from your account page.
- GIST_ID: Create a public gist with a file named
file
and get the gist id. https://gist.github.com/username/[gist id]
- GITHUB_ACCESS_TOKEN: Create a token from GitHub Settings > Developer settings > Personal access tokens > Generate new token > Check gist and generate
- Set them as repository secrets - Repository settings > Secrets
- Pin the gist on your GitHub overview.
- Open Actions tab > Open your workflow result > build > Re-run jobs
- It is possible that it shows
EmptyWakaTimeDataError
because WakaTime API data can be empty for a while after registration.
- After that, the jobs automatically run by every 12 hours.
Installation
On local
Create .env and run.
WAKATIME_SECRET_API_KEY=***
GIST_ID=***
GITHUB_ACCESS_TOKEN=***
pipenv install
pipenv run python main.py
On GitHub Actions
Register env variables and run by GitHub Actions.

Gist
https://gist.github.com/yuu-eguci/10a7031088fb0e783dc92e721c6443c3
What I learned this time
