mirror of
https://github.com/ShayManor/github-readme-stats.git
synced 2026-12-02 11:53:48 +05:30
feat(generator): scaffold + move widgets/themes/models/utils/processor/config
- Add generator/requirements.txt and generator/pytest.ini - git mv src/widgets, themes, models, utils, data/processor.py, config.py into generator/src/ - Fix relative imports in processor.py (moved up one level: .. → .) - Append service-specific env vars (PORT, DB paths, FETCHER_URL, etc.) to generator/src/config.py - git rm retired src/db, src/data/__init__.py, src/__init__.py Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
cb3ace8dcd
commit
3525144aeb
@@ -0,0 +1,21 @@
|
||||
"""Data models for GitHub profile widgets."""
|
||||
|
||||
from .types import (
|
||||
GradeData,
|
||||
TagData,
|
||||
ImpactWeek,
|
||||
CollaboratorData,
|
||||
FocusCategory,
|
||||
LanguageData,
|
||||
AchievementData,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"GradeData",
|
||||
"TagData",
|
||||
"ImpactWeek",
|
||||
"CollaboratorData",
|
||||
"FocusCategory",
|
||||
"LanguageData",
|
||||
"AchievementData",
|
||||
]
|
||||
@@ -0,0 +1,57 @@
|
||||
"""Data class definitions for widget components."""
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
|
||||
@dataclass
|
||||
class GradeData:
|
||||
grade: str # e.g. "A++", "S+", "B-"
|
||||
score: float # 0-100
|
||||
stats: dict # {"commits": 1423, "prs": 87, "stars": 342, "repos": 28, "followers": 156}
|
||||
tags: list # list of TagData
|
||||
breakdown: dict = field(default_factory=dict) # optional bar breakdown
|
||||
|
||||
|
||||
@dataclass
|
||||
class TagData:
|
||||
tag: str
|
||||
source: str = "earned" # "earned" | "chosen"
|
||||
confidence: float = 1.0
|
||||
|
||||
|
||||
@dataclass
|
||||
class ImpactWeek:
|
||||
week_start: str # ISO date
|
||||
commits: int = 0
|
||||
additions: int = 0
|
||||
deletions: int = 0
|
||||
|
||||
|
||||
@dataclass
|
||||
class CollaboratorData:
|
||||
username: str
|
||||
avatar_b64: str = "" # base64 encoded avatar
|
||||
shared_repos: int = 0
|
||||
shared_commits: int = 0
|
||||
|
||||
|
||||
@dataclass
|
||||
class FocusCategory:
|
||||
category: str
|
||||
percentage: float
|
||||
commit_count: int = 0
|
||||
|
||||
|
||||
@dataclass
|
||||
class LanguageData:
|
||||
language: str
|
||||
percentage: float
|
||||
loc: int = 0 # lines of code or repo count
|
||||
|
||||
|
||||
@dataclass
|
||||
class AchievementData:
|
||||
title: str
|
||||
subtitle: str = ""
|
||||
event_date: str = ""
|
||||
icon: str = "trophy" # trophy, medal, star, hackathon
|
||||
Reference in New Issue
Block a user