flightpowers 0.1.0__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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Matan Rabi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,144 @@
1
+ Metadata-Version: 2.4
2
+ Name: flightpowers
3
+ Version: 0.1.0
4
+ Summary: Official FlightPowers client: live Google Flights, Booking.com, Airbnb and Google Hotels data through your RapidAPI key.
5
+ Author: Matan Rabi
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://flightpowers.com
8
+ Project-URL: Documentation, https://flightpowers.com/docs
9
+ Project-URL: Source, https://github.com/mtnrabi/flightpowers-sdk
10
+ Project-URL: Issues, https://github.com/mtnrabi/flightpowers-sdk/issues
11
+ Keywords: flights,google-flights,hotels,booking,airbnb,google-hotels,travel,rapidapi,api,sdk
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Internet :: WWW/HTTP
23
+ Classifier: Typing :: Typed
24
+ Requires-Python: >=3.9
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Dynamic: license-file
28
+
29
+ # flightpowers (Python)
30
+
31
+ Official client for the FlightPowers APIs: live Google Flights, Booking.com, Airbnb and Google Hotels data as JSON, through your own RapidAPI key.
32
+
33
+ - Python 3.9+, standard library only (no dependencies). Type hints included.
34
+ - Docs: https://flightpowers.com/docs
35
+
36
+ ## Install
37
+
38
+ ```sh
39
+ pip install flightpowers
40
+ ```
41
+
42
+ ## Get a key
43
+
44
+ Subscribe to the listing you need on RapidAPI and copy your key. Every listing has a free BASIC plan, then plans from $10 a month on each RapidAPI listing (see https://flightpowers.com/pricing). One key works on every listing you subscribe to.
45
+
46
+ | Namespace | RapidAPI listing |
47
+ |---|---|
48
+ | `flights` | https://rapidapi.com/mtnrabi/api/google-flights-live-api |
49
+ | `booking` | https://rapidapi.com/mtnrabi/api/booking-live-api |
50
+ | `airbnb` | https://rapidapi.com/mtnrabi/api/airbnb-live-api |
51
+ | `google_hotels` | https://rapidapi.com/mtnrabi/api/google-hotels-live-api |
52
+
53
+ ## Quickstart
54
+
55
+ ### Google Flights
56
+
57
+ ```python
58
+ import os
59
+ from flightpowers import FlightPowers
60
+ fp = FlightPowers(os.environ["RAPIDAPI_KEY"])
61
+ res = fp.flights.oneway(from_airport="JFK", to_airport="LHR", departure_date="2027-01-20")
62
+ print(res.meta.search_status)
63
+ if res.data: # an empty search (search_status "empty") returns []
64
+ print(res.data[0]["price"], res.data[0].get("price_range_in_relation_to_other_periods"))
65
+ ```
66
+
67
+ Round trips (`fp.flights.roundtrip`) come back with both legs paired and one total per row. `oneway_multi_airport` / `roundtrip_multi_airport` take 1 to 4 airports a side in one request.
68
+
69
+ ### Booking.com
70
+
71
+ ```python
72
+ import os
73
+ from flightpowers import FlightPowers
74
+ fp = FlightPowers(os.environ["RAPIDAPI_KEY"])
75
+ res = fp.booking.search(destination="Paris", checkin_date="2027-01-20", checkout_date="2027-01-23")
76
+ for p in res.data["properties"][:3]: print(p["name"], p["price_string"], p.get("review_score"))
77
+ # Also: fp.booking.hotel_by_name, fp.booking.resolve, fp.booking.rooms
78
+ ```
79
+
80
+ ### Airbnb
81
+
82
+ ```python
83
+ import os
84
+ from flightpowers import FlightPowers
85
+ fp = FlightPowers(os.environ["RAPIDAPI_KEY"])
86
+ res = fp.airbnb.search(destination="Lisbon", checkin_date="2027-01-20", checkout_date="2027-01-23", min_bedrooms=2)
87
+ for p in res.data["properties"][:3]: print(p.get("name"), p.get("price_total"), p.get("currency"), p.get("link"))
88
+ # Also: fp.airbnb.details(listing_id=...)
89
+ ```
90
+
91
+ ### Google Hotels
92
+
93
+ ```python
94
+ import os
95
+ from flightpowers import FlightPowers
96
+ fp = FlightPowers(os.environ["RAPIDAPI_KEY"])
97
+ res = fp.google_hotels.rates(hotel_name="Hotel Arts Barcelona", destination="Barcelona", checkin_date="2027-01-20", checkout_date="2027-01-23")
98
+ for s in (res.data["properties"][0]["sites"] if res.data["properties"] else []): print(s.get("site"), s.get("price_total"), s.get("link"))
99
+ # Also: fp.google_hotels.search(destination=..., checkin_date=..., checkout_date=...)
100
+ ```
101
+
102
+ Every method takes the API's own field names as keyword arguments; arguments left at `None` are not sent, so the API applies its defaults. Fields this version does not name yet can be passed as extra keyword arguments.
103
+
104
+ ## Responses
105
+
106
+ Every method returns a `Response` with `data`, `status`, `meta` and `headers`:
107
+
108
+ - `data`: the parsed JSON body.
109
+ - `meta.search_status`: `ok`, `empty`, `partial` or `degraded`, from the `X-Search-Status` header (or the body's `search_status` on Airbnb and Google Hotels). `empty` means the search finished and there is nothing; `degraded` means the search did not finish, so an empty list says nothing about availability.
110
+ - Booking.com sends no search status, so `meta.search_status` is `None` on every Booking method. A Booking search whose page gave no properties answers HTTP 404 (`No properties found...`), which raises `FlightPowersError`; a search where every room is over `budget_per_night` comes back as an empty list.
111
+ - `meta.search_reason`, `meta.search_results`, `meta.search_notes`, `meta.search_fallback`: the other `X-Search-*` headers.
112
+ - `meta.quota`: the RapidAPI `x-ratelimit-*` / `x-plan-*` headers, when present.
113
+
114
+ ## Errors and retries
115
+
116
+ Any non-2xx answer raises `FlightPowersError` with `status`, `search_status`, `search_reason`, `retry` (the API's own flag from the body) and `body`. A request that got no answer has `status` 0.
117
+
118
+ ```python
119
+ from flightpowers import FlightPowersError
120
+ try:
121
+ fp.flights.oneway(from_airport="JFK", to_airport="LHR", departure_date="2027-01-20", strict=True)
122
+ except FlightPowersError as err:
123
+ print(err.status, err.search_status, err.search_reason, err.retry)
124
+ ```
125
+
126
+ Retries are off by default. `FlightPowers(key, max_retries=2)` repeats a request only when it answered HTTP 503 with `"retry": true` in its body, waiting `Retry-After` when sent, else 1 s, then 2 s (each wait capped at 60 s, at most 10 retries). Nothing else is retried: a 429 would spend more quota, and a 4xx needs a fixed request.
127
+
128
+ Options: `timeout` (socket timeout in seconds, default 180: it bounds the connect and each read, not the whole request), `retry_delay` (seconds, default 1), `base_urls` (tests and proxies), `transport` (replace the HTTP layer).
129
+
130
+ ## Usage attribution
131
+
132
+ Each request body carries two extra fields, `_fp_source: "sdk-py"` and `_fp_tool: "<namespace>.<method>"`, so we can count how the SDK is used. The API removes them before it reads your request; they never change a search.
133
+
134
+ ## Docs
135
+
136
+ - Flights: https://flightpowers.com/flights-api and https://flightpowers.com/flights-api/multi-airport
137
+ - Booking.com: https://flightpowers.com/hotels-api and https://flightpowers.com/hotels-api/by-name
138
+ - Airbnb: https://flightpowers.com/hotels-api/airbnb
139
+ - Google Hotels: https://flightpowers.com/hotels-api/google-hotels
140
+ - Full reference: https://flightpowers.com/llms-full.txt
141
+
142
+ ## License
143
+
144
+ MIT
@@ -0,0 +1,116 @@
1
+ # flightpowers (Python)
2
+
3
+ Official client for the FlightPowers APIs: live Google Flights, Booking.com, Airbnb and Google Hotels data as JSON, through your own RapidAPI key.
4
+
5
+ - Python 3.9+, standard library only (no dependencies). Type hints included.
6
+ - Docs: https://flightpowers.com/docs
7
+
8
+ ## Install
9
+
10
+ ```sh
11
+ pip install flightpowers
12
+ ```
13
+
14
+ ## Get a key
15
+
16
+ Subscribe to the listing you need on RapidAPI and copy your key. Every listing has a free BASIC plan, then plans from $10 a month on each RapidAPI listing (see https://flightpowers.com/pricing). One key works on every listing you subscribe to.
17
+
18
+ | Namespace | RapidAPI listing |
19
+ |---|---|
20
+ | `flights` | https://rapidapi.com/mtnrabi/api/google-flights-live-api |
21
+ | `booking` | https://rapidapi.com/mtnrabi/api/booking-live-api |
22
+ | `airbnb` | https://rapidapi.com/mtnrabi/api/airbnb-live-api |
23
+ | `google_hotels` | https://rapidapi.com/mtnrabi/api/google-hotels-live-api |
24
+
25
+ ## Quickstart
26
+
27
+ ### Google Flights
28
+
29
+ ```python
30
+ import os
31
+ from flightpowers import FlightPowers
32
+ fp = FlightPowers(os.environ["RAPIDAPI_KEY"])
33
+ res = fp.flights.oneway(from_airport="JFK", to_airport="LHR", departure_date="2027-01-20")
34
+ print(res.meta.search_status)
35
+ if res.data: # an empty search (search_status "empty") returns []
36
+ print(res.data[0]["price"], res.data[0].get("price_range_in_relation_to_other_periods"))
37
+ ```
38
+
39
+ Round trips (`fp.flights.roundtrip`) come back with both legs paired and one total per row. `oneway_multi_airport` / `roundtrip_multi_airport` take 1 to 4 airports a side in one request.
40
+
41
+ ### Booking.com
42
+
43
+ ```python
44
+ import os
45
+ from flightpowers import FlightPowers
46
+ fp = FlightPowers(os.environ["RAPIDAPI_KEY"])
47
+ res = fp.booking.search(destination="Paris", checkin_date="2027-01-20", checkout_date="2027-01-23")
48
+ for p in res.data["properties"][:3]: print(p["name"], p["price_string"], p.get("review_score"))
49
+ # Also: fp.booking.hotel_by_name, fp.booking.resolve, fp.booking.rooms
50
+ ```
51
+
52
+ ### Airbnb
53
+
54
+ ```python
55
+ import os
56
+ from flightpowers import FlightPowers
57
+ fp = FlightPowers(os.environ["RAPIDAPI_KEY"])
58
+ res = fp.airbnb.search(destination="Lisbon", checkin_date="2027-01-20", checkout_date="2027-01-23", min_bedrooms=2)
59
+ for p in res.data["properties"][:3]: print(p.get("name"), p.get("price_total"), p.get("currency"), p.get("link"))
60
+ # Also: fp.airbnb.details(listing_id=...)
61
+ ```
62
+
63
+ ### Google Hotels
64
+
65
+ ```python
66
+ import os
67
+ from flightpowers import FlightPowers
68
+ fp = FlightPowers(os.environ["RAPIDAPI_KEY"])
69
+ res = fp.google_hotels.rates(hotel_name="Hotel Arts Barcelona", destination="Barcelona", checkin_date="2027-01-20", checkout_date="2027-01-23")
70
+ for s in (res.data["properties"][0]["sites"] if res.data["properties"] else []): print(s.get("site"), s.get("price_total"), s.get("link"))
71
+ # Also: fp.google_hotels.search(destination=..., checkin_date=..., checkout_date=...)
72
+ ```
73
+
74
+ Every method takes the API's own field names as keyword arguments; arguments left at `None` are not sent, so the API applies its defaults. Fields this version does not name yet can be passed as extra keyword arguments.
75
+
76
+ ## Responses
77
+
78
+ Every method returns a `Response` with `data`, `status`, `meta` and `headers`:
79
+
80
+ - `data`: the parsed JSON body.
81
+ - `meta.search_status`: `ok`, `empty`, `partial` or `degraded`, from the `X-Search-Status` header (or the body's `search_status` on Airbnb and Google Hotels). `empty` means the search finished and there is nothing; `degraded` means the search did not finish, so an empty list says nothing about availability.
82
+ - Booking.com sends no search status, so `meta.search_status` is `None` on every Booking method. A Booking search whose page gave no properties answers HTTP 404 (`No properties found...`), which raises `FlightPowersError`; a search where every room is over `budget_per_night` comes back as an empty list.
83
+ - `meta.search_reason`, `meta.search_results`, `meta.search_notes`, `meta.search_fallback`: the other `X-Search-*` headers.
84
+ - `meta.quota`: the RapidAPI `x-ratelimit-*` / `x-plan-*` headers, when present.
85
+
86
+ ## Errors and retries
87
+
88
+ Any non-2xx answer raises `FlightPowersError` with `status`, `search_status`, `search_reason`, `retry` (the API's own flag from the body) and `body`. A request that got no answer has `status` 0.
89
+
90
+ ```python
91
+ from flightpowers import FlightPowersError
92
+ try:
93
+ fp.flights.oneway(from_airport="JFK", to_airport="LHR", departure_date="2027-01-20", strict=True)
94
+ except FlightPowersError as err:
95
+ print(err.status, err.search_status, err.search_reason, err.retry)
96
+ ```
97
+
98
+ Retries are off by default. `FlightPowers(key, max_retries=2)` repeats a request only when it answered HTTP 503 with `"retry": true` in its body, waiting `Retry-After` when sent, else 1 s, then 2 s (each wait capped at 60 s, at most 10 retries). Nothing else is retried: a 429 would spend more quota, and a 4xx needs a fixed request.
99
+
100
+ Options: `timeout` (socket timeout in seconds, default 180: it bounds the connect and each read, not the whole request), `retry_delay` (seconds, default 1), `base_urls` (tests and proxies), `transport` (replace the HTTP layer).
101
+
102
+ ## Usage attribution
103
+
104
+ Each request body carries two extra fields, `_fp_source: "sdk-py"` and `_fp_tool: "<namespace>.<method>"`, so we can count how the SDK is used. The API removes them before it reads your request; they never change a search.
105
+
106
+ ## Docs
107
+
108
+ - Flights: https://flightpowers.com/flights-api and https://flightpowers.com/flights-api/multi-airport
109
+ - Booking.com: https://flightpowers.com/hotels-api and https://flightpowers.com/hotels-api/by-name
110
+ - Airbnb: https://flightpowers.com/hotels-api/airbnb
111
+ - Google Hotels: https://flightpowers.com/hotels-api/google-hotels
112
+ - Full reference: https://flightpowers.com/llms-full.txt
113
+
114
+ ## License
115
+
116
+ MIT
@@ -0,0 +1,44 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "flightpowers"
7
+ dynamic = ["version"]
8
+ description = "Official FlightPowers client: live Google Flights, Booking.com, Airbnb and Google Hotels data through your RapidAPI key."
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [{ name = "Matan Rabi" }]
14
+ keywords = ["flights", "google-flights", "hotels", "booking", "airbnb", "google-hotels", "travel", "rapidapi", "api", "sdk"]
15
+ classifiers = [
16
+ "Development Status :: 4 - Beta",
17
+ "Intended Audience :: Developers",
18
+ "Operating System :: OS Independent",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3 :: Only",
21
+ "Programming Language :: Python :: 3.9",
22
+ "Programming Language :: Python :: 3.10",
23
+ "Programming Language :: Python :: 3.11",
24
+ "Programming Language :: Python :: 3.12",
25
+ "Programming Language :: Python :: 3.13",
26
+ "Topic :: Internet :: WWW/HTTP",
27
+ "Typing :: Typed",
28
+ ]
29
+ dependencies = []
30
+
31
+ [project.urls]
32
+ Homepage = "https://flightpowers.com"
33
+ Documentation = "https://flightpowers.com/docs"
34
+ Source = "https://github.com/mtnrabi/flightpowers-sdk"
35
+ Issues = "https://github.com/mtnrabi/flightpowers-sdk/issues"
36
+
37
+ [tool.setuptools.dynamic]
38
+ version = { attr = "flightpowers._client.VERSION" }
39
+
40
+ [tool.setuptools.packages.find]
41
+ where = ["src"]
42
+
43
+ [tool.setuptools.package-data]
44
+ flightpowers = ["py.typed"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,23 @@
1
+ """Official FlightPowers client: live Google Flights, Booking.com, Airbnb and Google Hotels data.
2
+
3
+ >>> from flightpowers import FlightPowers
4
+ >>> fp = FlightPowers(rapidapi_key="...")
5
+ >>> res = fp.flights.oneway(from_airport="JFK", to_airport="LHR", departure_date="2027-01-20")
6
+ """
7
+
8
+ from ._client import BOOKING_FILTERS, HOSTS, SOURCE_TAG, VERSION, FlightPowers, Response, ResponseMeta
9
+ from ._errors import FlightPowersError
10
+
11
+ __version__ = VERSION
12
+
13
+ __all__ = [
14
+ "BOOKING_FILTERS",
15
+ "FlightPowers",
16
+ "FlightPowersError",
17
+ "Response",
18
+ "ResponseMeta",
19
+ "HOSTS",
20
+ "SOURCE_TAG",
21
+ "VERSION",
22
+ "__version__",
23
+ ]