Author: Oliver Ernster
If you like it please buy me a coffee: Donation link
A modern PySide6 desktop application that displays real-time train departure information with integrated weather forecasting and astronomical events. Features include a dark theme, automatic refresh, and a clean architecture following SOLID principles and modern design patterns.
- Python 3.8 or higher
git clone <repository-url>
cd trainer
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
python3 main.py # Windows: python main.pypython build.py- Installation Guide (docs/INSTALLATION.md)
- Configuration (docs/CONFIGURATION.md)
- Features (docs/FEATURES.md)
- Troubleshooting (docs/TROUBLESHOOTING.md)
- Development Guide (docs/DEVELOPMENT.md)
- Architecture Overview (docs/architecture.md)
- UI Architecture (docs/ui-architecture.md)
- Service Architecture (docs/service-architecture.md)
- Widget System (docs/widget-system.md)
- Data Flow (docs/data-flow.md)
- Design Patterns (docs/design-patterns.md)
- API Integration (docs/api-integration.md)
- Real-time departures with a 16-hour window
- Platform numbers, delays, cancellations, and operator info
- Route planning with interchange support
- Calling points and full service details
- Smart route filtering
- Automatic refresh with configurable intervals
- Real-time conditions with detailed metrics
- Seven-day forecast
- Automatic location detection via Open-Meteo
- Weather alerts and warnings
- No API key required
- Automatic refresh with error handling
- Astronomy Picture of the Day with metadata
- ISS real-time tracking
- Space and astronomical events
- Seven-day astronomy calendar
- Moon phases and celestial object visibility
- Educational resource links
- Clean, responsive design with accessibility support
- Light/Dark theme switching
- Modular manager-based architecture
- Adaptive layout for different screen sizes
- Custom widgets for optimal usability
- Keyboard shortcuts (Ctrl+T for theme, F5 for refresh)
- SOLID object-oriented architecture
- Service-oriented design with clear separation of concerns
- Design patterns including Factory, Observer, Strategy, Manager
- Robust error handling with graceful fallbacks
- Optimized performance via caching and lazy loading
- Extensible architecture for future plugins
The application follows a layered, SOLID-compliant architecture:
Presentation Layer - MainWindow, UI Managers, Widget System
Application Layer - UI Layout, Widget Lifecycle, Event Handlers
Business Logic Layer - Train, Weather, Astronomy Managers
Service Layer - Route Calculation, Train Data, Config, Timetable
Data Access Layer - API Services, Cache, Error Handling
Data Models - TrainData, WeatherData, AstronomyData, Configuration
External Services - Open-Meteo, Astronomy APIs
- Manager Pattern for UI responsibilities
- Encapsulated business logic via service classes
- Modular widget system with consistent theming
- SOLID-compliant layering and design
- Use of Factory, Observer, Strategy, Facade, and Command patterns
- Multi-level error handling with fallback mechanisms
trainer/
├── main.py
├── requirements.txt
├── config.json
├── README.md
├── version.py
├── build.py
├── REFACTORING_DOCUMENTATION.md
├── docs/
│ ├── architecture.md
│ ├── ui-architecture.md
│ ├── service-architecture.md
│ ├── widget-system.md
│ ├── data-flow.md
│ ├── design-patterns.md
│ ├── api-integration.md
│ ├── INSTALLATION.md
│ ├── CONFIGURATION.md
│ ├── FEATURES.md
│ ├── DEVELOPMENT.md
│ ├── TROUBLESHOOTING.md
│ └── ARCHITECTURE.md
├── assets/
│ ├── train_icon.svg
│ └── train_icon_*.png
├── src/
│ ├── models/
│ ├── api/
│ ├── ui/
│ │ ├── managers/
│ │ ├── widgets/
│ │ ├── components/
│ │ ├── handlers/
│ │ └── state/
│ ├── managers/
│ ├── core/
│ ├── cache/
│ ├── services/
│ ├── utils/
│ └── workers/
├── tests/
└── licenses/
- Open-Meteo API
- Astronomy APIs:
- APOD
- ISS
- NeoWs
- EPIC
- Rate limiting with backoff
- Multi-level caching and invalidation
- Robust error recovery
- Request batching and connection pooling
- Secure key handling
- SOLID design
- Design patterns throughout
- Clean architecture separation
- Dependency injection
- Detailed error handling
- Lazy loading
- Widget pooling
- Intelligent caching
- Memory-efficient resource management
- Responsive layouts
- Modular design
- Unit and integration tests
- Complete documentation with diagrams
- Plugin-ready extensibility
This project is licensed under the MIT License. See the LICENSE file for details.
Oliver Ernster
- Open-Meteo for weather data
- PySide6 for Qt Python bindings
- Astronomy data providers
For full technical details, see the documentation directory.