feat: add explore() endpoint and CLI command for Google Flights Explore#20
feat: add explore() endpoint and CLI command for Google Flights Explore#20gobeyondpty wants to merge 1 commit into
Conversation
Add swoop.explore() for Google Flights Explore destination discovery via the GetExploreDestinations RPC, with ExploreDestination/ExploreResult models, a `swoop explore` CLI command (table/json/csv/brief), and CSV-injection-safe output. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…escent feat: add explore() destination discovery (supersedes #20) swoop's fourth primitive — explore() / price_explore() / price_explore_all(), the ExploreDestination/ExploreResult models, and the `swoop explore` CLI. Builds on the groundwork from #20 by @gobeyondpty — the captured Explore response fixtures from that PR ship here verbatim. Co-authored-by: Shimon <shimon@gobeyond.pa>
|
Thank you for this, @gobeyondpty — #20 is what put Explore on swoop's map, and it's much appreciated. I've taken the feature further in #28 (just merged, shipping in 0.6.0): the full deals-style filter surface on Your work ships, though — the captured |
Design for swoop's fourth primitive (destination discovery), reshaping PR saraswatayu#20 from first principles after live de-risking: - metadata-only — browser-traced the Explore map's price call; prices are not reliably extractable from GetExploreDestinations, so prices come from composition via a price_explore() bridge - one-way + roundtrip (verified the RPC supports both) - place_id origin form returns the full ~85-destination set vs 24 for IATA - destination_* model aligned with Deal; drop always-null fields - live-canary gate (tests/test_live_contract.py) as the credibility bar - CLI surface matches the shared search/deals/price vocabulary Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
swoop.explore()for Google Flights Explore destination discovery via theGetExploreDestinationsRPC endpoint.ExploreDestinationandExploreResultdataclasses tomodels.py, with frozen API-surface tests.swoop exploreCLI command with table, JSON, CSV, and brief output. CSV output neutralizes spreadsheet formula prefixes, matching the existingformat_price_csvguard._explore.pyinternal module (payload building, nested-list response parsing, origin metadata).Test plan
python -m pytest tests/ -m 'not live'— all passtests/test_explore.pycovers payload building, response parsing, and CLI output for all four formatstests/test_api_surface.pyupdated withexplore,ExploreDestination,ExploreResultpyrightclean onswoop/🤖 Generated with Claude Code