Skip to content

Python/Django application demonstrating the Trip-Purpose Prediction API

License

Notifications You must be signed in to change notification settings

amadeus4dev-examples/amadeus-trip-purpose-django

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project demonstrates how to integrate Amadeus APIs using the Python SDK in a Django application.

In this scenario, the end user submits round-trip information via a form and the Trip Purpose Prediction API is called. This API predicts if a the given journey is for leisure or business purposes.

You can refer to this blog article which goes through the implementation step by step.

How to run the project locally

Clone the repository.

git clone https://github.com/amadeus4dev/amadeus-trip-purpose-django.git
cd amadeus-trip-purpose-django

Next create a virtual environment and install the dependencies.

virtualenv venv
source venv/bin/activate
pip install -r requirements.txt

For authentication add your API key/secret to your environmental variables.

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.

python prediction/manage.py runserver

Finally, open a browser and go to https://127.0.0.1:8000

License

This library is released under the MIT License.

Help

You can find us on StackOverflow or join our developer community on Discord.

About

Python/Django application demonstrating the Trip-Purpose Prediction API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published