Skip to content

Commit

Permalink
Merge pull request #217 from amadeus4dev/remove-trip-parser
Browse files Browse the repository at this point in the history
Decommission trip parser
  • Loading branch information
minjikarin authored Oct 1, 2024
2 parents c8a9fb3 + e9e2824 commit 89fec17
Show file tree
Hide file tree
Showing 11 changed files with 1 addition and 145 deletions.
8 changes: 0 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,6 @@ List of supported endpoints
# Airport Routes
amadeus.airport.direct_destinations.get(departureAirportCode='BLR')
# Trip Parser
# Encode to Base64 your booking confirmation file (.html, .eml, .pdf supported)
response = amadeus.travel.trip_parser.post(amadeus.travel.from_file(path_to_file))
# Alternatively you can use a Base64 encoded content directly
response = amadeus.travel.trip_parser.post(amadeus.travel.from_base64(base64))
# Or you can call the API with the JSON directly
response = amadeus.travel.trip_parser.post(body)
# Travel Recommendations
amadeus.reference_data.recommended_locations.get(cityCodes='PAR', travelerCountryCode='FR')
Expand Down
7 changes: 0 additions & 7 deletions amadeus/mixins/encoder.py

This file was deleted.

11 changes: 0 additions & 11 deletions amadeus/namespaces/_travel.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
from amadeus.client.decorator import Decorator
from amadeus.travel._analytics import Analytics
from amadeus.travel._predictions import Predictions
from amadeus.travel._trip_parser import TripParser
from amadeus.travel._encoder import from_file, from_base64


class Travel(Decorator, object):
def __init__(self, client):
Decorator.__init__(self, client)
self.analytics = Analytics(client)
self.predictions = Predictions(client)
self.trip_parser = TripParser(client)

@staticmethod
def from_file(file):
return from_file(file)

@staticmethod
def from_base64(base64):
return from_base64(base64)
3 changes: 1 addition & 2 deletions amadeus/travel/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from ._analytics import Analytics
from ._predictions import TripPurpose, FlightDelay
from ._trip_parser import TripParser

__all__ = ['Analytics', 'TripPurpose', 'FlightDelay', 'TripParser']
__all__ = ['Analytics', 'TripPurpose', 'FlightDelay']
19 changes: 0 additions & 19 deletions amadeus/travel/_encoder.py

This file was deleted.

30 changes: 0 additions & 30 deletions amadeus/travel/_trip_parser.py

This file was deleted.

6 changes: 0 additions & 6 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,6 @@ Travel/Predictions
.. autoclass:: amadeus.travel.predictions.FlightDelay
:members: get

Travel/TripParser
================

.. autoclass:: amadeus.travel.TripParser
:members: post

ReferenceData/Locations
=======================

Expand Down
1 change: 0 additions & 1 deletion specs/mixins/encoder_specs_file.eml

This file was deleted.

31 changes: 0 additions & 31 deletions specs/mixins/test_encoder.py

This file was deleted.

29 changes: 0 additions & 29 deletions specs/namespaces/test_namespaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ def test_expected_paths(client):
assert client.airport.predictions is not None
assert client.airport.predictions.on_time is not None
assert client.airport.direct_destinations is not None
assert client.travel.trip_parser is not None
assert client.travel.from_file is not None
assert client.travel.from_base64 is not None
assert client.booking.flight_orders is not None
assert client.booking.flight_order is not None
assert client.booking.hotel_orders is not None
Expand Down Expand Up @@ -298,32 +295,6 @@ def test_shopping_flight_offers_prediction_post(client_setup):
)


def test_travel_trip_parser_post(client_setup):
client_setup.travel.trip_parser.post({'foo': 'bar'})
client_setup.post.assert_called_with(
'/v3/travel/trip-parser', {'foo': 'bar'}
)


def test_travel_trip_parser_post_from_base64(client_setup):
client_setup.travel.trip_parser.post(
client_setup.travel.from_base64('Qm9va2luZwo='))
client_setup.post.assert_called_with(
'/v3/travel/trip-parser',
{'payload': 'Qm9va2luZwo='}
)


def test_travel_trip_parser_post_from_file(client_setup):
file = 'specs/namespaces/trip_parser_test.eml'
client_setup.travel.trip_parser.post(
client_setup.travel.from_file(file))
client_setup.post.assert_called_with(
'/v3/travel/trip-parser',
{'payload': 'Qm9va2luZwo='}
)


def test_shopping_flight_offers_search_post(client_setup):
client_setup.shopping.flight_offers_search.post({'foo': 'bar'})
client_setup.post.assert_called_with(
Expand Down
1 change: 0 additions & 1 deletion specs/namespaces/trip_parser_test.eml

This file was deleted.

0 comments on commit 89fec17

Please sign in to comment.