Files
mindesbunister 074787f067 Initial project structure: MarketScanner - Fear-to-Fortune Trading Intelligence
Features:
- FastAPI backend with stocks, news, signals, watchlist, analytics endpoints
- React frontend with TailwindCSS dark mode trading dashboard
- Celery workers for news fetching, sentiment analysis, pattern detection
- TimescaleDB schema for time-series stock data
- Docker Compose setup for all services
- OpenAI integration for sentiment analysis
2026-01-08 14:15:51 +01:00

44 lines
1.0 KiB
Python

"""News schemas."""
from typing import Optional
from datetime import datetime
from uuid import UUID
from pydantic import BaseModel, Field
class NewsBase(BaseModel):
"""Base news schema."""
title: str
url: str
source: str
published_at: datetime
class NewsCreate(NewsBase):
"""Schema for creating a news article."""
content: Optional[str] = None
summary: Optional[str] = None
author: Optional[str] = None
image_url: Optional[str] = None
class NewsResponse(NewsBase):
"""Schema for news response."""
id: UUID
summary: Optional[str] = None
author: Optional[str] = None
fetched_at: datetime
class Config:
from_attributes = True
class NewsWithSentiment(NewsResponse):
"""News response with sentiment analysis."""
content: Optional[str] = None
image_url: Optional[str] = None
sentiment_score: Optional[float] = None
sentiment_label: Optional[str] = None
sentiment_confidence: Optional[float] = None
is_processed: bool = False