This project automates the process of searching for the cheapest flights from various cities, storing flight data, and sending notifications via email and SMS.
The FlightClub project automates the search for flight data from multiple cities, processes flight details, and sends notifications to users through email and SMS. It uses various APIs and libraries like Twilio for SMS, Smtplib for email, and FlightClub UI for the user interface.
- Python: Core programming language for backend processing
- Twilio: For sending SMS notifications
- Stmplib: For sending email notifications
- Flask: For handling user interfaces
- dotenv: For managing environment variables
- json: For storing and handling flight data in JSON format
- Requests: For making API requests
- datetime: For handling date and time manipulation
- Python 3.7 or higher
- A Twilio account for SMS
- A Stmplib account for email
- A .env file for storing sensitive credentials
-
Clone the repository:
git clone https://github.com/MostafaHima/flightclub.git cd flightclub
-
Create a
.env
file in the root directory and add the following variables:TWILIO_ACCOUNT_SID=your_twilio_account_sid TWILIO_AUTH_TOKEN=your_twilio_auth_token SENDGRID_API_KEY=your_sendgrid_api_key EMAIL_PASSWORD=your_email_password SENDER_EMAIL=your_email TO_EMAIL=destination_email
-
Install the required libraries:
pip install -r requirements.txt
-
Set up your environment:
load_dotenv() # This will load the environment variables from the .env file
Once the setup is complete, you can run the project and the UI will allow you to search for flight data and automatically send messages.
-
To start the project:
python main.py
-
The user interface will allow you to:
- Search for flight data
- View flight prices and dates
- Send notifications via email and SMS to users based on the flight details
-
Flight details and user messages are stored and processed in a JSON file, allowing for easy updates and access to the flight information.
The script is designed to:
- Fetch flight data from a predefined list of cities
- Search for the cheapest flights using an external API
- Store flight data in
flight_data.json
- Send notifications to users via SMS or email
- SMS: If a user has a valid phone number, an SMS is sent using Twilio.
- Email: If a user has a valid email, an email is sent via SendGrid.
- Flight Data Search: Searches and stores flight data using an external API.
- Cheapest Flight Search: Finds the cheapest flights and stores the data.
- Notification System: Sends SMS and email notifications to users.
- User Interface: Basic UI for interacting with the flight data.
- Data Handling: Stores flight data in JSON format for easy updates.