Add tabulate dependency and enhance README generation with repository release count

This commit is contained in:
2026-02-28 13:54:07 +00:00
parent b653cfd8cb
commit ccb6d15776
2 changed files with 21 additions and 4 deletions

View File

@@ -1 +1,2 @@
requests
requests
tabulate

View File

@@ -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"