项目作者: athul

项目描述 :
A Pinned Gist with your Wakatime Language Metrics as Bars.
高级语言: Python
项目地址: git://github.com/athul/wakatime-metrics.git
创建时间: 2019-06-28T01:49:34Z
项目社区:https://github.com/athul/wakatime-metrics

开源协议:MIT License

下载


Wakatime Language Metrics

Wakatime’s Language Metrics as Bar

Decorate your Wakatime Language metrics as bar graph showing your language and ‘%’ of time you used it just by 16 lines of Python Code without any API calls and stuff.
You’ll need a wakatime account

How?

Before running you’ll need to make a .json file with you wakatine metrics of languages. You can copy&paste it from your wakatime dashboard or by clicking this .
You can view this by running python main.py <wakatime_metrics.json>

After running you get an output like this 👇👇

  1. Go 63.97% ████████████████████████████████
  2. Markdown 17.38% ████████░░░░░░░░░░░░░░░░░
  3. Bash 16.4 % ████████░░░░░░░░░░░░░░░░░
  4. Other 1.48 % ░░░░░░░░░░░░░░░░░░░░░░░░░
  5. Groff 0.33 % ░░░░░░░░░░░░░░░░░░░░░░░░░
  6. Git 0.28 % ░░░░░░░░░░░░░░░░░░░░░░░░░
  7. Text 0.17 % ░░░░░░░░░░░░░░░░░░░░░░░░░

You can refer the GitHub action result to see the o/p


I know most of this is a manual process(copying the json file) but You can automate the whole thing by running a simple shell script. For that you need

  • An new Gist
  • a text editor
    Clone the gist to your local system ,you can find that from the dropdown list in “Embed” button of the gist.
    The shell script is here
    1. cd <folder where the main.py and .json file exist>
    2. python main.py <filename>.json > <path_of_gist file>
    3. cd <folder_where_the_gist_is_present>
    4. git commit -a -m "Timely Updates"
    5. git push origin master
    Save the script in .sh file and run sh <filename.sh> when you update the JSON file.

Show off this metrics in your gist