From ccb6d15776815bf6150633ab2e7666ddc44ab058 Mon Sep 17 00:00:00 2001 From: Nathan Falvey Date: Sat, 28 Feb 2026 13:54:07 +0000 Subject: [PATCH] Add tabulate dependency and enhance README generation with repository release count --- requirements.txt | 3 ++- update_profile.py | 22 +++++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/requirements.txt b/requirements.txt index 663bd1f..d55dd06 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ -requests \ No newline at end of file +requests +tabulate \ No newline at end of file diff --git a/update_profile.py b/update_profile.py index 3947395..d02a2b5 100644 --- a/update_profile.py +++ b/update_profile.py @@ -3,6 +3,7 @@ import requests import traceback import pprint import datetime +import tabulate # --- Configuration --- GITEA_URL = "https://gitea.nathan-falvey.synology.me" @@ -52,6 +53,7 @@ def collect_gitea_data(): "archived": repo.get("archived", False), "language": repo.get("language", "N/A"), "size": repo.get("size", 0), + "release_count": repo.get("release_count", 0), }) @@ -72,16 +74,30 @@ def do_readme_parse(): md += f"## Welcome to {username}'s Gitea Developer Hub! This is a collection of repositories and projects that I have created and maintained on my Gitea instance. Here you can find various projects that I have worked on, ranging from personal projects to open-source contributions.\n\n" if data["repos"]: md += f"### 📂 Repository Breakdown\n\n" + tab_headers = ["Name", "Language", "Size", "Releases", "Private", "Archived"] + tab_rows = [] for repo in data["repos"]: - md += f"- [{repo['name']}]({GITEA_URL}/{USERNAME}/{repo['name']}) - {repo['language']}\n" + tab_rows.append([ + repo["name"], + repo["language"], + format_bytes(repo["size"]), + repo["release_count"], + "Yes" if repo["private"] else "No", + "Yes" if repo["archived"] else "No" + ]) + md += tabulate.tabulate(tab_rows, headers=tab_headers, tablefmt="pipe") + md += "\n\n" + md += "## 📊 Stats Summary\n" md += f"\n**Total Repositories:** {len(data['repos'])}\n\n" md += f"**Total Storage Used:** {format_bytes(storage_used)}\n\n" if languages_used: - md += f"### **Languages Used:**" + md += f"### **Languages Used:**\n\n" for lang in languages_used: md += f"- **{lang}**\n" - + + + md += "\n"