https://github.com/amadeus4dev-examples/amadeus-smart-flight-search-django
Python/Django application comparing the Amadeus Self-Service Flight Offers Search with the Flight Choice Prediction APIs
https://github.com/amadeus4dev-examples/amadeus-smart-flight-search-django
amadeus amadeus-api demo django example flight prototype
Last synced: 5 months ago
JSON representation
Python/Django application comparing the Amadeus Self-Service Flight Offers Search with the Flight Choice Prediction APIs
- Host: GitHub
- URL: https://github.com/amadeus4dev-examples/amadeus-smart-flight-search-django
- Owner: amadeus4dev-examples
- License: mit
- Created: 2019-11-14T17:10:00.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-04-22T09:55:41.000Z (about 2 years ago)
- Last Synced: 2024-04-22T11:01:43.704Z (about 2 years ago)
- Topics: amadeus, amadeus-api, demo, django, example, flight, prototype
- Language: Python
- Homepage: https://amadeus4dev-smart-flightsearch.herokuapp.com/
- Size: 56.6 KB
- Stars: 16
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AI Prediction APIs showcase
## What is this?
This prototype shows how the Air APIs can be integrated with `Django` framework, by calling the [Flight Choice Prediction](https://developers.amadeus.com/self-service/category/air/api-doc/flight-choice-prediction) and [Trip Purpose Prediction](https://developers.amadeus.com/self-service/category/trip/api-doc/trip-purpose-prediction).
We also call the [Flight Offers Search](https://developers.amadeus.com/self-service/category/air/api-doc/flight-offers-search) as a more traditional method of flight search and we compare its results with the Flight Choice Prediction ones to show the power of AI.
We also wrote a [blog article](https://developers.amadeus.com/blog/how-ai-can-help-you-find-the-perfect-flight) as a tutorial.
## How to run the project via Docker (recommended)
Build the image from the Dockerfile. The following command will
```sh
make
```
The container receives your API key/secret from the environment variables.
Before running the container, make sure your have your credentials correctly
set:
```sh
export AMADEUS_CLIENT_ID=YOUR_API_KEY
export AMADEUS_CLIENT_SECRET=YOUR_API_SECRET
export DEBUG_VALUE="True"
```
Finally, start the container from the image:
```
make run
```
At this point you can open a browser and go to `https://0.0.0.0:8000`.
Note that it is also possible to run in detached mode so your terminal is still
usable:
```
make start
```
Stop the container with:
```
make stop
```
## How to run the project locally
Clone the repository.
```sh
git clone https://github.com/amadeus4dev/amadeus-smart-flight-search-django.git
cd amadeus-smart-flight-search-django
```
Next create a virtual environment and install the dependencies.
```sh
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
```
For authentication add your API key/secret to your environmental variables.
```sh
export AMADEUS_CLIENT_ID=YOUR_API_KEY
export AMADEUS_CLIENT_SECRET=YOUR_API_SECRET
```
You can easily switch between `test` and `production` environments by setting:
```
export AMADEUS_HOSTNAME="test" # an empty value will also set the environment to test
```
or
```
export AMADEUS_HOSTNAME="production"
```
> Each environment has different API keys. Do not forget to update them!
Finally, run the Django server.
```sh
python amadeus_demo_api/manage.py runserver
```
Finally, open a browser and go to `http://127.0.0.1:8000/`
## License
This library is released under the [MIT License](LICENSE).
## Help
You can find us on [StackOverflow](https://stackoverflow.com/questions/tagged/amadeus) or join our developer community on
[Discord](https://discord.gg/cVrFBqx).