amadeus4dev / amadeus-python Goto Github PK
View Code? Open in Web Editor NEWPython library for the Amadeus Self-Service travel APIs
Home Page: https://developers.amadeus.com
License: MIT License
Python library for the Amadeus Self-Service travel APIs
Home Page: https://developers.amadeus.com
License: MIT License
The param names are wrong
Attempting to run code from README (https://github.com/amadeus4dev/amadeus-python) fails
Flight Cheapest Date Search:
amadeus.shopping.flight_dates.get(origin='NYC', destination='MAD')
from amadeus import Client, ResponseError
amadeus = Client(
client_id=AMADEUS_ID,
client_secret=AMADEUS_SECRET
)
try:
response = amadeus.shopping.flight_dates.get(origin='NYC', destination='MAD')
print(response.data)
except ResponseError as error:
print(error)
except Exception as e:
print(e)
To get a response object
HTTP Error 404: Not Found
Right now it is stable, 100% reproducibility.
Python: python2.7
Pip: pip 19.0.1
Please make sure you checked the following:
Are you running Python 2.7 or 3.6? Yes
Did you download the latest version of this package? Yes
APIs using the DELETE method raises a NotFound exception error.
Traceback (most recent call last):
File "/Users/anavarro/src/github.com/alnacle/amadeus-python/flight_order_management.py", line 13, in <module>
raise error
File "/Users/anavarro/src/github.com/alnacle/amadeus-python/flight_order_management.py", line 7, in <module>
response = amadeus.booking.flight_order('eJzTd9cPCjX2Mg8HAAs1Alg%3D').delete()
File "/Users/anavarro/src/github.com/alnacle/amadeus-python/amadeus/booking/_flight_order.py", line 34, in delete
return self.client.delete('/v1/booking/flight-orders/{0}'
File "/Users/anavarro/src/github.com/alnacle/amadeus-python/amadeus/mixins/http.py", line 89, in delete
return self.request('DELETE', path, params)
File "/Users/anavarro/src/github.com/alnacle/amadeus-python/amadeus/mixins/http.py", line 113, in request
return self._unauthenticated_request(
File "/Users/anavarro/src/github.com/alnacle/amadeus-python/amadeus/mixins/http.py", line 129, in _unauthenticated_request
return self.__execute(request)
File "/Users/anavarro/src/github.com/alnacle/amadeus-python/amadeus/mixins/http.py", line 155, in __execute
response._detect_error(self)
File "/Users/anavarro/src/github.com/alnacle/amadeus-python/amadeus/mixins/parser.py", line 16, in _detect_error
self.__raise_error(error, client)
File "/Users/anavarro/src/github.com/alnacle/amadeus-python/amadeus/mixins/parser.py", line 58, in __raise_error
raise error
amadeus.client.errors.NotFoundError: [404]
To increase code coverage
Performing a flight search between SIN and LHR, in the returned results I can see that some of the shortest flight time results are from carrier code "6X" and "7X" which the dictionary claims is 'Amadeus Six' and 'Amadeus Seven".
I am unsure what these airlines refer to, and whether this is only the case for the testing data set.
response = amadeus.shopping.flight_offers_search.get( originLocationCode="SIN", destinationLocationCode="LHR", departureDate="2021-02-01", adults=1)
Expected Behavior:
Carrier codes do not represent fictional airlines.
Actual Behavior:
Carrier codes include "6X" and "7X"
Stable Behavior?
Seems to be.
Mac OS, Python 3.8.
The following document follows the MoSCoW method of prioritising rules. Please follow the following guidelines when evaluating rules.
MUST
- Rules labeled as must are requirements that should not be deviated from at any costSHOULD
- Rules labeled as should are requirements that could be deviated from if needed, though this will have to be documented and cleared with all stakeholders before it can be disregarded.COULD
- Rules labeled as could are requirements that are desirable but not necessary and therefore would be nice to have where time and resources permit.We do not use the fourth won't
level in this specification.
Currently this specification is limited due to various reasons. This means that currently:
master
branchmaster
branch should be kept in a condition that allows for direct use through checkoutCHANGELOG
file must to be updated with the Major
, Minor
and Patch
changesREADME
fileLICENSE
fileCHANGELOG
fileamadeus
, Amadeus
, or amadeus/amadeus
.amadeus-sdk
, AmadeusSDK
, or amadeusdev/amadeus
.amadeus-php
) or a reference to this being an SDK client library (e.g. not amadeus-sdk
)amadeus
, Amadeus
, or amadeus/amadeus
.1.0.0
README
file
README
file should include a version badgeREADME
file should include a test status badgeREADME
file must link to the LICENSE
fileREADME
file should be written in MarkdownREADME
file must have instructions on how to install the SDK using a package managerREADME
file could have instructions on how to install the SDK from version controlREADME
file must have instructions on how to initialise the SDK with the API credentials
amadeus
. For example, amadeus = new Amadeus::Client()
README
file should document all the different ways the SDK can be initializedREADME
file must include a basic sample on how to make a first API callREADME
file must link to the developer portalREADME
file should link to documentation on the developer portalREADME
file must document any installation requirements and prerequisitesREADME
file should to official support channelsREADME
file must document where a developer can find their API credentialsamadeus
, travel
, flights
, hotels
, sdk
, library
CHANGELOG
fileCODE_OF_CONDUCT
fileCONTRIBUTING
file
ISSUE_TEMPLATE
filePULL_REQUEST_TEMPLATE
fileSUPPORT
fileTemplates for a lot of these files have been provided in the templates folder
library_name/library_version language_name/language_version
amadeus-ruby/1.0.0 ruby/2.4.2
library_name/library_version language_name/language_version app_name/app_version
amadeus-ruby/1.0.0 ruby/2.4.2 test_ios_app/1.0.0
amadeus
, com.amadeus.developer
, or Amadeus
package nameAmadeus::Client
in Ruby, or Amadeus\Client
in PHPAMADEUS_CLIENT_ID
and AMADEUS_CLIENT_SECRET
AMADEUS_DEBUG
test
and production
)GET /v1/flights
: amadeus.flights.get
GET /v2/hotels/offers
: amadeus.hotels.offers.get
GET /v1/hotels/123
: amadeus.hotels(123)
GET /v1/hotels/123
: amadeus.hotels.get(123)
GET /v1/hotels/123
: amadeus.hotels.get(id: 123)
GET /v1/hotels/123/hotel-offers
: amadeus.hotels(123).offers
GET /v1/hotels/123/hotel-offers
: amadeus.hotels.get(123).offers
GET /v1/hotels/123/hotel-offers
: amadeus.hotels.get(id: 123).offers
GET /v1/flights/123/legs
: amadeus.flights(123).legs()
(should make 1 API call only)GET /v1/flights/123/legs/345
: amadeus.flights(123).legs(345)
(should make 1 API call only)reference-data
) to a more idiomatic format (e.g. reference_data
or ReferenceData
)amadeus.flights().get()
: GET /v1/flights
amadeus.flights().get({ foo: 123 }
: GET /v1/flights?foo=123
amadeus.flights(123).get()
: GET /v1/flights/123
amadeus.flights().post({ from: "LHR", to: "LAX" })
amadeus.flights().get(params, callback_function)
amadeus.flights().get(params).then(...).catch(...)
ResponseError
for any request that did not result a HTTP 200 or 201 response codeNetworkError
when a transport error occurs (e.g. if the API could not be reached, or unexpected data was returned from the API)AuthenticationError
when incorrect credentials were providedNotFoundError
when the API call returned a 404ClientError
when a generic client error occurs (e.g. incorrect data was sent to the API, basically any 4XXX error)ServerError
if the API returned a 5XX error]ParserError
if the response was JSON but could not be parsedcode
attribute containing the name of the error, e.g. NetworkError
.description
attribute containing the parsed JSON from the API, if the API errored and contained JSON.reference-data
namespace
GET /v2/reference_data/urls/checkin-links
endpoint
amadeus.reference_data.urls.checkin_links.get({ airline: 'BA' })
GET /v2/reference_data/locations
endpoint
amadeus.reference_data.locations.get({ keyword: 'LON' })
GET /v2/reference_data/locations/airports
endpoint
amadeus.reference_data.locations.airports.get({ latitude: '0.0', longitude: '0.0' })
shopping
namespace
GET /v1/shopping/flight-destinations
endpoint
amadeus.shopping.flight_destinations.get({ origin: 'LAX' })
GET /v1/shopping/flight-offers
endpoint
amadeus.shopping.flight_offers.get({ origin: 'LAX', destination: 'LHR', departureDate: '2020-12-01' })
GET /v1/shopping/flight-dates
endpoint
amadeus.shopping.flight_dates.get({ origin: 'LAX', destination: 'LHR' })
travel/analytics
namespace
GET /v1/travel/analytics/fare-searches
endpoint
amadeus.travel.analytics.fare_searches.get({ origin: 'LAX', sourceCountry: 'US', period: 2015 })
GET /v1/travel/analytics/air-traffics
endpoint
amadeus.travel.analytics.air_traffics.get({ origin: 'LAX', period: '2015-07' })
shopping/hotels
namespace
GET /v1/shopping/hotel-offers
endpoint
amadeus.shopping.hotel_offers.get({ cityCode: 'LAX' }
GET /v1/shopping/hotels/:hotel_id/hotel-offers
endpoint
amadeus.shopping.hotels.get(123).hotel_offers.get({ checkInDate: '2018-12-01', checkOutDate: '2018-12-03' })
GET /v1/shopping/hotels/:hotel_id/offers/:offer_id
endpoint
amadeus.shopping.hotels.get(123).hotel_offers.get(345)
result
attribute with the parsed JSON content if the content could be parseddata
attribute with the content from the data key from the result
hash, if it is presentstatusCode
attribute with HTTP status code of the responserequest
attribute with the details of the original request madeparsed
attribute which should be true
when the JSON was successfully parsed.next
, .first
, .last
, .previous
methods on the API client to find the relevant page for a response
let next_response = amadeus.next(response);
locations = amadeus.reference_data.locations.get(keyword: 'lon', subType: Amadeus::Location::Airport)
let locations = amadeus.referenceData.locations.get({ keyword: 'lon', subType: Amadeus.location.airport });
amadeus.foo.bar(origin: locations.data.first['iataCode'])
amadeus.foo.bar({ origin: locations.data.first.iataCode });
amadeus.get('/foo/bar')
W, [2018-02-19T16:06:29.881202 #67814] WARN -- Amadeus AuthenticationError: {
"error": "invalid_client",
"error_description": "Client credentials are invalid",
"code": 38187,
"title": "Invalid parameters"
}
amadeus.client.get('/foo/bar').then(...).catch(...);
Amadeus AuthenticationError { error: 'invalid_client',
error_description: 'Client credentials are invalid',
code: 38187,
title: 'Invalid parameters' }
amadeus.get('/foo/bar')
Amadeus AuthenticationError: {'code': 38187,
'error': 'invalid_client',
'error_description': 'Client credentials are invalid',
'title': 'Invalid parameters'}
amadeus.get('/foo/bar')
W, [2018-02-19T16:06:13.523516 #67786] WARN -- Amadeus NotFoundError: [
{
"code": 38196,
"title": "Resource not found",
"detail": "The targeted resource doesn't exist",
"status": 404
}
]
amadeus.client.get('/foo/bar').then(...).catch(...);
Amadeus NotFoundError [ { code: 38196,
title: 'Resource not found',
detail: 'The targeted resource doesn\'t exist',
status: 404 } ]
amadeus.get('/foo/bar')
Amadeus NotFoundError: [{'code': 38196,
'detail': "The targeted resource doesn't exist",
'status': 404,
'title': 'Resource not found'}]
amadeus.reference_data.locations.get(
subType: Amadeus::Location::ANY
)
W, [2018-02-19T16:05:55.923870 #67772] WARN -- Amadeus ClientError: [
{
"status": 400,
"code": 32171,
"title": "MANDATORY DATA MISSING",
"detail": "Missing mandatory query parameter",
"source": {
"parameter": "keyword"
}
}
]
amadeus.referenceData.locations.get({
keyword: 'lon'
}).then(...).catch(...);
Amadeus ClientError [ { status: 400,
code: 32171,
title: 'MANDATORY DATA MISSING',
detail: 'Missing mandatory query parameter',
source: { parameter: 'subType' } } ]
amadeus.reference_data.locations.get(
subType: Amadeus::Location::ANY
)
Amadeus ClientError: [{'code': 32171,
'detail': 'Missing mandatory query parameter',
'source': {'parameter': 'keyword'},
'status': 400,
'title': 'MANDATORY DATA MISSING'}]
amadeus.get('/something/that/errors/');
W, [2018-02-19T16:07:42.651272 #67846] WARN -- Amadeus ServerError: [
{
"code": 38189,
"title": "Internal error",
"detail": "An internal error occured, please contact your administrator",
"status": 500
}
]
amadeus.get('/something/that/errors/').then(...).catch(...);
Amadeus ServerError [ { code: 38189,
title: 'Internal error',
detail: 'An internal error occured, please contact your administrator',
status: 500 } ]
amadeus.get('/something/that/errors/');
Amadeus ClientError: [{'code': 38189,
"code": 38189,
"title": "Internal error",
"detail": "An internal error occured, please contact your administrator",
"status": 500 }]
amadeus.get('/something/that/errors/');
W, [2018-02-19T16:13:14.374444 #68060] WARN -- Amadeus NetworkError: nil
amadeus.get('/something/that/errors/').then(...).catch(...);
Amadeus NetworkError null
amadeus.get('/something/that/errors/');
Amadeus NetworkError: None
amadeus.get('/something/that/rate/limits/');
W, [2018-02-19T16:07:42.651272 #67846] WARN -- Amadeus ServerError: [
{
code: 38194,
title: 'Too many requests',
detail: 'The network rate limit is exceeded, please try again later',
status: 429
}
]
amadeus.get('/something/that/errors/').then(...).catch(...);
Amadeus ClientError [ { code: 38194,
title: 'Too many requests',
detail: 'The network rate limit is exceeded, please try again later',
status: 429 } ]
amadeus.get('/something/that/rate/limits/');
Amadeus ClientError: [{'code': 38194,
'detail': 'The network rate limit is exceeded, please try again later',
'status': 429,
'title': 'Too many requests'}]
ResponseError contains code, etc. ClientError, and error itself, which is status code, etc. 400 - ClientError
but, in debug mode, i get more detailed error, like this:
Response {'body': '{"errors":[{"status":400,"code":4926,"title":"INVALID DATA ' 'RECEIVED","detail":"This location code is unknown"}]}', 'data': None, 'headers': <http.client.HTTPMessage object at 0x0000018895192640>, 'http_response': <HTTPError 400: 'Bad Request'>, 'parsed': True, 'request': <amadeus.client.request.Request object at 0x0000018895192220>, 'result': {'errors': [{'code': 4926, 'detail': 'This location code is unknown', 'status': 400, 'title': 'INVALID DATA RECEIVED'}]}, 'status_code': 400}
how do i get its code(4926, in the example above) and detail, title, and handle it?
The pagination feature of the Python library returns a 400 error:
https://stackoverflow.com/questions/54054999/pagination-invalid-query-parameter
Request to the /v2/shopping/hotel-offers
fails with 401 error.
client = Client(
client_id='some api key',
client_secret='some api secret'
)
client.shopping.hotel_offers.get(cityCode='LON')
Expected Behavior: I expect normal API call with valid response.
Actual Behavior: amadeus.client.errors.AuthenticationError: [401]
I use python3.9 and latest version of Amadeus client
The main point is the fact that this code snippet works great.
client = Client(
client_id='some api key',
client_secret='some api secret'
)
client.shopping.flight_offers_search.get(originLocationCode='LON', destinationLocationCode='LIS', departureDate='2022-10-04', adults=1)
(Python 2.7)
There's no way to customize the number of results in a request. In amadeus 0.1.2, the parameter number_of_results
was used to limit results in the interest of time (or other).
I'm sure I'd be able to help in either one of these circumstances, whether it be an enhancement or a documentation fix.
request.py line 106:
the body of the post is always dumps
, this means we cannot use a JSON string as the body for a POST request.
We should update this part to be able to manage both
Add Support of Hotel Name Autocomplete API
Trying to test the api for deployment in Django app and receiving the error.
while this same works in Node.
installed the package from pypi
What version of Python/Pip are you running? What Operating System are you on?
MacOs python3.9
Please make sure you checked the following:
Which version of Python are you using?
3.9
Did you download the latest version of this package?
yes
File "/Users//Desktop/code/python/nktecs/nktecs/home/flight_backend.py", line 26, in
res1 = amadeus.shopping.flight_offers_search.get(
File "/Users/manindersingh/Desktop/code/python/nktecs/env/lib/python3.9/site-packages/amadeus/shopping/_flight_offers_search.py", line 32, in get
return self.client.get('/v2/shopping/flight-offers', **params)
File "/Users//Desktop/code/python/nktecs/env/lib/python3.9/site-packages/amadeus/mixins/http.py", line 40, in get
return self.request('GET', path, params)
File "/Users//Desktop/code/python/nktecs/env/lib/python3.9/site-packages/amadeus/mixins/http.py", line 112, in request
self.__access_token()._bearer_token()
File "/Users//Desktop/code/python/nktecs/env/lib/python3.9/site-packages/amadeus/client/access_token.py", line 18, in _bearer_token
return 'Bearer {0}'.format(self.__token())
File "/Users//Desktop/code/python/nktecs/env/lib/python3.9/site-packages/amadeus/client/access_token.py", line 26, in __token
self.__update_access_token()
File "/Users//Desktop/code/python/nktecs/env/lib/python3.9/site-packages/amadeus/client/access_token.py", line 40, in __update_access_token
response = self.__fetch_access_token()
File "/Users//Desktop/code/python/nktecs/env/lib/python3.9/site-packages/amadeus/client/access_token.py", line 45, in __fetch_access_token
return self.client._unauthenticated_request(
File "/Users//Desktop/code/python/nktecs/env/lib/python3.9/site-packages/amadeus/mixins/http.py", line 126, in _unauthenticated_request
return self.__execute(request)
File "/Users//Desktop/code/python/nktecs/env/lib/python3.9/site-packages/amadeus/mixins/http.py", line 152, in __execute
response._detect_error(self)
File "/Users//Desktop/code/python/nktecs/env/lib/python3.9/site-packages/amadeus/mixins/parser.py", line 16, in _detect_error
self.__raise_error(error, client)
File "/Users/*/Desktop/code/python/nktecs/env/lib/python3.9/site-packages/amadeus/mixins/parser.py", line 67, in __raise_error
raise error
amadeus.client.errors.NetworkError: [---]
Add support for SeatMap Display
I wrote a new feature to the SDK to enable querying /v1/shopping/seatmaps. Per the contribution guidelines, I'm submitting an new Issue
Python 3.7.4
Not an issue, sorry, but unable to GET any usable data! Cannot get meaningful data using DFW as the origin airport. For example, cheapest flight date search does not return any data. Non-stop flights are not listed when seeking flights between DFW and DOH or DXB during December 2020.
Ran amadeus.shopping.flight_offers.get(origin='DFW', destination='DOH', departureDate='2020-12-12')
Response had a whole lot of solid data but JSONata exerciser reported:
ERROR IN INPUT DATA: JSON.parse: unexpected non-whitespace character after JSON data at line 2852 column 1 of the JSON data
Had to suspend JSON parsing.
Ran amadeus.shopping.flight_dates.get(origin='DFW', destination='LHR')
Response was Error 500 as noted below.
Struggling to get usable (i.e. practical data with origin as DFW) for testing purposes. Would like to get my code/parsing working in test mode before embarking on production pricing schedule. I understand the challenges in servicing international customers but there should be some elementary filters and sorting to suppress valid but unworkable data (e.g. routing such as DFW->HKG->DOH or DFW->ORD->FRA->AMM->DOH; may be useful in some customers but for introductory testing this subset is highly debatable unless one has extended development time).
All workarounds remain unproductive (cannot call it unsuccessful!):
https://test.api.amadeus.com/v1/shopping/
confirmed the challenges previous two steps.Expected Behavior: Response object containing valid data
Actual Behavior: Error status 500
{
"errors": [
{
"status": 500,
"code": 141,
"title": "SYSTEM ERROR HAS OCCURRED",
"detail": "DATA DOMAIN NOT FOUND FOR REQUEST"
}
]
}
Stable Behavior? 100% for any city pair originating from DFW
Python 3.7
Ubuntu 19.10
Please make sure you checked the following:
Delete operation in Flight Order Management API returns 204 response which contains no body. The response is not properly handled by the SDK raising a ParseError exception.
Using the following code snippet:
try:
response = amadeus.booking.flight_order('foobar').delete()
except ResponseError as error:
raise error
The SDK breaks:
Traceback (most recent call last):
File "/Users/anavarro/src/github.com/alnacle/amadeus-python/flight_order_management.py", line 13, in <module>
raise error
File "/Users/anavarro/src/github.com/alnacle/amadeus-python/flight_order_management.py", line 7, in <module>
response = amadeus.booking.flight_order('eJzTd9cPCjX2Mg8HAAs1Alg%3D').delete()
File "/Users/anavarro/src/github.com/alnacle/amadeus-python/amadeus/booking/_flight_order.py", line 34, in delete
return self.client.delete('/v1/booking/flight-orders/{0}'
File "/Users/anavarro/src/github.com/alnacle/amadeus-python/amadeus/mixins/http.py", line 89, in delete
return self.request('DELETE', path, params)
File "/Users/anavarro/src/github.com/alnacle/amadeus-python/amadeus/mixins/http.py", line 113, in request
return self._unauthenticated_request(
File "/Users/anavarro/src/github.com/alnacle/amadeus-python/amadeus/mixins/http.py", line 129, in _unauthenticated_request
return self.__execute(request)
File "/Users/anavarro/src/github.com/alnacle/amadeus-python/amadeus/mixins/http.py", line 155, in __execute
response._detect_error(self)
File "/Users/anavarro/src/github.com/alnacle/amadeus-python/amadeus/mixins/parser.py", line 16, in _detect_error
self.__raise_error(error, client)
File "/Users/anavarro/src/github.com/alnacle/amadeus-python/amadeus/mixins/parser.py", line 58, in __raise_error
raise error
amadeus.client.errors.ParserError: [204]
Hi @tsolakoua, I am using the Amadues Python SDK to create a flight data dashboard. I was try to use the functions to get most booked and most travelled destinations, but no results are coming after `2018-03'. Can you please look into it?
pip install amadeus
in your terminal2018-03
Expected Behavior: Get the required data till present month
Actual Behavior: Data available only after 2018-03
Stable Behavior? All the time
What version of Python/Pip are you running? What Operating System are you on?
Please make sure you checked the following:
I have been trying to migrate from Flight Low-fare Search to Flight Offers Search.
On running the following block of code from the examples:
try:
'''
Find the cheapest flights from SYD to BKK
'''
response = amadeus.shopping.flight_offers_search.get(originLocationCode='SYD', destinationLocationCode='BKK', departureDate='2020-07-01', adults=1)
# print(response.data)
except ResponseError as error:
raise error
I get:
Traceback (most recent call last):
File "<ipython-input-7-ee2011bb3023>", line 5, in <module>
response = amadeus.shopping.flight_offers_search.get(originLocationCode='SYD', destinationLocationCode='BKK', departureDate='2020-07-01', adults=1)
AttributeError: 'Shopping' object has no attribute 'flight_offers_search'
I have been running the old API, that is to be decommissioned, successfully for almost six months now without any issues. Can someone please help me here with the new API?
I was working on a simple project which required the use of Amadeus API (Flight Offers Search). The given token is active only for 30min.
So a new token is to be generated each time the previous one expires. Amadeus has given an API to generate token using oauth 2.0.
Guide to generate new token
https://developers.amadeus.com/self-service/apis-docs/guides/authorization-262
https://test.api.amadeus.com/v1/security/oauth2/token
) with necessary parameters in bodyclient_id and client_secret are changed
from requests import post
from dotenv import load_dotenv
from os import environ
URL = "https://test.api.amadeus.com/v1/security/oauth2/token"
load_dotenv()
header = {}
header['content-type'] = "application/x-www-form-urlencoded"
r = post(URL,
headers=header,
auth=(environ.get("API_KEY"),environ.get("API_SECRET")),
json={
"grant_type": "client_credentials",
"scope":"user_count"
}
)
response = r.json()
print(response)
However I can generate new token directly in Thunder Client.
Python 3.9.6
Operating System : Windows 10
Hey - noticed that the link in this repository's description (https://developer.amadeus.com
) is invalid - the first part of the url should be developers - https://developers.amadeus.com
. As far as I can tell, the other urls in the readme are correct.
Add the coverage report at CI time + a check to ensure >95% code coverage
Cfdd
AI-Generated Picture was decommissioned and should be removed from the SDK
Hi,
Hope you're doing well
I'm trying to use the amadeus api with Python but i'm getting an error
I followed all the step in the readme file but whenever i run my python script, i get an error 'cannot import name Client'
It's the same for 'ResponseError' too
Traceback (most recent call last):
File "amadeus.py", line 1, in
from amadeus import Client,ResponseError
File "/mnt/c/wamp64/www/python/amadeus.py", line 1, in
from amadeus import Client,ResponseError
ImportError: cannot import name Client
I'm using pip 21.1.2 and Python 3.7 and i'm on Windows 10
Maybe you can help me ?
I don't know what i'm doing wrong.
Thanks in advance
Attempting to run code from documentation ( https://amadeus4dev.github.io/amadeus-python/#shopping-flights ) fails
from amadeus import Client, ResponseError
amadeus = Client(
client_id='<SNIP>',
client_secret='<SNIP>'
)
try:
response = amadeus.shopping.flight_destinations.get(origin='LHR')
print(response.data)
print(response.result)
print(response.body)
print(response)
except ResponseError as error:
print("Error")
print(error)
print(error.code)
Expected Behavior: [What you expect to happen]
Code based on https://amadeus4dev.github.io/amadeus-python/#shopping-flights and readme will work
Actual Behavior: [What actually happens]
Error
[500]
ServerError
Stable Behavior? [What percentage of the time does it reproduce?]
Today it is stable, 100% reproducibility.
(not filled as based on #21 it seems that it will be ignored anyway - if any human is reading this please let me known and I will finish report)
What version of Python/Pip are you running? What Operating System are you on?
Please make sure you checked the following:
Implement the support for the Trip Purpose Prediction API.
The Travel/Most Searched API has been decommissioned but not removed from the SDK
Example here
Is it supported for Enterprise APIs (SOAP, XML,HEADER 4.0 ) ?
I know that it is a bit offtopic here, but I see no better place to report it.
https://developers.amadeus.com/create-account is extremely discouraging and suggests that Amadeus is not following best practices - at least in area of security.
"Your password must not contain more than 10 characters." is a quite absurd error message. Basic password security is that (a) passwords should be hashed, not stored as plaintext (b) passwords should be as long as possible.
__Expected Behavior: no problems
Actual Behavior: "Your password must not contain more than 10 characters."
Stable Behavior? 100%
When running the example given in the Getting Started section, the response status is 200 but an exception is thrown. The user just sees: Error: Status 200 []
Expected Behavior: with python 3.6 you get an array of airline check-in urls
Python 3.5
Please make sure you checked the following:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.