Files
PlantGuideScraper/backend/app/schemas/stats.py
2026-04-12 09:54:27 -05:00

44 lines
837 B
Python

from pydantic import BaseModel
from typing import List, Dict
class SourceStats(BaseModel):
source: str
image_count: int
downloaded: int
pending: int
rejected: int
class LicenseStats(BaseModel):
license: str
count: int
class SpeciesStats(BaseModel):
id: int
scientific_name: str
common_name: str | None
image_count: int
class JobStats(BaseModel):
running: int
pending: int
completed: int
failed: int
class StatsResponse(BaseModel):
total_species: int
total_images: int
images_downloaded: int
images_pending: int
images_rejected: int
disk_usage_mb: float
sources: List[SourceStats]
licenses: List[LicenseStats]
jobs: JobStats
top_species: List[SpeciesStats]
under_represented: List[SpeciesStats] # Species with < 100 images