Initial commit — PlantGuideScraper project

This commit is contained in:
Trey T
2026-04-12 09:54:27 -05:00
commit 6926f502c5
87 changed files with 29120 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
from pydantic import BaseModel
from typing import Optional
class ApiKeyBase(BaseModel):
source: str
api_key: Optional[str] = None # Optional for no-auth sources, used as Client ID for OAuth
api_secret: Optional[str] = None # Also used as Client Secret for OAuth sources
access_token: Optional[str] = None # For OAuth sources like Wikimedia
rate_limit_per_sec: float = 1.0
enabled: bool = True
class ApiKeyCreate(ApiKeyBase):
pass
class ApiKeyUpdate(BaseModel):
api_key: Optional[str] = None
api_secret: Optional[str] = None
access_token: Optional[str] = None
rate_limit_per_sec: Optional[float] = None
enabled: Optional[bool] = None
class ApiKeyResponse(BaseModel):
id: int
source: str
api_key_masked: str # Show only last 4 chars
has_secret: bool
has_access_token: bool
rate_limit_per_sec: float
enabled: bool
class Config:
from_attributes = True