Skip to content

Commit d69e98a

Browse files
author
Anthony Roux
committed
Redesign of the Flight Most Searched Destinations API
1 parent beab1d5 commit d69e98a

File tree

11 files changed

+122
-45
lines changed

11 files changed

+122
-45
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
To run the project locally, clone the repository, and then create a virtual environment and install the dependencies.
44
```sh
55
git clone https://github.com/amadeus4dev/amadeus-python.git
6-
cd amadeus-ruby
6+
cd amadeus-python
77
```
88

99
First, ensure you have a version of every Python we support installed. Your versions may differ.

CHANGELOG.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,38 @@
11
Changelog
22
=========
33

4+
2.0.0 - 2018-10-14
5+
--------------------
6+
7+
`Flight Most Searched Destinations <https://developers.amadeus.com/self-service/category/203/api-doc/6>`_: Redesign of the API - Split the previous endpoint in 2 endpoints:
8+
9+
- 1st endpoint to find the most searched destinations
10+
- 2nd endpoint to have more data about a dedicated origin & destination
11+
12+
`Flight Most Booked Destinations <https://developers.amadeus.com/self-service/category/203/api-doc/27>`_:
13+
14+
- Rename origin to originCityCode
15+
16+
`Flight Most Traveled Destinations <https://developers.amadeus.com/self-service/category/203/api-doc/7>`_:
17+
18+
- Rename origin in originCityCode
19+
20+
`Flight Check-in Links <https://developers.amadeus.com/self-service/category/203/api-doc/8>`_:
21+
22+
- Rename airline to airlineCode
23+
24+
`Airport & City Search <https://developers.amadeus.com/self-service/category/203/api-doc/10>`_:
25+
26+
- Remove parameter onlyMajor
27+
28+
`Airport Nearest Relevant <https://developers.amadeus.com/self-service/category/203/api-doc/9>`_:
29+
30+
- Add radius as parameter
31+
32+
`Airline Code Lookup <https://developers.amadeus.com/self-service/category/203/api-doc/26>`_:
33+
34+
- Regroup parameters *IATACode* and *ICAOCode* under the same name *airlineCodes*
35+
436
1.1.0 - 2018-08-01
537
--------------------
638

amadeus/travel/_analytics.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
from amadeus.client.decorator import Decorator
22
from .analytics._air_traffic import AirTraffic
3-
from .analytics._fare_searches import FareSearches
3+
44

55

66
class Analytics(Decorator, object):
77
def __init__(self, client):
88
Decorator.__init__(self, client)
9-
self.fare_searches = FareSearches(client)
109
self.air_traffic = AirTraffic(client)
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
from ._fare_searches import FareSearches
21
from ._air_traffic import AirTraffic
32

43

5-
__all__ = ['FareSearches', 'AirTraffic']
4+
__all__ = ['AirTraffic']

amadeus/travel/analytics/_air_traffic.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from amadeus.client.decorator import Decorator
22
from .air_traffic._traveled import Traveled
33
from .air_traffic._booked import Booked
4+
from .air_traffic._searched import Searched
5+
from .air_traffic._searched_by_destination import SearchedByDestination
46
from .air_traffic._busiest_period import BusiestPeriod
57

68

@@ -9,4 +11,6 @@ def __init__(self, client):
911
Decorator.__init__(self, client)
1012
self.booked = Booked(client)
1113
self.traveled = Traveled(client)
14+
self.searched = Searched(client)
15+
self.searched_by_destination = SearchedByDestination(client)
1216
self.busiest_period = BusiestPeriod(client)

amadeus/travel/analytics/_fare_searches.py

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from ._traveled import Traveled
2+
from ._searched import Searched
3+
from ._searched_by_destination import SearchedByDestination
24
from ._booked import Booked
35
from ._busiest_period import BusiestPeriod
46

57

6-
__all__ = ['Traveled', 'Booked', 'BusiestPeriod']
8+
__all__ = ['Searched', 'SearchedByDestination', 'Traveled', 'Booked', 'BusiestPeriod']
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
from amadeus.client.decorator import Decorator
2+
3+
4+
class Searched(Decorator, object):
5+
def get(self, **params):
6+
'''
7+
Returns a list of air traffic reports, based on number of searches.
8+
9+
.. code-block:: python
10+
11+
amadeus.travel.analytics.air_traffic.searched.get(
12+
originCityCode='MAD',
13+
searchPeriod='2017-08',
14+
marketCountryCode='ES'
15+
)
16+
17+
:param originCityCode: IATA code of the origin city, for
18+
example ``"MAD"`` for Madrid.
19+
:param searchPeriod: period when consumers are traveling
20+
in ``YYYY-MM`` format
21+
:param marketCountryCode: IATA code of the country from which
22+
searches were made - e.g. ``"ES"`` for Spain
23+
24+
25+
:rtype: amadeus.Response
26+
:raises amadeus.ResponseError: if the request could not be completed
27+
'''
28+
return self.client.get('/v1/travel/analytics/air-traffic/searched',
29+
**params)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
from amadeus.client.decorator import Decorator
2+
3+
4+
class SearchedByDestination(Decorator, object):
5+
def get(self, **params):
6+
'''
7+
The Flight Most Searched Destinations API allows to find the number of
8+
estimated searches from an origin and a destination,
9+
within a time period when travelers are performing the searches.
10+
11+
.. code-block:: python
12+
13+
amadeus.travel.analytics.air_traffic.searched_by_destination.get(
14+
originCityCode='MAD',
15+
destinationCityCode='NYC',
16+
marketCountryCode='ES'
17+
searchPeriod='2017-08'
18+
)
19+
20+
:param originCityCode: IATA code of the origin city, for
21+
example ``"MAD"`` for Madrid.
22+
:param destinationCityCode: IATA code of the destination city, for
23+
example ``"NYC"`` for New-York.
24+
:param marketCountryCode: IATA code of the country from which
25+
searches were made - e.g. ``"ES"`` for Spain
26+
:param searchPeriod: period when consumers are traveling
27+
in ``YYYY-MM`` format
28+
29+
:rtype: amadeus.Response
30+
:raises amadeus.ResponseError: if the request could not be completed
31+
'''
32+
return self.client.get('/v1/travel/analytics/air-traffic/searched/by-destination', **params)

amadeus/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version_info = (1, 1, 0)
1+
version_info = (2, 0, 0)
22
version = '.'.join(str(v) for v in version_info)

0 commit comments

Comments
 (0)