Skip to content

✈️ Metadata Project to find the TRUTH behind Plane Tickets!

Notifications You must be signed in to change notification settings

NicoHinderling/FlightTracker

Repository files navigation

✈️ FlightTracker ✈️

Backstory

As a college student raised in California but studying in Boston, me having to purchase flight tickets was inevitable. Every time the topic would come up, my mom would warn me, "Buy them early! Their always cheapest several months in advance!" When I was buying a ticket for my recent trip to China, my advisor told me how "tickets are just cheapest a couple days before the flight itself!"

I remember even Googling "Best time to buy a Plane ticket", which informed me that apparently Tuesdays around noon are the weekly sweet spot. Well it's time to DISPELL THE MYTHS!

I will be aggregating data for the next couple of months and plan to publish what I find around late December/early January!

My Current Intentions

Try to see trends in the price fluctuation in respect to:

  • Specific day of week/time of day that correlates to price
  • Best “amount of time left” until flight leaves for price
  • Which Company

Some other possible variables that I may encorporate in the future could be:

  • Region (from which location to which location)
  • Any Difference when considering Round Trip flights
  • (Feel free to suggest any others! 😄 )

Metrics

I have decided to choose four flights the day of May 10th (2016). I imagine this date should yield especially volatile prices, so it should be an interesting base line.

Specific Tickets:

1.) BOS -> LAX (5/10/16)

2.) NYC -> MIA (5/10/16)

3.) NYC -> SAN (5/10/16)

4.) DFW -> SFO (5/10/16)

(UPDATE (January 7th, 2016): Data has begun being aggregated!)

#How to set this up Locally!

Set up our Cassandra Database

1.) Download Cassandra

2.) Untar, put her in /opt/, and set the other directories:

$ tar -zxvf apache-cassandra-2.1.8-bin.tar.gz
$ sudo mv apache-cassandra-2.1.8 /opt/cassandra  
$ sudo mkdir -p /var/log/cassandra
$ sudo mkdir -p /var/lib/cassandra

Note : You may have to change the permissions of these directories. If so, do:

$ sudo chown -R _NAME_ /var/log/cassandra
$ sudo chown -R _NAME_ /var/lib/cassandra

3.) Add her binaries to our path:

$ vim ~/.bashrc
$ export PATH=$PATH:/opt/cassandra/bin (Put this in, and exit vim)
$ . ~/.bashrc

And we're good to go!

To start up the DB, type:

$ cassandra -f

If you have any issues, refer to this!

Clone this Repository

Before we do this, I thought I'd plug Virtual-Burrito! Not necessary, but very convenient for Python projects :)

$ git clone https://github.com/NicoHinderling/FlightTracker.git
$ cd FlightTracker
$ pip install -r requirements.txt
$ mv env_variables_example.py env_variables.py

Now add your origin, destination, date for the flight, and QPX key into the creds file ( If you're unfamilar, here's how to get a Google API key!).

And finally, simply do:

$ python worker.py

and we're runnin', baby!

Sidenote: I'm a cheater and currently use two Google accounts to have two unique QPX API keys. Feel free to follow my footsteps, but otherwise feel free to rip the remains of 'QPX_API_KEY_TWO'. Just beware that QPX delimits you to 50 free calls a day. Just keep in mind that this means if you're doing a call every hour, you'll only be able to aggregate on two different tickets (24 * 2 = 48 aka less than 50).

#License MIT

About

✈️ Metadata Project to find the TRUTH behind Plane Tickets!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published