Write a python script that parses the example seatmap response (OTA_AirSeatMapRS.xml) and return a JSON object that lists the seats with the next properties:
- Type (Seat, Kitchen, Bathroom, etc)
- Seat id (17A, 18A)
- Seat price
- Cabin class
- Availability
And any other properties you might find interesting or useful.
The output json format is not defined, so feel free to choose whatever you think best represents the information
run:
python3 airseatmap.py
To see the options run
python3 airseatmap.py -h
[
{
"Layout": "AB EF",
"Rows": [
{
"CabinType": "First",
"Seats": [
{
"Summary": {
"AvailableInd": "false",
"SeatNumber": "1A"
}
},
{
"Summary": {
"AvailableInd": "false",
"SeatNumber": "1B"
}
},
...
or to export in a flat format use:
python3 airseatmap.py --flat
{
"CabinType": "First",
"Summary": {
"AvailableInd": "false",
"SeatNumber": "1A"
}
},
{
"CabinType": "First",
"Summary": {
"AvailableInd": "false",
"SeatNumber": "1B"
}
},
...
python3 irseatmap.py --output-file test.json
python airseatmap.py --print
- Pass a list of extra fields to be extract like ColumnNumber, ExitRowInd, PlaneSection, Status
python airseatmap.py --extra-fields BulkheadInd Features
python airseatmap.py --full