Skip to content

feat: add explore() endpoint and CLI command for Google Flights Explore#20

Closed
gobeyondpty wants to merge 1 commit into
saraswatayu:mainfrom
gobeyondpty:feat/explore
Closed

feat: add explore() endpoint and CLI command for Google Flights Explore#20
gobeyondpty wants to merge 1 commit into
saraswatayu:mainfrom
gobeyondpty:feat/explore

Conversation

@gobeyondpty

Copy link
Copy Markdown
Contributor

Summary

  • Add swoop.explore() for Google Flights Explore destination discovery via the GetExploreDestinations RPC endpoint.
  • Add ExploreDestination and ExploreResult dataclasses to models.py, with frozen API-surface tests.
  • Add a swoop explore CLI command with table, JSON, CSV, and brief output. CSV output neutralizes spreadsheet formula prefixes, matching the existing format_price_csv guard.
  • Add the _explore.py internal module (payload building, nested-list response parsing, origin metadata).

Test plan

  • python -m pytest tests/ -m 'not live' — all pass
  • New tests/test_explore.py covers payload building, response parsing, and CLI output for all four formats
  • tests/test_api_surface.py updated with explore, ExploreDestination, ExploreResult
  • pyright clean on swoop/

🤖 Generated with Claude Code

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>
saraswatayu added a commit that referenced this pull request Jun 3, 2026
…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>
@saraswatayu

Copy link
Copy Markdown
Owner

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 explore() itself, the price_explore() / price_explore_all() pricing bridge, one-way support, CLI table/JSON/CSV/brief output, and a round of session/concurrency hardening. Because #28 is a from-scratch reimplementation rather than a layer on top of this branch, I'm closing #20 in favor of it instead of merging both.

Your work ships, though — the captured GetExploreDestinations response fixtures from this PR are in #28 verbatim, and you're credited as co-author on the merge commit. Thanks again, and (as with #13) please keep them coming.

@saraswatayu saraswatayu closed this Jun 3, 2026
gobeyondpty pushed a commit to gobeyondpty/swoop that referenced this pull request Jun 3, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants