opensky-cli 0.1.0__py3-none-any.whl

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,231 @@
1
+ Metadata-Version: 2.4
2
+ Name: opensky-cli
3
+ Version: 0.1.0
4
+ Summary: The first agentic flight search engine. Searches hundreds of routes in minutes, not hours.
5
+ Project-URL: Homepage, https://github.com/federicodeponte/opensky
6
+ Project-URL: Repository, https://github.com/federicodeponte/opensky
7
+ Author: Federico De Ponte
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Keywords: cli,flight-search,flights,google-flights,price-comparison,travel
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: End Users/Desktop
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Topic :: Internet
17
+ Requires-Python: >=3.11
18
+ Requires-Dist: airportsdata>=20240101
19
+ Requires-Dist: curl-cffi>=0.7
20
+ Requires-Dist: diskcache>=5.6
21
+ Requires-Dist: httpx>=0.27
22
+ Requires-Dist: pydantic>=2.10
23
+ Requires-Dist: ratelimit>=2.2
24
+ Requires-Dist: rich>=13.0
25
+ Requires-Dist: typer>=0.15
26
+ Description-Content-Type: text/markdown
27
+
28
+ # opensky
29
+
30
+ The first agentic flight search engine. Define your origins, destinations, and dates, and opensky searches every combination for you, in minutes instead of hours.
31
+
32
+ ```
33
+ $ opensky scan --config scan.toml
34
+
35
+ Scanning 6 origins x 6 destinations x 10 dates = 360 combos via google
36
+
37
+ Best per Destination
38
+ Destination Price Date Duration Route
39
+ Amsterdam €289 Tue Mar 17 11h 20m Bangkok → Amsterdam
40
+ Berlin €312 Thu Mar 12 12h 45m Kuala Lumpur → Berlin
41
+ Frankfurt €298 Wed Mar 11 11h 50m Bangkok → Frankfurt
42
+ Hamburg €357 Tue Mar 10 13h 10m Bangalore → Dubai → Hamburg
43
+ Munich €315 Fri Mar 13 12h 30m Delhi → Munich
44
+ Copenhagen €345 Mon Mar 16 13h 10m Singapore → Copenhagen
45
+ ```
46
+
47
+ Doing this manually on Google Flights would take 360 individual searches. opensky does it in one command.
48
+
49
+ ## How it works
50
+
51
+ 1. You define a search space: origins, destinations, date range
52
+ 2. opensky searches every combination across up to three providers (Google Flights, Duffel, Amadeus)
53
+ 3. Results are deduplicated, scored, and presented as a price matrix with the cheapest options highlighted
54
+
55
+ It also works for single route searches:
56
+
57
+ ```bash
58
+ opensky search bangalore hamburg tomorrow
59
+ opensky search BLR HAM next monday
60
+ opensky search BLR HAM mar 15
61
+ ```
62
+
63
+ ## Install
64
+
65
+ Requires Python 3.11+.
66
+
67
+ ```bash
68
+ pip install opensky
69
+ ```
70
+
71
+ Or from source:
72
+
73
+ ```bash
74
+ git clone https://github.com/federicodeponte/opensky.git
75
+ cd opensky
76
+ python -m venv .venv && source .venv/bin/activate
77
+ pip install -e .
78
+ ```
79
+
80
+ Copy `.env.example` to `.env` and fill in any API keys you have (optional, Google Flights works without any keys).
81
+
82
+ ## Quick demo
83
+
84
+ See what opensky does without any API keys or network calls:
85
+
86
+ ```bash
87
+ opensky demo
88
+ ```
89
+
90
+ ![opensky demo](demo.gif)
91
+
92
+ ## Usage
93
+
94
+ ### Multi-route scan (the power feature)
95
+
96
+ Search every combination of origins, destinations, and dates at once.
97
+
98
+ #### Interactive setup
99
+
100
+ ```bash
101
+ opensky config init
102
+ ```
103
+
104
+ ```
105
+ opensky config init
106
+
107
+ Where are you flying from? (comma-separated cities or codes): bangalore, delhi, bangkok
108
+ → BLR (Bangalore), DEL (Delhi), BKK (Bangkok)
109
+ Where to? (comma-separated cities or codes): hamburg, frankfurt, amsterdam
110
+ → HAM (Hamburg), FRA (Frankfurt), AMS (Amsterdam)
111
+ Start date (YYYY-MM-DD): mar 15
112
+ End date (YYYY-MM-DD): mar 25
113
+ Currency [EUR]:
114
+
115
+ Created scan.toml. Next: opensky scan --config scan.toml
116
+ ```
117
+
118
+ Then run:
119
+
120
+ ```bash
121
+ opensky scan --config scan.toml
122
+ ```
123
+
124
+ #### Quick template
125
+
126
+ ```bash
127
+ opensky config init --quick # dumps template, no prompts
128
+ # edit scan.toml with your routes and dates
129
+ opensky scan --config scan.toml
130
+ ```
131
+
132
+ 6 origins x 6 destinations x 10 dates = 360 searches, one command. You get:
133
+ - **Best per destination**: cheapest flight to each city, with date and route
134
+ - **Price matrix**: prices across all dates, cheapest highlighted
135
+ - **Stats**: total flights found, price range
136
+
137
+ ```bash
138
+ opensky scan --config scan.toml --all-flights # show every flight, not just summary
139
+ opensky scan --config scan.toml --workers 5 # parallel workers (default: 3)
140
+ opensky scan --config scan.toml --json -o results.json
141
+ ```
142
+
143
+ Scans are cached. If interrupted, re-run the same command to resume where it left off.
144
+
145
+ #### Scan config
146
+
147
+ ```toml
148
+ [search]
149
+ origins = ["BLR", "DEL", "BOM", "KUL", "BKK", "SIN"]
150
+ destinations = ["HAM", "FRA", "MUC", "BER", "AMS", "CPH"]
151
+ cabin = "economy"
152
+ currency = "EUR"
153
+ stops = "any"
154
+
155
+ [search.date_range]
156
+ start = "2026-03-10"
157
+ end = "2026-03-20"
158
+
159
+ [scoring]
160
+ price_weight = 1.0
161
+ duration_weight = 0.5
162
+
163
+ # Optional: add ground transit time for scoring
164
+ [connections]
165
+ final_destination = "Hamburg"
166
+
167
+ [connections.transit_hours]
168
+ HAM = 0
169
+ BER = 2
170
+ FRA = 4
171
+
172
+ [safety]
173
+ risk_threshold = "high_risk"
174
+ ```
175
+
176
+ ### Single route search
177
+
178
+ Use city names, IATA codes, or friendly dates:
179
+
180
+ ```bash
181
+ opensky search bangalore hamburg tomorrow
182
+ opensky search BLR HAM next monday
183
+ opensky search BLR HAM mar 15 --class business
184
+ opensky search BLR HAM 2026-03-10 --source duffel
185
+ opensky search BLR HAM 2026-03-10 --json
186
+ opensky search BLR HAM 2026-03-10 --fresh
187
+ ```
188
+
189
+ Options:
190
+ - `--class` / `--cabin`: Travel class (economy, premium, business, first)
191
+ - `--stops`: Max stops (nonstop, 1, 2, or any)
192
+ - `--max-price`: Maximum price (0 = no limit)
193
+ - `--fresh` / `--no-cache`: Skip cached results
194
+ - `--source` / `--provider`: Flight data source (google, duffel, amadeus)
195
+ - `--include-risky`: Include flights through conflict zones
196
+ - `--json` / `--csv`: Machine-readable output
197
+ - `--output` / `-o`: Save results to file
198
+ - `--currency` / `-c`: Currency code (EUR, USD, GBP, etc.)
199
+
200
+ ## Providers
201
+
202
+ opensky aggregates results from up to three flight data sources. When multiple providers are configured, results are deduplicated (same flight from two sources keeps the cheapest price).
203
+
204
+ | Provider | Env vars | Notes |
205
+ |----------|----------|-------|
206
+ | Google Flights | none (default) | Scrapes Google Flights. Needs residential IP. |
207
+ | [Duffel](https://duffel.com) | `OPENSKY_DUFFEL_TOKEN` | Free unlimited searches. |
208
+ | [Amadeus](https://developers.amadeus.com) | `OPENSKY_AMADEUS_KEY` + `OPENSKY_AMADEUS_SECRET` | Free tier: 2,000 calls/month. |
209
+
210
+ ## Conflict zones
211
+
212
+ opensky ships with a conflict zone database. By default, flights through high-risk airspace are filtered out. Use `--include-risky` to see all options.
213
+
214
+ ```bash
215
+ opensky zones # list active conflict zones
216
+ opensky zones --update # fetch latest data
217
+ ```
218
+
219
+ ## Limitations
220
+
221
+ - **Residential IP required**: Google Flights blocks datacenter IPs. Use `--proxy` on servers. Duffel and Amadeus work from any IP.
222
+ - **Rate limits**: All providers rate-limited to 10 req/sec. Default scan settings (3 workers, 1s delay) are conservative.
223
+ - **Price accuracy**: Prices may differ from airline websites. Always verify before booking.
224
+
225
+ ## Credits
226
+
227
+ Flight data API based on [fli](https://github.com/punitarani/fli) by Punit Arani (MIT license). Airport metadata from [airportsdata](https://github.com/mborsetti/airportsdata).
228
+
229
+ ## License
230
+
231
+ MIT
@@ -0,0 +1,23 @@
1
+ opensky/__init__.py,sha256=0HDEdjIp7kcUzKERDzmwxelUgXPtz3vmmJglmChyFlo,93
2
+ opensky/__main__.py,sha256=3Z9SSjLTwDx1WdJQ5D5AZv9Yd2NtnVdORrFp6c1IWHY,35
3
+ opensky/airports.py,sha256=FdJ0z2MEx3CqW3lfqM2u695KZMVK3WY4syb89ClvxhM,6087
4
+ opensky/cache.py,sha256=sxPe0xDhOXSist5_LOfBbkpTYdnh8652ls1xVAZ-rmA,1077
5
+ opensky/cli.py,sha256=JEP797hCWznjGSgXtOainRnLScYkJPns3EUxM3riVZY,25993
6
+ opensky/config.py,sha256=yvy-u4I0DCntU49UFDJ1HeYDw15OnghKe8IvjeUc6Js,4250
7
+ opensky/display.py,sha256=ysi5ALyUSTEJJS9B4Fzg6lU6yZxu3BbYatRBoiBBt_I,11307
8
+ opensky/models.py,sha256=jsBvwk2dKVsqXPp3A5iH01UqvBkPIfU_TZwRMeVF6hY,1915
9
+ opensky/safety.py,sha256=85k4T_LpM9RSVXDPMfIOFTtoa9GifmGUlq9zkWTTiOg,4344
10
+ opensky/search.py,sha256=JtWLzVTm8AbAyWGyGDAAEmkrBP7FfTnW4FzlMZJjoSA,9318
11
+ opensky/_vendor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
+ opensky/_vendor/google_flights.py,sha256=ArlVcvgsyzNMIYGdXvXYJpVB603i3qpr8Fo1z1EZfBY,15792
13
+ opensky/data/conflict_zones.json,sha256=wsPLehFktFtdqEGzURrudaxVgm-y1nfVdRfwFE6RNHE,5839
14
+ opensky/data/demo_flights.json,sha256=J3TvIg61CY6s6XZYFNXD85TCSIXJ3aoy1gaOyDGh-xg,55647
15
+ opensky/providers/__init__.py,sha256=doqKF2Lk8kEXBQ9fceQmsjvrgHL1jYL6bgi8dDd20-I,2389
16
+ opensky/providers/amadeus.py,sha256=2S70ZYscWpn4D16AMahVnQJwE2vHoNAlmhJAR2qZ19M,4456
17
+ opensky/providers/duffel.py,sha256=xSR7NWeSYg106JG31fdOCL9jXerLmkhZCeXYKwn2buQ,3655
18
+ opensky/providers/google.py,sha256=ym-Y88mCN1FO7b4CXRzJk87XubQVDqDjX8Rpmd3z7w8,2967
19
+ opensky_cli-0.1.0.dist-info/METADATA,sha256=PeWBbT5trwwob-LV5zYp67F-nLcz8eSK8IPbsvZi9_o,7031
20
+ opensky_cli-0.1.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
21
+ opensky_cli-0.1.0.dist-info/entry_points.txt,sha256=D2fUfXLUPGHLDbvU9la_L2sM1K_T0LtFrKtmokqmRQI,44
22
+ opensky_cli-0.1.0.dist-info/licenses/LICENSE,sha256=Md2RK71FyXmJe4RxcTPGqVWirayGh-6lT5rCgtzbXFo,1074
23
+ opensky_cli-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.29.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ opensky = opensky.cli:app
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Federico De Ponte
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.