How celebi-pkg/flight-analysis works
Flight Analysis is a Python package for collecting Google Flights results, persisting them for historical price tracking, and exposing price and recommendation commands. The principal workflow starts at the CLI or Python API, scrapes flight listings through a Chrome driver, and can save results into SQLite for later queries. Separate components cover analysis, configuration, caching, and legacy implementations. The README documents scheduled scraping, but its workflow implementation was not sampled; source-level edges are limited to shown excerpts and indexed references.
Main entry points: scrape.py Scrape API · commands.py CLI commands · database.py Database operations · driver.py Chrome driver
Components 19
User interfaces
- Flight CLI
src/google_flight_analysis/cli/main.py - CLI commands
src/google_flight_analysis/cli/commands.py - Python API
src/google_flight_analysis/__init__.py - Scheduled scraping
.github/workflows/scrape.yml
Flight scraping
- Scrape API
src/google_flight_analysis/scrape/scrape.py - Flight extraction
src/google_flight_analysis/scrape/scrape.py - Chrome driver
src/google_flight_analysis/scrape/driver.py - Google Flights
- Chrome browser
Storage and analysis
- Price analysis
src/google_flight_analysis/analyze/analysis.py - Database operations
src/google_flight_analysis/db/database.py - Flight data models
src/google_flight_analysis/db/models.py - SQLite database
Configuration and compatibility
- Scrape cache
src/google_flight_analysis/cache/cache.py - Configuration
src/google_flight_analysis/config.py - Legacy scraper
src/google_flight_analysis/legacy/scrape.py - Legacy cache
src/google_flight_analysis/legacy/cache.py - Legacy browser
src/google_flight_analysis/legacy/chrome_wrapper.py
Other components
- User or agent
Connections 19
- User or agent → Flight CLI: runs commands
README.md - User or agent → Python API: calls API
README.md - Flight CLI → CLI commands: dispatches commands
src/google_flight_analysis/cli/main.py - CLI commands → Scrape API: starts scrape
src/google_flight_analysis/cli/commands.py - CLI commands → Database operations: queries history
src/google_flight_analysis/cli/commands.py - Python API → Scrape API: exposes scrape
src/google_flight_analysis/__init__.py - Scrape API → Flight extraction: extracts listings
src/google_flight_analysis/scrape/scrape.py - Scrape API → Chrome driver: uses driver
src/google_flight_analysis/scrape/scrape.py - Chrome driver → Chrome browser: controls browser
src/google_flight_analysis/scrape/driver.py - Chrome browser → Google Flights: loads flights site
- Scrape API → Database operations: saves results
src/google_flight_analysis/scrape/scrape.py - Database operations → Flight data models: queries models
src/google_flight_analysis/db/database.py - Database operations → SQLite database: reads and writes
src/google_flight_analysis/db/database.py - CLI commands → Price analysis: offers analysis
README.md - CLI commands → Price analysis: offers recommendations
README.md - Configuration → Chrome driver: configures driver
src/google_flight_analysis/scrape/driver.py - Configuration → Database operations: sets database path
src/google_flight_analysis/db/database.py - Scheduled scraping → Scrape API: schedules scraping
- Legacy scraper → Legacy browser: uses wrapper