Introduction
SharedServices is a centralized Python package that provides common utilities, services, and tools used across all PROPPR betting intelligence bots (Player Bot and Team Bot). It ensures consistency, reduces code duplication, and provides a unified interface for data processing, API interactions, and bet tracking.Architecture
SharedServices follows a modular architecture with specialized modules for different aspects of the betting intelligence platform:Module Overview
Core Modules
Grading
Unified bet grading system with automated scheduling and result processing
Mapping
Data normalization for leagues, markets, and betting nomenclature
Tracking
Bet tracking system with alert reconstruction and user statistics
API Clients
Integrated clients for FotMob, Oddschecker, Overtime, and Betfair
Import Patterns
Direct Imports
SharedServices exports commonly used components at the package level:Module-Specific Imports
For specialized components, import from specific modules:Configuration
SharedServices uses centralized configuration fromPROPPR.SharedServices.config.shared_config:
Bot-Specific Configuration
Live Module (Optional)
The live module requires the Telegram library and is imported with a fallback:Common Use Cases
Initialize Grading System
Track User Bets
Normalize League Names
Error Handling
SharedServices includes comprehensive error handling:Best Practices
Use Centralized Configuration
Use Centralized Configuration
Always import configuration from
shared_config to maintain consistency across bots.Handle Rate Limits
Handle Rate Limits
Use the built-in rate limiting and backoff mechanisms in API clients and processors.
Bot Type Detection
Bot Type Detection
Pass
bot_type='player' or bot_type='team' to services that support both bot types.Logging
Logging
Use Python’s logging module consistently. SharedServices logs at INFO level by default.
Next Steps
Bet Grading
Learn about the unified bet grading system
Data Mapping
Understand data normalization and canonical markets
Bet Tracking
Explore user bet tracking features
API Clients
Integrate with external betting data providers