Files
DinQuant/backend_api_python/app/data_sources/__init__.py
T

45 lines
1004 B
Python
Raw Normal View History

2025-12-29 03:06:49 +08:00
"""
data source module
Support K-line data acquisition for multiple markets
2026-02-05 00:25:38 +08:00
Improved version (refer to daily_stock_analysis project):
- Fuse protection (circuit_breaker)
- Data cache (cache_manager)
- Anti-ban strategy (rate_limiter)
2025-12-29 03:06:49 +08:00
"""
from app.data_sources.factory import DataSourceFactory
2026-02-05 00:25:38 +08:00
from app.data_sources.circuit_breaker import (
CircuitBreaker,
get_realtime_circuit_breaker
)
from app.data_sources.cache_manager import (
DataCache,
get_realtime_cache,
get_kline_cache,
get_stock_info_cache
)
from app.data_sources.rate_limiter import (
RateLimiter,
get_random_user_agent,
random_sleep,
retry_with_backoff
)
2025-12-29 03:06:49 +08:00
2026-02-05 00:25:38 +08:00
__all__ = [
# factory
2026-02-05 00:25:38 +08:00
'DataSourceFactory',
# fuse
2026-02-05 00:25:38 +08:00
'CircuitBreaker',
'get_realtime_circuit_breaker',
# cache
2026-02-05 00:25:38 +08:00
'DataCache',
'get_realtime_cache',
'get_kline_cache',
'get_stock_info_cache',
# current limiter
2026-02-05 00:25:38 +08:00
'RateLimiter',
'get_random_user_agent',
'random_sleep',
'retry_with_backoff',
]