Vfd
A small flight price tracking script
Install / Use
/learn @kiinami/VfdREADME
VFD
</h1> </div>VFD is a small service that tracks the price of flights on Google Flights, stores the historical data, allows you to view it in a simple web interface, and sends notifications when there is a new best price.
The project uses the really nice fast-flights library to scrape the data from Google Flights, the Streamlit library to create the web interface, and apprise to send notifications.
[!warning] This project is still in its early stages. There are numerous bugs and general inefficiencies everywhere. There are also a lot of features missing. If you have any suggestions, encounter any bugs or have any comments, feel free to open an issue or a pull request!
Features
- Continuous scraping of flight prices from Google Flights (currently only in dollars)
- Possibility to set a range of dates and cities to depart and arrive from
- Storing of historical data by hour
- Simple web interface to view the data
- Notifications when a new best price is found
Docker installation
Installing the project with Docker is the easiest way to get started. You will need to have Docker and Docker Compose installed on your system.
- Get the
docker-compose.ymlfile from here - Get the
.envfile from here and fill in the necessary information - Run
docker compose up -dto start VFD - Open
http://localhost:4242in your browser to view the web interface (although you won't see much until a few hours' worth of data has been collected)
Local installation
- This project uses uv to manage the virtual environment, so you will need to install it first. Refer to the documentation on how to install it on your system.
- Clone the repository
- Copy the
.env.examplefile to.envand fill in the necessary information - Run
uv syncto install the dependencies and set up the project - To run the scrapper, run
uv run scrapper. You can also runuv run scrapper --helpto see the available options, including the possibility to run the scrapper once instead of continuously. - To run the web interface, run
uv run dashboard
Configuration
The configuration is done through the .env file. Here is a list of the available options:
| Variable | Description | Default | Required |
|-----------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------|----------|
| VFD_DATABASE | The path to the SQLite database file | - | Yes |
| VFD_SCRAPPER_START_DATES | The possible dates to start the trip | - | Yes |
| VFD_SCRAPPER_END_DATES | The possible dates to end the trip | - | Yes |
| VFD_SCRAPPER_END_DATES | The possible dates to end the trip | - | Yes |
| VFD_SCRAPPER_DEPARTURE_AIRPORTS | The possible source airports | - | Yes |
| VFD_SCRAPPER_ARRIVAL_AIRPORTS | The possible destination airports | - | Yes |
| VFD_SCRAPPER_INTERVAL | The interval in seconds between each query | 60 | No |
| VFD_SCRAPPER_NOTIFICATION_URLS | Apprise notification URLs (comma separated) (for more info, check the Apprise documentation) | - | Yes |
| VFD_SCRAPPER_VERBOSE | Whether to print debug information for the scrapper | False | No |
| VFD_DASHBOARD_HOST | The host to run the dashboard on | 0.0.0.0 | No |
| VFD_DASHBOARD_PORT | The port to run the dashboard on | 4242 | No |
To-do
- [x] Dockerize the project with a cron job to run the scrapper regularly
- [x] Job scheduling
- [x]
Dockerfileanddocker-compose.yml - [x] Handling of
.envfile - [x]
.dockerignore - [x] Image building and publishing with GitHub Actions
- [x] Add a small web interface to view the data
- [x] Add a way to send notifications when the price of a flight drops below the last best price
- [x] Stage queries in batches to avoid problems with Google
- [ ] Configurable resolution of the data (currently only by hour)
- [ ] Add support for proxies to avoid being blocked by Google
- [ ] Add authentication support with streamlit-authenticator
- [ ] More granularity in start and end ranges
- [ ] Add support to track different trips at the same time
FAQ
Why this thing?
I want to go on a trip with my friends to a faraway land, the dates are more or less set, we could arrive and depart from a set of cities, and I want to get the cheapest flight combination possible.
I could do this manually, but it would take a great deal of time and effort (96 different combinations to check every day), so I decided to automate it.
What does VFD stand for?
Verifiable Flight Data, of course. What else could VFD stand for?
Contributing
If you have any suggestions, feel free to open an issue or a pull request. The local installation instructions should suffice to get you started.
License
This project is licensed under the MIT License - see the LICENSE file for details.
