Skip to content

Commit

Permalink
Merge pull request #201 from jordan-gillard/patch-1
Browse files Browse the repository at this point in the history
docs: Update python.md to include Location import
  • Loading branch information
tsolakoua authored Nov 29, 2023
2 parents f9ba524 + 8849aaf commit 61697b5
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions docs/developer-tools/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,20 @@ you can install the SDK as a regular Python package.

- Amadeus for Developers API key and API secret: to get one, [create a free developer account](https://developers.amadeus.com/register){:target="\_blank"} and set up your first application in your [Workspace](https://developers.amadeus.com/my-apps){:target="\_blank"}.
- Python version >= 3.8
- [virtualenv](https://virtualenv.pypa.io/en/latest/){:target="\_blank"} when installing packages for your local projects. There are several beneficts of creating isolated environment, but the most interesting one is to avoid conflicts between different versions of the same package.

The tool can be easily installed using `pip`:
First step is to create the environment. Switch to your project repository and type:

```text
pip install virtualenv
python3 -m venv .venv
```

Next step is to create the environment. Switch to your project repository and type:
A new folder `.venv` will be created with everything necessary inside. Let's activate the isolated environment with the following command:

```text
virtualenv venv
source .venv/bin/activate
```

A new folder `venv` will be created with everything necessary inside. Let's activate the isolated environment with the following command:

```text
source venv/bin/activate
```

From now on, all packages installed using `pip` will be located under `venv/lib` and not on your global `/usr/lib` folder.
From now on, all packages installed using `pip` will be located under `.venv/lib` and not in your global `/usr/lib` folder.

Finally, install the Amadeus SDK as follows:

Expand Down Expand Up @@ -61,7 +54,7 @@ This tutorial will guide you through the process of creating a simple Python app
#### Request

```python
from amadeus import Client, ResponseError
from amadeus import Client, Location, ResponseError

amadeus = Client(
client_id='AMADEUS_CLIENT_ID',
Expand All @@ -70,8 +63,9 @@ amadeus = Client(

try:
response = amadeus.reference_data.locations.get(
keyword='LON',
subType=Location.AIRPORT)
keyword='LON',
subType=Location.AIRPORT
)
print(response.data)
except ResponseError as error:
print(error)
Expand Down

0 comments on commit 61697b5

Please sign in to comment.