You've already forked wakapi-readme-stats
Merge branch 'Alpha' into master
This commit is contained in:
41
README.md
41
README.md
@@ -94,23 +94,27 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
|
WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
|
||||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
USERNAME: <username> # optional, it will automatically use the username of the owner of the repository who's executing the workflow.
|
|
||||||
```
|
```
|
||||||
## Extras
|
## Extras
|
||||||
|
|
||||||
1. If you want to add the other info to your stats, you can add multiple `FLAGS` in your workflow file by default all flags are enabled
|
1. If you want to add the other info to your stats, you can add multiple `FLAGS` in your workflow file by default all flags are enabled
|
||||||
|
>except the lines of code flag due to heavy operation performed
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
- uses: anmol098/waka-readme-stats@master
|
- uses: anmol098/waka-readme-stats@master
|
||||||
with:
|
with:
|
||||||
WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
|
WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
|
||||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
USERNAME: <username>
|
|
||||||
SHOW_OS: "False"
|
SHOW_OS: "False"
|
||||||
SHOW_PROJECTS: "False"
|
SHOW_PROJECTS: "False"
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Flags Available
|
#### Flags Available
|
||||||
|
`SHOW_LINES_OF_CODE` flag can be set to `True` to show the Lines of code writen till date
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
`SHOW_COMMIT` flag can be set to `False` to hide the commit stats
|
`SHOW_COMMIT` flag can be set to `False` to hide the commit stats
|
||||||
|
|
||||||
**I'm an early 🐤**
|
**I'm an early 🐤**
|
||||||
@@ -120,6 +124,18 @@ jobs:
|
|||||||
🌃 Evening 112 commits █████████░░░░░░░░░░░░░░░░ 36.01%
|
🌃 Evening 112 commits █████████░░░░░░░░░░░░░░░░ 36.01%
|
||||||
🌙 Night 26 commits ██░░░░░░░░░░░░░░░░░░░░░░░ 8.36%
|
🌙 Night 26 commits ██░░░░░░░░░░░░░░░░░░░░░░░ 8.36%
|
||||||
|
|
||||||
|
```
|
||||||
|
📅 **I'm Most Productive on Sundays**
|
||||||
|
|
||||||
|
```text
|
||||||
|
Monday 50 commits ███░░░░░░░░░░░░░░░░░░░░░░ 13.19%
|
||||||
|
Tuesday 85 commits █████░░░░░░░░░░░░░░░░░░░░ 22.43%
|
||||||
|
Wednesday 56 commits ███░░░░░░░░░░░░░░░░░░░░░░ 14.78%
|
||||||
|
Thursday 44 commits ███░░░░░░░░░░░░░░░░░░░░░░ 11.61%
|
||||||
|
Friday 28 commits █░░░░░░░░░░░░░░░░░░░░░░░░ 7.39%
|
||||||
|
Saturday 30 commits ██░░░░░░░░░░░░░░░░░░░░░░░ 7.92%
|
||||||
|
Sunday 86 commits █████░░░░░░░░░░░░░░░░░░░░ 22.69%
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
`SHOW_LANGUAGE` flag can be set to `False` to hide the Coding Language You use
|
`SHOW_LANGUAGE` flag can be set to `False` to hide the Coding Language You use
|
||||||
@@ -167,6 +183,27 @@ PhpStorm 1 hr 35 mins ████░░░░░░░
|
|||||||
PyCharm 23 mins █░░░░░░░░░░░░░░░░░░░░░░░░ 4.49%
|
PyCharm 23 mins █░░░░░░░░░░░░░░░░░░░░░░░░ 4.49%
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## :sparkling_heart: Support the project
|
||||||
|
|
||||||
|
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously,
|
||||||
|
this takes time. You can use this service for free.
|
||||||
|
|
||||||
|
However, if you are using this project and happy with it or just want to encourage me to continue creating stuff, there are few ways you can do it :-
|
||||||
|
|
||||||
|
- Giving proper credit when you use this action on your readme, linking back to it :D
|
||||||
|
- Starring and sharing the project :rocket:
|
||||||
|
- [](https://www.paypal.me/aapreneur) - You can make one-time donations via PayPal. I'll probably buy a ~~beer~~ wine 🍷
|
||||||
|
|
||||||
|
Thanks! :heart:
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Contributions are welcomed! ♥
|
||||||
|
|
||||||
|
Made with :heart: and Python 🐍.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
> This project is inspired by an awesome pinned-gist project [Awesome Pinned Gists](https://github.com/matchai/awesome-pinned-gists) <br/>
|
> This project is inspired by an awesome pinned-gist project [Awesome Pinned Gists](https://github.com/matchai/awesome-pinned-gists) <br/>
|
||||||
>This project is inspired from [athul/waka-readme](https://github.com/athul/waka-readme)
|
>This project is inspired from [athul/waka-readme](https://github.com/athul/waka-readme)
|
||||||
|
|
||||||
|
|||||||
14
action.yml
14
action.yml
@@ -47,6 +47,20 @@ inputs:
|
|||||||
description: "Show the Coding language used in dev metrics"
|
description: "Show the Coding language used in dev metrics"
|
||||||
default: "True"
|
default: "True"
|
||||||
|
|
||||||
|
SHOW_LINES_OF_CODE:
|
||||||
|
required: false
|
||||||
|
description: "Show the Total Lines of code written Badge till date"
|
||||||
|
default: "False"
|
||||||
|
|
||||||
|
SHOW_LANGUAGE_PER_REPO:
|
||||||
|
required: false
|
||||||
|
description: ""
|
||||||
|
default: "True"
|
||||||
|
|
||||||
|
SHOW_LOC_CHART:
|
||||||
|
required: false
|
||||||
|
description: ""
|
||||||
|
default: "True"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
6
loc.py
6
loc.py
@@ -32,6 +32,7 @@ class LinesOfCode:
|
|||||||
time.sleep(0.7)
|
time.sleep(0.7)
|
||||||
print("\n\n")
|
print("\n\n")
|
||||||
print(yearly_data)
|
print(yearly_data)
|
||||||
|
print("here")
|
||||||
graph = BarGraph(yearly_data)
|
graph = BarGraph(yearly_data)
|
||||||
graph_file = graph.build_graph()
|
graph_file = graph.build_graph()
|
||||||
self.pushChart()
|
self.pushChart()
|
||||||
@@ -53,7 +54,6 @@ class LinesOfCode:
|
|||||||
elif month >= 9 and month <= 12:
|
elif month >= 9 and month <= 12:
|
||||||
return 3
|
return 3
|
||||||
|
|
||||||
|
|
||||||
def getCommitStat(self, repoDetails, yearly_data):
|
def getCommitStat(self, repoDetails, yearly_data):
|
||||||
result = self.run_query_v3(repoDetails['nameWithOwner'])
|
result = self.run_query_v3(repoDetails['nameWithOwner'])
|
||||||
this_year = datetime.datetime.utcnow().year
|
this_year = datetime.datetime.utcnow().year
|
||||||
@@ -91,10 +91,6 @@ class LinesOfCode:
|
|||||||
repo.create_file("charts/bar_graph.png", "Initial Commit", data)
|
repo.create_file("charts/bar_graph.png", "Initial Commit", data)
|
||||||
print("pushed")
|
print("pushed")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# if __name__ == '__main__':
|
# if __name__ == '__main__':
|
||||||
# try:
|
# try:
|
||||||
# g = Github(ghtoken)
|
# g = Github(ghtoken)
|
||||||
|
|||||||
4
main.py
4
main.py
@@ -93,7 +93,7 @@ def run_v3_api(query):
|
|||||||
repositoryListQuery = Template("""
|
repositoryListQuery = Template("""
|
||||||
{
|
{
|
||||||
user(login: "$username") {
|
user(login: "$username") {
|
||||||
repositories(orderBy: {field: CREATED_AT, direction: ASC}, last: 100, affiliations: [OWNER, COLLABORATOR, ORGANIZATION_MEMBER], isFork: false) {
|
repositories(orderBy: {field: CREATED_AT, direction: ASC}, last: 5, affiliations: [OWNER, COLLABORATOR, ORGANIZATION_MEMBER], isFork: false) {
|
||||||
totalCount
|
totalCount
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
@@ -280,6 +280,8 @@ def generate_commit_list(tz):
|
|||||||
string = string + '📅 **' + days_title + '** \n\n' + '```text\n' + make_commit_list(dayOfWeek) + '\n\n```\n'
|
string = string + '📅 **' + days_title + '** \n\n' + '```text\n' + make_commit_list(dayOfWeek) + '\n\n```\n'
|
||||||
return string
|
return string
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def get_waka_time_stats():
|
def get_waka_time_stats():
|
||||||
stats = ''
|
stats = ''
|
||||||
request = requests.get(
|
request = requests.get(
|
||||||
|
|||||||
@@ -2,6 +2,10 @@ import pandas as pd
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import altair as alt
|
import altair as alt
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
alt.data_transformers.enable('data_server_proxied')
|
||||||
|
|
||||||
|
|
||||||
# npm install vega-lite vega-cli canvas
|
# npm install vega-lite vega-cli canvas
|
||||||
|
|
||||||
|
|
||||||
@@ -21,7 +25,9 @@ class BarGraph:
|
|||||||
top_languages = {}
|
top_languages = {}
|
||||||
for year in self.yearly_data.keys():
|
for year in self.yearly_data.keys():
|
||||||
for quarter in self.yearly_data[year].keys():
|
for quarter in self.yearly_data[year].keys():
|
||||||
for language in sorted(list(self.yearly_data[year][quarter].keys()), key=lambda lang:self.yearly_data[year][quarter][lang], reverse=True)[0:max_languages]:
|
for language in sorted(list(self.yearly_data[year][quarter].keys()),
|
||||||
|
key=lambda lang: self.yearly_data[year][quarter][lang], reverse=True)[
|
||||||
|
0:max_languages]:
|
||||||
if 'top' not in self.yearly_data[year][quarter]:
|
if 'top' not in self.yearly_data[year][quarter]:
|
||||||
self.yearly_data[year][quarter]['top'] = {}
|
self.yearly_data[year][quarter]['top'] = {}
|
||||||
if self.yearly_data[year][quarter][language] != 0:
|
if self.yearly_data[year][quarter][language] != 0:
|
||||||
@@ -31,7 +37,8 @@ class BarGraph:
|
|||||||
top_languages[language] = 1
|
top_languages[language] = 1
|
||||||
top_languages[language] += 1
|
top_languages[language] += 1
|
||||||
|
|
||||||
# print(self.yearly_data)
|
print("here")
|
||||||
|
print(self.yearly_data)
|
||||||
|
|
||||||
all_languages = list(top_languages.keys())
|
all_languages = list(top_languages.keys())
|
||||||
|
|
||||||
@@ -53,6 +60,7 @@ class BarGraph:
|
|||||||
language_year.append(language_quarter)
|
language_year.append(language_quarter)
|
||||||
languages_all_loc[language] = language_year
|
languages_all_loc[language] = language_year
|
||||||
|
|
||||||
|
print("here 2")
|
||||||
print(languages_all_loc)
|
print(languages_all_loc)
|
||||||
|
|
||||||
language_df = {}
|
language_df = {}
|
||||||
@@ -64,19 +72,16 @@ class BarGraph:
|
|||||||
return df
|
return df
|
||||||
|
|
||||||
for language in languages_all_loc.keys():
|
for language in languages_all_loc.keys():
|
||||||
language_df[language]=pd.DataFrame(languages_all_loc[language],index=list(self.yearly_data.keys()),columns=["Q1","Q2","Q3"])
|
language_df[language] = pd.DataFrame(languages_all_loc[language], index=list(self.yearly_data.keys()),
|
||||||
|
columns=["Q1", "Q2", "Q3"])
|
||||||
|
|
||||||
for language in language_df.keys():
|
for language in language_df.keys():
|
||||||
language_df[language] = prep_df(language_df[language], language)
|
language_df[language] = prep_df(language_df[language], language)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
df = pd.concat(list(language_df.values()))
|
df = pd.concat(list(language_df.values()))
|
||||||
|
|
||||||
|
|
||||||
# print(df)
|
# print(df)
|
||||||
|
|
||||||
|
|
||||||
chart = alt.Chart(df).mark_bar().encode(
|
chart = alt.Chart(df).mark_bar().encode(
|
||||||
|
|
||||||
# tell Altair which field to group columns on
|
# tell Altair which field to group columns on
|
||||||
|
|||||||
Reference in New Issue
Block a user