TCPDashboard/data/common/__init__.py
Vasily.onl e7ede7f329 Refactor aggregation module and enhance structure
- Split the `aggregation.py` file into a dedicated sub-package, improving modularity and maintainability.
- Moved `TimeframeBucket`, `RealTimeCandleProcessor`, and `BatchCandleProcessor` classes into their respective files within the new `aggregation` sub-package.
- Introduced utility functions for trade aggregation and validation, enhancing code organization.
- Updated import paths throughout the codebase to reflect the new structure, ensuring compatibility.
- Added safety net tests for the aggregation package to verify core functionality and prevent regressions during refactoring.

These changes enhance the overall architecture of the aggregation module, making it more scalable and easier to manage.
2025-06-07 01:17:22 +08:00

64 lines
1.4 KiB
Python

"""
Common data processing utilities for all exchanges.
This package contains shared components for data validation, transformation,
and aggregation that can be used across different exchange implementations.
"""
from .data_types import (
StandardizedTrade,
OHLCVCandle,
MarketDataPoint,
DataValidationResult,
CandleProcessingConfig
)
from .aggregation import TimeframeBucket
# Temporarily import from old location until we move these classes
from .aggregation import RealTimeCandleProcessor
from .transformation import (
BaseDataTransformer,
UnifiedDataTransformer,
create_standardized_trade
)
from .validation import (
BaseDataValidator,
ValidationResult
)
from .indicators import (
TechnicalIndicators,
IndicatorResult,
create_default_indicators_config,
validate_indicator_config
)
__all__ = [
# Data types
'StandardizedTrade',
'OHLCVCandle',
'MarketDataPoint',
'DataValidationResult',
'CandleProcessingConfig',
# Aggregation
'TimeframeBucket',
'RealTimeCandleProcessor',
# Transformation
'BaseDataTransformer',
'UnifiedDataTransformer',
'create_standardized_trade',
# Validation
'BaseDataValidator',
'ValidationResult',
# Technical Indicators
'TechnicalIndicators',
'IndicatorResult',
'create_default_indicators_config',
'validate_indicator_config'
]