Skip to content

Commit 89fec17

Browse files
authored
Merge pull request #217 from amadeus4dev/remove-trip-parser
Decommission trip parser
2 parents c8a9fb3 + e9e2824 commit 89fec17

File tree

11 files changed

+1
-145
lines changed

11 files changed

+1
-145
lines changed

README.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -316,14 +316,6 @@ List of supported endpoints
316316
# Airport Routes
317317
amadeus.airport.direct_destinations.get(departureAirportCode='BLR')
318318
319-
# Trip Parser
320-
# Encode to Base64 your booking confirmation file (.html, .eml, .pdf supported)
321-
response = amadeus.travel.trip_parser.post(amadeus.travel.from_file(path_to_file))
322-
# Alternatively you can use a Base64 encoded content directly
323-
response = amadeus.travel.trip_parser.post(amadeus.travel.from_base64(base64))
324-
# Or you can call the API with the JSON directly
325-
response = amadeus.travel.trip_parser.post(body)
326-
327319
# Travel Recommendations
328320
amadeus.reference_data.recommended_locations.get(cityCodes='PAR', travelerCountryCode='FR')
329321

amadeus/mixins/encoder.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

amadeus/namespaces/_travel.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
from amadeus.client.decorator import Decorator
22
from amadeus.travel._analytics import Analytics
33
from amadeus.travel._predictions import Predictions
4-
from amadeus.travel._trip_parser import TripParser
5-
from amadeus.travel._encoder import from_file, from_base64
64

75

86
class Travel(Decorator, object):
97
def __init__(self, client):
108
Decorator.__init__(self, client)
119
self.analytics = Analytics(client)
1210
self.predictions = Predictions(client)
13-
self.trip_parser = TripParser(client)
14-
15-
@staticmethod
16-
def from_file(file):
17-
return from_file(file)
18-
19-
@staticmethod
20-
def from_base64(base64):
21-
return from_base64(base64)

amadeus/travel/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from ._analytics import Analytics
22
from ._predictions import TripPurpose, FlightDelay
3-
from ._trip_parser import TripParser
43

5-
__all__ = ['Analytics', 'TripPurpose', 'FlightDelay', 'TripParser']
4+
__all__ = ['Analytics', 'TripPurpose', 'FlightDelay']

amadeus/travel/_encoder.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

amadeus/travel/_trip_parser.py

Lines changed: 0 additions & 30 deletions
This file was deleted.

docs/index.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,6 @@ Travel/Predictions
113113
.. autoclass:: amadeus.travel.predictions.FlightDelay
114114
:members: get
115115

116-
Travel/TripParser
117-
================
118-
119-
.. autoclass:: amadeus.travel.TripParser
120-
:members: post
121-
122116
ReferenceData/Locations
123117
=======================
124118

specs/mixins/encoder_specs_file.eml

Lines changed: 0 additions & 1 deletion
This file was deleted.

specs/mixins/test_encoder.py

Lines changed: 0 additions & 31 deletions
This file was deleted.

specs/namespaces/test_namespaces.py

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ def test_expected_paths(client):
5050
assert client.airport.predictions is not None
5151
assert client.airport.predictions.on_time is not None
5252
assert client.airport.direct_destinations is not None
53-
assert client.travel.trip_parser is not None
54-
assert client.travel.from_file is not None
55-
assert client.travel.from_base64 is not None
5653
assert client.booking.flight_orders is not None
5754
assert client.booking.flight_order is not None
5855
assert client.booking.hotel_orders is not None
@@ -298,32 +295,6 @@ def test_shopping_flight_offers_prediction_post(client_setup):
298295
)
299296

300297

301-
def test_travel_trip_parser_post(client_setup):
302-
client_setup.travel.trip_parser.post({'foo': 'bar'})
303-
client_setup.post.assert_called_with(
304-
'/v3/travel/trip-parser', {'foo': 'bar'}
305-
)
306-
307-
308-
def test_travel_trip_parser_post_from_base64(client_setup):
309-
client_setup.travel.trip_parser.post(
310-
client_setup.travel.from_base64('Qm9va2luZwo='))
311-
client_setup.post.assert_called_with(
312-
'/v3/travel/trip-parser',
313-
{'payload': 'Qm9va2luZwo='}
314-
)
315-
316-
317-
def test_travel_trip_parser_post_from_file(client_setup):
318-
file = 'specs/namespaces/trip_parser_test.eml'
319-
client_setup.travel.trip_parser.post(
320-
client_setup.travel.from_file(file))
321-
client_setup.post.assert_called_with(
322-
'/v3/travel/trip-parser',
323-
{'payload': 'Qm9va2luZwo='}
324-
)
325-
326-
327298
def test_shopping_flight_offers_search_post(client_setup):
328299
client_setup.shopping.flight_offers_search.post({'foo': 'bar'})
329300
client_setup.post.assert_called_with(

0 commit comments

Comments
 (0)