• Stars
    star
    1,415
  • Rank 32,941 (Top 0.7 %)
  • Language
    Python
  • License
    MIT License
  • Created about 4 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Wakatime Weekly Metrics on your Profile Readme.

waka-readme

Dev Metrics in Readme Unit Tests Python Version

WakaTime weekly metrics on your profile readme.

Project Preview

πŸ’¬ Forum | GitHub discussions

New to WakaTime?

Nope? Skip to prep work.

WakaTime gives you an idea of the time you spent on coding. This helps you boost your productivity and competitive edge.

  1. Head over to https://wakatime.com/ and create an account.
  2. After logging in get your WakaTime API Key from https://wakatime.com/api-key/.
  3. Install WakaTime plugin in your favorite editor / IDE.
  4. Paste in your API key to start telemetry.

ℹ️ Info | You can read WakaTime help to know more about configurations. Alternatively, you can also fetch data from WakaTime compatible services like Wakapi or Hakatime.

Prep Work

A GitHub repository and a README.md file is required. We'll be making use of readme in the profile repository*.

  • Save the README.md file after copy-pasting the following special comments. Your dev-metics will show up in between.

    <!--START_SECTION:waka-->
    <!--END_SECTION:waka-->

    <!--START_SECTION: --> and <!--END_SECTION: --> are placeholders and must be retained as is. Whereas "waka" can be replaced by any alphanumeric string. See #Tweaks section for more.

  • Navigate to your repo's Settings > Secrets and add a new secret named WAKATIME_API_KEY with your API key as it's value.

    Or use the url https://github.com/USERNAME/USERNAME/settings/secrets/actions/new by replacing the USERNAME with your own username.

    new_secrets_actions

  • Create a new workflow file (waka-readme.yml) inside .github/workflows/ folder of your repository. You can create it from a template using the actions tab of your repository too.

  • Clear any existing contents, add the following lines and save the file.

    name: Waka Readme
    
    on:
      workflow_dispatch: # for manual workflow trigger
      schedule:
        - cron: "0 0 * * *" # runs at every 12AM UTC
    
    jobs:
      update-readme:
        name: WakaReadme DevMetrics
        runs-on: ubuntu-latest
        steps:
          - uses: athul/waka-readme@master
            with:
              WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
              # following flags are required, only if this is not on
              # profile readme, remove the leading `#` to use them
              #GH_TOKEN: ${{ secrets.GH_TOKEN }}
              #REPOSITORY: <gh_username/gh_username>

Tweaks

There are many flags that you can tweak to suit your taste!

Flag Default Options Meaning
API_BASE_URL https://wakatime.com/api https://wakatime.com/api, https://wakapi.dev/api, https://hakatime.mtx-dev.xyz/api Integration with WakaTime compatible services like Wakapi & Hakatime are possible
REPOSITORY <gh_username>/<gh_username> <gh_username>/<repo_name> Waka-readme stats will appear on the provided repository
SECTION_NAME waka Any alphanumeric string The generator will look for this section to fill up the readme.
COMMIT_MESSAGE Updated waka-readme graph with new metrics Any string Messaged used when committing updated stats
CODE_LANG txt python ruby json , you can use other languages also Language syntax to format the generated text, to get colored text.
SHOW_TITLE false false, true Add title to waka-readme stats blob
BLOCKS β–‘β–’β–“β–ˆ β–‘β–’β–“β–ˆ, ⣀⣄⣀⣦⣢⣷⣿, -#, you can be creative! Ascii art used to build stats graph
TIME_RANGE last_7_days last_7_days, last_30_days, last_6_months, last_year, all_time String representing a dispensation from which stats are aggregated
SHOW_TIME true false, true Displays the amount of time spent for each language
SHOW_TOTAL false false, true Show total coding time
SHOW_MASKED_TIME false false, true Adds total coding time including unclassified languages (overrides: SHOW_TOTAL)
LANG_COUNT 5 Any reasonable number Number of languages to be displayed
STOP_AT_OTHER false false, true Stop when language marked as Other is retrieved (overrides: LANG_COUNT)

Example

waka-readme.yml

name: Waka Readme

on:
  workflow_dispatch:
  schedule:
    # Runs at 12am UTC
    - cron: "0 0 * * *"

jobs:
  update-readme:
    name: WakaReadme DevMetrics
    runs-on: ubuntu-latest
    steps:
      - uses: athul/waka-readme@master
        with:
          WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
          SHOW_TITLE: true
          BLOCKS: ->
          TIME_RANGE: all_time
          SHOW_TIME: true
          SHOW_MASKED_TIME: true
          LANG_COUNT: 10

README.md

From: 10 July 2020 - To: 06 August 2022

Total Time: 1,464 hrs 54 mins

Python             859 hrs 29 mins >>>>>>>>>>>>>>-----------   54.68 %
Markdown           132 hrs 33 mins >>-----------------------   08.43 %
TeX                103 hrs 52 mins >>-----------------------   06.61 %
HTML               94 hrs 48 mins  >>-----------------------   06.03 %
Nim                64 hrs 31 mins  >------------------------   04.11 %
Other              47 hrs 58 mins  >------------------------   03.05 %

Why only the language stats (and not other data) from the API?

I am a fan of minimal designs and the profile readme is a great way to show off your skills and interests. The WakaTime API, gets us a lot of data about a person's coding activity including the editors and Operating Systems you used and the projects you worked on. Some of these projects maybe secretive and should not be shown out to the public. Using up more data via the Wakatime API will clutter the profile readme and hinder your chances on displaying what you provide value to the community like the pinned Repositories. I believe that Coding Stats is nerdiest of all since you can tell the community that you are exercising these languages or learning a new language, this will also show that you spend some amount of time to learn and exercise your development skills. That's what matters in the end ❀️


*REPOSITORY flag and GH_TOKEN secret are required you're not using profile readme.

More Repositories

1

archie

A minimal Hugo Theme
HTML
859
star
2

shelby

Shelby is a fast ⚑️ , lightweight ☁️ , minimal✨, shell prompt written in Go.
Go
187
star
3

hackathon-sponsor-searches

Let these People Help you for your Next Hackathon
70
star
4

athul

May the Force be with you ✨
67
star
5

jimbru

A lightweight analytics server with FastAPI and deta.sh Base as DB. A glorified hit-counter of sorts 😁
Python
44
star
6

jiofi-cli

Get Details about your Jio-fi Network from the Terminal
Python
34
star
7

telewire

Connect GitHub to Telegram
JavaScript
25
star
8

wakatime-metrics

A Pinned Gist with your Wakatime Language Metrics as Bars.
Python
24
star
9

PP-Suku

PP Suku is a Portfolio Generator with a Frontend in React. With a GraphQL API
Python
15
star
10

statusoli

A GitHub Action to send a Telegram message regarding your Action Status and Repo Updates(push,issues,prs,stars,scheduled builds and comments)
Go
15
star
11

blog

Personal Blog built with Hugo
MDX
14
star
12

mailmon

Mass Email with Go+SMTP with a frontend in Vue. Emails can be written in Markdown
Go
10
star
13

termchat

A terminal Chat with Websockets(WIP)
Go
9
star
14

spam-bot

Made for our SPAM. Features include Re vili Saying Thank you
Python
9
star
15

T2S-Bridge

A bidirectional bridge connecting telegram and slack. In about 55 lines of code😁
JavaScript
8
star
16

fcc

Python
7
star
17

macrokuttan

The Budget Macropad Project
Python
7
star
18

me

My Landing Page
CSS
6
star
19

airtable-sendgrid

A Mailing List Script to send Emails from a Airtable base via SendGrid
Python
6
star
20

img-gen

OG Image and Twitter Card Summary Generator for my personal blog
Python
6
star
21

My-Code-Adventures

Links to Websites, Blogs, code etc....
5
star
22

wall

My Showcase/ Portfolio
4
star
23

lfh-go

My Slides for Go track for Learn From Home by TinkerHub :octocat:
4
star
24

remy

Get GitHub Releases Info, mostly Downloads
HTML
4
star
25

kanakkapilla

A small hack to get how much I spent with my bank
Go
4
star
26

bench-exporter

Prometheus exporter for frappe benches
Go
3
star
27

Suku-Frontend

This is implemented in PP-Suku
JavaScript
3
star
28

DL-Beginner

A Beginners Code to ML
Python
3
star
29

SGS

Get an SMS when something new happens on GitHub like a new Issue,PR. Made with Twilio API
JavaScript
3
star
30

adguard-stat-bot

A Telegram bot which sends your Daily Adguard Statistics
Go
3
star
31

transu

Transu is Lit
CSS
3
star
32

Library-Management-System

A Library Management system made with Django
Python
3
star
33

zet

A fork of hackstream/zettel for personal uses. Highly customized than the original version ⚑️
Go
3
star
34

py-twilio-action

Python
2
star
35

autom

Automation Scripts
Shell
2
star
36

jain-workshop

HTML
2
star
37

React-with-Gatsby

Learning React with Gatsby
JavaScript
2
star
38

varnam-desktop

Desktop client for Varnam
Go
2
star
39

Telegram-GH-Webhooks

Python
2
star
40

priyapetta-naatukare

A Telegram bot for forwarding Announcements in College Website
Python
2
star
41

ds

C
2
star
42

Some-Slide-Works

2
star
43

mariadb-storage-exporter

The most unwanted yet useful was making this mariadb storage fetching custom exporter for prometheus. Just returns the result of a single sql query run on mariadb
Go
2
star
44

notes

Shell
1
star
45

Django-graphql

Trying graphql with Django
Python
1
star
46

KR-USSD

Python
1
star
47

Js-Beginning

Yep... I started to learn Js
JavaScript
1
star
48

thubsub

C
1
star
49

GH

My Slides
JavaScript
1
star
50

hacktober

JavaScript
1
star
51

docker-pwds

Shell
1
star
52

portbot

Yeah .... Hubot
CoffeeScript
1
star
53

reimagined-ppt

PPT checking with mdx-deck
1
star
54

SMS-Email-Bridge

Python
1
star
55

Mulearn-notes

Some notes I wrote for Mu Learn ML course
1
star
56

accounting-app

2 Way accounting app made with Frappe Framework
Python
1
star
57

bot1

JavaScript
1
star
58

monitoring-confs

Monitoring Confs for Exporters
Shell
1
star
59

cc

C
1
star
60

dumbo

Dumbo is a dumb journal entry manager. It's really dumb that you have to write stuff to it /s
Go
1
star
61

roro

Python
1
star