diff --git a/README.md b/README.md index a9ba3b4..0f55d29 100644 --- a/README.md +++ b/README.md @@ -1,44 +1,40 @@ -

-I'm Marvin β M.Sc. student, fullstack developer and creator of Mastery Chart.
-Located in Baden-WΓΌrttemberg, Germany
.
-
I'm Marvin β M.Sc. student, fullstack developer and creator of Mastery Chart.
Located in Baden-WΓΌrttemberg, Germany
.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+wiha-tool 15:52 ββββββββββββββββ------------------------ 41% +masterychart 11:58 ββββββββββββ---------------------------- 31% +marvinscham 6:55 βββββββ--------------------------------- 18% disenchanter 1:39 β--------------------------------------- 4% -bibtex-oss 1:05 β--------------------------------------- 2% -``` +-``` +
JavaScript 8:23 ββββββββ-------------------------------- 22% -Python 7:04 βββββββ--------------------------------- 18% +Python 7:11 βββββββ--------------------------------- 19% PHP 5:44 ββββββ---------------------------------- 15% -YAML 3:50 ββββ------------------------------------ 10% +YAML 3:52 ββββ------------------------------------ 10% HTML 3:38 βββ------------------------------------- 9% -``` +Markdown 2:20 ββ-------------------------------------- 6% +-## π Latest blog posts +
Esperanto
-
-## More
-
-Last update: Sunday, 5 May 18:20 CEST
\ No newline at end of file +Last update: Monday, 6 May 02:08 CEST
+ \ No newline at end of file diff --git a/readme_updater.py b/readme_updater.py index 12ba96b..9189c34 100644 --- a/readme_updater.py +++ b/readme_updater.py @@ -45,14 +45,14 @@ def seconds_to_string(seconds): remaining_seconds = seconds % 86400 hours = remaining_seconds // 3600 remaining_minutes = (remaining_seconds % 3600) // 60 - + time_string = "" if days > 0: time_string += f"{days}:{hours:02}" else: time_string += f"{hours}" time_string += f":{remaining_minutes:02}" - + return time_string @@ -100,46 +100,54 @@ try: headers={'Authorization': f"Basic {waka_token}"} ) waka_info = response.json() - + total_duration = sum(item["total"] for item in waka_info["machines"]) - - project_list = waka_info["projects"][:5] - lang_list = waka_info["languages"][:5] - + + project_list = waka_info["projects"][:4] + lang_list = waka_info["languages"][:6] + max_name_len = max(len(entry["key"]) for entry in project_list) max_lang_len = max(len(entry["key"]) for entry in lang_list) max_key_len = max(max_name_len, max_lang_len) - - max_proj_time_len = max(len(seconds_to_string(entry["total"])) for entry in project_list) - max_lang_time_len = max(len(seconds_to_string(entry["total"])) for entry in lang_list) + + max_proj_time_len = max(len(seconds_to_string( + entry["total"])) for entry in project_list) + max_lang_time_len = max( + len(seconds_to_string(entry["total"])) for entry in lang_list) max_total_len = max(max_proj_time_len, max_lang_time_len) - - waka_projects += "```\n" + + waka_projects += "\n"
for project in project_list:
- filled_length = int((project["total"] / total_duration) * MAX_BAR_LENGTH)
- progress_bar = BAR_CHAR * filled_length + EMPTY_BAR_CHAR * (MAX_BAR_LENGTH - filled_length)
- percentage_str = str(int((project["total"] / total_duration * 100))) + "%"
-
+ filled_length = int(
+ (project["total"] / total_duration) * MAX_BAR_LENGTH)
+ progress_bar = BAR_CHAR * filled_length + \
+ EMPTY_BAR_CHAR * (MAX_BAR_LENGTH - filled_length)
+ percentage_str = str(
+ int((project["total"] / total_duration * 100))) + "%"
+
waka_projects += f"{project['key']:<{max_key_len}} "
- waka_projects += f"{seconds_to_string(project["total"]):>{max_total_len}} "
+ waka_projects += f"{seconds_to_string(project["total"]):>{
+ max_total_len}} "
waka_projects += f"{progress_bar} "
waka_projects += f"{percentage_str:>3}\n"
- waka_projects += "```"
-
- waka_langs += "```\n"
+ waka_projects += ""
+
+ waka_langs += "\n"
for lang in lang_list:
filled_length = int((lang["total"] / total_duration) * MAX_BAR_LENGTH)
- progress_bar = BAR_CHAR * filled_length + EMPTY_BAR_CHAR * (MAX_BAR_LENGTH - filled_length)
+ progress_bar = BAR_CHAR * filled_length + \
+ EMPTY_BAR_CHAR * (MAX_BAR_LENGTH - filled_length)
percentage_str = str(int((lang["total"] / total_duration * 100))) + "%"
-
+
waka_langs += f"{lang['key']:<{max_key_len}} "
waka_langs += f"{seconds_to_string(lang["total"]):>{max_total_len}} "
waka_langs += f"{progress_bar} "
waka_langs += f"{percentage_str:>3}\n"
- waka_langs += "```"
+ waka_langs += ""
+
+ waka_stats = waka_projects + "\n\n" + waka_langs
except Exception as e:
- waka_projects = ""
- waka_langs = ""
+ waka_stats = ""
print(e)
pass
@@ -147,11 +155,11 @@ duolingo_stats = {}
try:
response = requests.get(os.getenv("DUOLINGO_URL"))
duolingo_stats = response.json()
-
+
for lang in duolingo_stats["lang_data"]:
if duolingo_stats["lang_data"][lang]["learningLanguage"] == duolingo_stats["learning_language"]:
current_lang = duolingo_stats["lang_data"][lang]["learningLanguageFull"]
-
+
duolingo_stats["current_lang"] = current_lang
except Exception as e:
print(e)
@@ -166,8 +174,7 @@ data = {
"technologies": technologies,
"projects": projects,
"blog_entries": blog_entries,
- "waka_projects": waka_projects,
- "waka_langs": waka_langs,
+ "waka_stats": waka_stats,
"duolingo_stats": duolingo_stats,
"socials": socials,
"last_update": last_update
diff --git a/resources/README.md.jinja b/resources/README.md.jinja
index 66b0228..9c3e338 100644
--- a/resources/README.md.jinja
+++ b/resources/README.md.jinja
@@ -1,22 +1,17 @@
-
I'm Marvin β M.Sc. student, fullstack developer and creator of Mastery Chart.
Located in Baden-WΓΌrttemberg, Germany
.
-I'm Marvin β M.Sc. student, fullstack developer and creator of Mastery Chart.
-Located in Baden-WΓΌrttemberg, Germany
.
+{% for item in technologies -%}
+
+{% endfor -%}