fast-flights 0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fast_flights-0.1/PKG-INFO +78 -0
- fast_flights-0.1/README.md +61 -0
- fast_flights-0.1/fast_flights/__init__.py +15 -0
- fast_flights-0.1/fast_flights/_generated_enum.py +3315 -0
- fast_flights-0.1/fast_flights/core.py +94 -0
- fast_flights-0.1/fast_flights/filter.py +20 -0
- fast_flights-0.1/fast_flights/flights_impl.py +154 -0
- fast_flights-0.1/fast_flights/flights_pb2.py +37 -0
- fast_flights-0.1/fast_flights/schema.py +22 -0
- fast_flights-0.1/fast_flights.egg-info/.gitignore +1 -0
- fast_flights-0.1/fast_flights.egg-info/PKG-INFO +78 -0
- fast_flights-0.1/fast_flights.egg-info/SOURCES.txt +16 -0
- fast_flights-0.1/fast_flights.egg-info/dependency_links.txt +1 -0
- fast_flights-0.1/fast_flights.egg-info/requires.txt +3 -0
- fast_flights-0.1/fast_flights.egg-info/top_level.txt +1 -0
- fast_flights-0.1/pyproject.toml +34 -0
- fast_flights-0.1/setup.cfg +4 -0
- fast_flights-0.1/setup.py +4 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: fast-flights
|
|
3
|
+
Version: 0.1
|
|
4
|
+
Summary: The fast, robust, strongly-typed Google Flights scraper (API) implemented in Python.
|
|
5
|
+
Author-email: AWeirdDev <aweirdscratcher@gmail.com>
|
|
6
|
+
Project-URL: Homepage, https://github.com/AWeirdScratcher/flights
|
|
7
|
+
Project-URL: Bug Tracker, https://github.com/AWeirdScratcher/flights/issues
|
|
8
|
+
Keywords: flights,google,google-flights,scraper,protobuf,travel,trip,passengers,airport
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Requires-Python: >=3.7
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
Requires-Dist: requests
|
|
15
|
+
Requires-Dist: protobuf
|
|
16
|
+
Requires-Dist: selectolax
|
|
17
|
+
|
|
18
|
+
<div align="center">
|
|
19
|
+
|
|
20
|
+
# flights
|
|
21
|
+
|
|
22
|
+
The fast, robust, strongly-typed Google Flights scraper (API) implemented in Python. Based on Baes64-encoded Protobuf string.
|
|
23
|
+
|
|
24
|
+
```haskell
|
|
25
|
+
$ pip install fast-flights
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
To use `fast-flights`, you'll first create a filter (inherited from `?tfs=`) to perform a request.
|
|
33
|
+
Then, add `flight_data`, `trip`, `seat` and `passengers` info to use the API directly.
|
|
34
|
+
|
|
35
|
+
Honorable mention: I like birds. Yes, I like birds.
|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
from fast_flights import FlightData, Passengers, create_filter, get_flights
|
|
39
|
+
|
|
40
|
+
# Create a new filter
|
|
41
|
+
filter = create_filter(
|
|
42
|
+
flight_data=[
|
|
43
|
+
# Include more if it's not a one-way trip
|
|
44
|
+
FlightData(
|
|
45
|
+
date="2024-07-02",
|
|
46
|
+
from_airport="TPE",
|
|
47
|
+
to_airport="MYJ"
|
|
48
|
+
)
|
|
49
|
+
],
|
|
50
|
+
trip="one-way",
|
|
51
|
+
seat="economy",
|
|
52
|
+
passengers=Passengers(
|
|
53
|
+
adults=2,
|
|
54
|
+
children=1
|
|
55
|
+
),
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
# Get flights from a filter
|
|
59
|
+
result = get_flights(filter)
|
|
60
|
+
|
|
61
|
+
# The price is currently... low/typical/high
|
|
62
|
+
print("The price is currently", result.current_price)
|
|
63
|
+
|
|
64
|
+
# Display the first flight
|
|
65
|
+
print(result.flights[0])
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Additionally, you can use the `Airport` enum to search for airports in code (as you type)!
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
Airport.TAIPEI
|
|
72
|
+
|---------------------------------|
|
|
73
|
+
| TAIPEI_SONGSHAN_AIRPORT |
|
|
74
|
+
| TAPACHULA_INTERNATIONAL_AIRPORT |
|
|
75
|
+
| TAMPA_INTERNATIONAL_AIRPORT |
|
|
76
|
+
| ... 5 more |
|
|
77
|
+
|---------------------------------|
|
|
78
|
+
```
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# flights
|
|
4
|
+
|
|
5
|
+
The fast, robust, strongly-typed Google Flights scraper (API) implemented in Python. Based on Baes64-encoded Protobuf string.
|
|
6
|
+
|
|
7
|
+
```haskell
|
|
8
|
+
$ pip install fast-flights
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
To use `fast-flights`, you'll first create a filter (inherited from `?tfs=`) to perform a request.
|
|
16
|
+
Then, add `flight_data`, `trip`, `seat` and `passengers` info to use the API directly.
|
|
17
|
+
|
|
18
|
+
Honorable mention: I like birds. Yes, I like birds.
|
|
19
|
+
|
|
20
|
+
```python
|
|
21
|
+
from fast_flights import FlightData, Passengers, create_filter, get_flights
|
|
22
|
+
|
|
23
|
+
# Create a new filter
|
|
24
|
+
filter = create_filter(
|
|
25
|
+
flight_data=[
|
|
26
|
+
# Include more if it's not a one-way trip
|
|
27
|
+
FlightData(
|
|
28
|
+
date="2024-07-02",
|
|
29
|
+
from_airport="TPE",
|
|
30
|
+
to_airport="MYJ"
|
|
31
|
+
)
|
|
32
|
+
],
|
|
33
|
+
trip="one-way",
|
|
34
|
+
seat="economy",
|
|
35
|
+
passengers=Passengers(
|
|
36
|
+
adults=2,
|
|
37
|
+
children=1
|
|
38
|
+
),
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
# Get flights from a filter
|
|
42
|
+
result = get_flights(filter)
|
|
43
|
+
|
|
44
|
+
# The price is currently... low/typical/high
|
|
45
|
+
print("The price is currently", result.current_price)
|
|
46
|
+
|
|
47
|
+
# Display the first flight
|
|
48
|
+
print(result.flights[0])
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Additionally, you can use the `Airport` enum to search for airports in code (as you type)!
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
Airport.TAIPEI
|
|
55
|
+
|---------------------------------|
|
|
56
|
+
| TAIPEI_SONGSHAN_AIRPORT |
|
|
57
|
+
| TAPACHULA_INTERNATIONAL_AIRPORT |
|
|
58
|
+
| TAMPA_INTERNATIONAL_AIRPORT |
|
|
59
|
+
| ... 5 more |
|
|
60
|
+
|---------------------------------|
|
|
61
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from .core import get_flights
|
|
2
|
+
from .flights_impl import Airport, TFSData, FlightData, Passengers
|
|
3
|
+
from .schema import Result, Flight
|
|
4
|
+
from .filter import create_filter
|
|
5
|
+
|
|
6
|
+
__all__ = [
|
|
7
|
+
"Airport",
|
|
8
|
+
"TFSData",
|
|
9
|
+
"create_filter",
|
|
10
|
+
"FlightData",
|
|
11
|
+
"Passengers",
|
|
12
|
+
"get_flights",
|
|
13
|
+
"Result",
|
|
14
|
+
"Flight",
|
|
15
|
+
]
|