8000 GitHub - smoke-me/flight_mapper: A comprehensive tool for automated flight searches, comparison and sorting across multiple dates and routes.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

A comprehensive tool for automated flight searches, comparison and sorting across multiple dates and routes.

License

Notifications You must be signed in to change notification settings

smoke-me/flight_mapper

Repository files navigation

Flight Mapper

Version License

Flight Mapper is a comprehensive flight search and comparison tool that helps you find the best flight options across multiple dates and routes. It automates the process of searching for flights, organizing results, and comparing options based on your preferences.

Features

  • Flexible Trip Configuration: Define multiple origins, destinations, and date ranges for both one-way and round-trip flights
  • Automated Flight Search: Automatically searches for flights based on your configurations
  • Smart Flight Sorting: Sort flights based on price, duration, or a customized balance between both
  • Airline Filtering: Exclude specific airlines from your search results
  • Maximum Stops Control: Limit search results based on the number of layovers
  • Detailed Results: View comprehensive flight details including price, duration, stops, and airlines
  • Result Persistence: Saves all flight search results for later review
  • Clean Interface: Rich terminal-based interface with progress indicators and formatted output

Requirements

  • Python 3.8+
  • Chrome browser
  • ChromeDriver (compatible with your Chrome version)

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/flight_mapper.git
    cd flight_mapper
  2. Install required Python packages:

    pip install -r requirements.txt
  3. Install ChromeDriver:

    • macOS:
      brew install --cask chromedriver
      sudo xattr -d com.apple.quarantine /opt/homebrew/bin/chromedriver
    • Linux:
      # For Ubuntu/Debian
      sudo apt install chromium-chromedriver
    • Windows:

Usage

1. Create a Configuration File

Create a JSON file defining your search parameters. For example, trip.json:

{
    "origins": [
        "Abu Dhabi",
        "Dubai"
    ],
    "destinations": [
        "San Jose",
        "San Francisco"
    ],
    "departure_dates": [
        {
            "start": "2025-01-05",
            "end": "2025-01-12"
        }
    ],
    "return_dates": [
        {
            "start": "2025-06-13",
            "end": "2025-06-16"
        }
    ],
    "search_modifier": "cheapest"
}

2. Generate Trip Configurations

python trip_configurator.py trip.json

This will create all possible combinations of origins, destinations, and dates based on your configuration.

3. Run Flight Search

There are two options to run flight searches:

Option A: Run the flight orchestrator (recommended)

python flight_orchestrator.py

This will:

  1. Find all JSON config files in the current directory
  2. Process each config file through the trip configurator
  3. Run flight automation on the generated configurations
  4. Create timestamped results folders
  5. Combine and save all results

Option B: Run individual components

Generate trip configurations:

python trip_configurator.py trip.json

Run flight automation:

python flight_automation.py

4. Sort and Filter Results

After running a search, you can sort and filter your results using:

python flight_sorter.py

This interactive tool allows you to:

  • Balance between price and duration in your sorting (1-10 scale)
  • Exclude specific airlines
  • Set maximum number of stops

Project Structure

  • trip_configurator.py: Generates all possible trip combinations based on your config
  • flight.py: Core flight search implementation
  • flight_automation.py: Automates batch processing of flight searches
  • flight_sorter.py: Sorts and filters flight options
  • flight_orchestrator.py: Orchestrates the entire workflow
  • clean.py: Utility to clean up temporary files

Configuration Options

trip.json

  • origins: List of origin cities
  • destinations: List of destination cities
  • departure_dates: List of departure dates or date ranges
  • return_dates: List of return dates or date ranges (omit for one-way trips)
  • search_modifier: Additional search terms like "cheapest" or "business class"

Date formats

  • Single date: "2025-01-05"
  • Date range: {"start": "2025-01-05", "end": "2025-01-12"}

Best Practices

  • Use specific city names that match Google Flights format
  • For long trips, split your search into smaller date ranges
  • Consider running searches during off-peak hours
  • Review and organize your results using the sorting tools
  • Use the clean.py utility to remove temporary files after searches

Troubleshooting

  • ChromeDriver errors: Ensure the installed ChromeDriver matches your Chrome browser version
  • No results found: Verify your city names match how they appear in Google Flights
  • Timeout errors: Check your internet connection and try again
  • Script errors: Make sure you have all required dependencies installed

License

This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer

This tool is for personal use only. Please respect website terms of service and avoid excessive requests that may overload flight search services.

About

A comprehensive tool for automated flight searches, comparison and sorting across multiple dates and routes.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0