How br-g/openf1 works
OpenF1 exposes real-time and historical Formula 1 data through a read-only JSON/CSV API. The principal workflow is timing-data ingestion into MongoDB, followed by parameterized API queries and returned results. Separate branches scrape schedule and session results, while live ingestion also supports MQTT publication and optional raw-data object-storage uploads. The graph reflects README capabilities and source-index references; some unsampled subsystem internals and wiring are represented only at directory level or omitted where evidence is insufficient.
Main entry points: db.py MongoDB access · processing.py Live processor · query_api/app.py API routes · real_time/app.py Live orchestrator
Components 22
Timing ingestion
- Live orchestrator
src/openf1/services/ingestor_livetiming/real_time/app.py - Raw recorder
src/openf1/services/ingestor_livetiming/real_time/recording.py - Live processor
src/openf1/services/ingestor_livetiming/real_time/processing.py - Message decoder
src/openf1/services/ingestor_livetiming/core/decoding.py - Timing messages
src/openf1/services/ingestor_livetiming/core/objects.py - Collection dispatcher
src/openf1/services/ingestor_livetiming/core/processing/main.py - Timing collections
src/openf1/services/ingestor_livetiming/core/processing/collections - Historical ingestor
src/openf1/services/ingestor_livetiming/historical/main.py
Historical scraping
- Schedule scraper
src/openf1/services/f1_scraping/schedule.py - Session results
src/openf1/services/f1_scraping/session_result.py - Starting grid
src/openf1/services/f1_scraping/starting_grid.py
Query API
- API routes
src/openf1/services/query_api/app.py - Query filters
src/openf1/services/query_api/query_params.py - Response cache
src/openf1/services/query_api/cache.py - CSV responses
src/openf1/services/query_api/csv.py
Shared data services
- MongoDB access
src/openf1/util/db.py - Schedule lookup
src/openf1/util/schedule.py
External integrations
- MQTT publisher
src/openf1/util/mqtt.py - Object storage
src/openf1/util/storage.py - MQTT broker
- S3-compatible storage
Other components
- API consumer
Connections 26
- API consumer → API routes: requests data
README.md - API routes → Query filters: parses filters
src/openf1/services/query_api/app.py - API routes → Response cache: checks cache
src/openf1/services/query_api/app.py - API routes → MongoDB access: fetches documents
src/openf1/services/query_api/app.py - API routes → CSV responses: formats CSV
src/openf1/services/query_api/app.py - Live orchestrator → Raw recorder: records stream
src/openf1/services/ingestor_livetiming/real_time/app.py - Live orchestrator → Live processor: ingests file
src/openf1/services/ingestor_livetiming/real_time/app.py - Live orchestrator → Timing messages: gets topics
src/openf1/services/ingestor_livetiming/real_time/app.py - Live orchestrator → Object storage: uploads raw data
src/openf1/services/ingestor_livetiming/real_time/app.py - Object storage → S3-compatible storage: uploads files
src/openf1/util/storage.py - Live processor → Message decoder: decodes messages
src/openf1/services/ingestor_livetiming/real_time/processing.py - Live processor → Collection dispatcher: processes messages
src/openf1/services/ingestor_livetiming/real_time/processing.py - Collection dispatcher → Timing messages: maps topics
src/openf1/services/ingestor_livetiming/core/processing/main.py - Collection dispatcher → Timing collections: dispatches to
- Live processor → MongoDB access: writes documents
src/openf1/services/ingestor_livetiming/real_time/processing.py - Live processor → MQTT publisher: publishes updates
src/openf1/services/ingestor_livetiming/real_time/processing.py - MQTT publisher → MQTT broker: publishes messages
- Historical ingestor → Message decoder: decodes archives
src/openf1/services/ingestor_livetiming/historical/main.py - Historical ingestor → Collection dispatcher: processes messages
src/openf1/services/ingestor_livetiming/historical/main.py - Historical ingestor → MongoDB access: writes history
src/openf1/services/ingestor_livetiming/historical/main.py - Historical ingestor → Schedule lookup: resolves sessions
src/openf1/services/ingestor_livetiming/historical/main.py - Schedule scraper → MongoDB access: stores schedule
src/openf1/services/f1_scraping/schedule.py - Session results → MongoDB access: stores results
src/openf1/services/f1_scraping/session_result.py - Starting grid → MongoDB access: stores grid
src/openf1/services/f1_scraping/starting_grid.py - Session results → Schedule lookup: uses schedule
src/openf1/services/f1_scraping/session_result.py - Starting grid → Schedule lookup: uses schedule
src/openf1/services/f1_scraping/starting_grid.py