feat: add external API providers and central settings database
- Add central settings database client (system_settings on postgres-shared) - User-scoped settings with global fallback - API config storage with enabled/disabled toggle - Per-source category filtering for news - Add modular external API providers in src/apis/: - OpenMeteoProvider: weather with geocoding (free, no key) - NOSProvider: Dutch news RSS feeds - BBCProvider: English news RSS feeds - AggregatedNewsProvider: merges sources with category filtering - AlphaVantageProvider: financial quotes (API key from settings DB) - Add provider dependencies and lifecycle management - Add requirements-dev.txt with pip-audit for security auditing - Add MEMORY_REMEMBER_PLAN.md documenting volatile/document memory architecture 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
"""
|
||||
External API clients for Library Desk.
|
||||
|
||||
This package contains clients for external web APIs, named by source.
|
||||
Each provider implements a common interface for interoperability.
|
||||
|
||||
Weather providers (implement WeatherProvider):
|
||||
- openmeteo: Open-Meteo (free, no key)
|
||||
|
||||
News providers (implement NewsProvider):
|
||||
- nos: NOS.nl Dutch RSS (free, no key)
|
||||
- bbc: BBC English RSS (free, no key)
|
||||
|
||||
Financial providers (implement FinancialProvider):
|
||||
- alphavantage: Alpha Vantage (free tier with key)
|
||||
|
||||
Users can swap providers by configuring which implementation to use.
|
||||
All providers return standardized response models from base.py.
|
||||
"""
|
||||
|
||||
# Base classes and models
|
||||
from .base import (
|
||||
# Enums
|
||||
WeatherCondition,
|
||||
# Weather models
|
||||
CurrentWeather,
|
||||
DayForecast,
|
||||
WeatherForecast,
|
||||
GeoLocation,
|
||||
# News models
|
||||
NewsItem,
|
||||
NewsFeed,
|
||||
# Financial models
|
||||
StockQuote,
|
||||
# Abstract providers
|
||||
WeatherProvider,
|
||||
NewsProvider,
|
||||
FinancialProvider,
|
||||
)
|
||||
|
||||
# Concrete implementations
|
||||
from .openmeteo import OpenMeteoProvider
|
||||
from .nos import NOSProvider
|
||||
from .bbc import BBCProvider
|
||||
from .news import AggregatedNewsProvider
|
||||
from .alphavantage import AlphaVantageProvider
|
||||
|
||||
__all__ = [
|
||||
# Enums
|
||||
"WeatherCondition",
|
||||
# Weather
|
||||
"CurrentWeather",
|
||||
"DayForecast",
|
||||
"WeatherForecast",
|
||||
"GeoLocation",
|
||||
"WeatherProvider",
|
||||
"OpenMeteoProvider",
|
||||
# News
|
||||
"NewsItem",
|
||||
"NewsFeed",
|
||||
"NewsProvider",
|
||||
"NOSProvider",
|
||||
"BBCProvider",
|
||||
"AggregatedNewsProvider",
|
||||
# Financial
|
||||
"StockQuote",
|
||||
"FinancialProvider",
|
||||
"AlphaVantageProvider",
|
||||
]
|
||||
Reference in New Issue
Block a user