Initial commit — PlantGuideScraper project
This commit is contained in:
43
backend/app/schemas/stats.py
Normal file
43
backend/app/schemas/stats.py
Normal file
@@ -0,0 +1,43 @@
|
||||
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
|
||||
Reference in New Issue
Block a user