Coder Social home page Coder Social logo

flight-optimizer's Introduction

Flight Optimization app

This is an CLI, API and web application around Kiwi.com API to find best price per kilometer.

Installing CLI

Navigate to backend folder and run:

pip install --editable .

--editable option upgrades package on code change

Key Dependencies

  • Flask is a lightweight backend microservices framework. Flask is required to handle requests and responses.

  • Flask-CORS is the extension we'll use to handle cross origin requests from our frontend server.

  • Click is an package for creating beautiful command line interfaces.

Running the CLI

To run and test the CLI, execute:

flight-optimizer --from <city> --to <city> [<city> ...]

where: --from specifies the departure city --to specifies a list of potential destination cities

Running web app

To run web server, execute:

python3 webapp.py

Endpoints

POST '/prices/minimum'

  • Fetches an object for city with minimum price
  • Request Arguments: flightFrom, flightsTo
  • Returns: An city object.
{
  'id': 'london_gb',
  'name': 'London',
  'location': {'lon': -0.127758, 'lat': 51.507351},
  'distance': 931.5659317961586,
  'price': 44,
  'price_per_km': 0.05
}

Running the frontend

  1. Navigate to backend folder
  2. Install node dependencies:
npm install

to upgrade the code:

npm run build
  1. Open a browser window and navigate to the index.html file

Possible error

Depends on local environment you may want to change port number at RequestManager constructor.

flight-optimizer's People

Contributors

a-yasinsky avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.