Skip to content

Commit 1ca4783

Browse files
authored
Create airports.md
1 parent 6f5a7fc commit 1ca4783

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

docs/airports.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Airports
2+
3+
To search for an airport, you could use the `search_airports()` API:
4+
5+
```python
6+
airport = search_airports("taipei")[0]
7+
airport
8+
# Airport.TAIPEI_SONGSHAN_AIRPORT
9+
```
10+
11+
If you're unfamiliar with those 3-letter airport codes (such as "MYJ" for Matsuyama, "TPE" for Taipei, "LAX" for Los Angeles, etc.), you could pass in an `Airport` enum to a `FlightData` object:
12+
13+
```python
14+
taipei = search_airports("taipei")[0]
15+
los = search_airports("los angeles")[0]
16+
17+
filter = create_filter(
18+
flight_data=[
19+
FlightData(
20+
date="2025-01-01",
21+
from_airport=taipei,
22+
to_airport=los
23+
)
24+
],
25+
...
26+
)
27+
```
28+
29+
I love airports. Navigating them was like an adventure when I was a kid. I really thought that airports have everything in them, I even drew an entire airport containing (almost) a city at this point... naively.

0 commit comments

Comments
 (0)