Add geo-based campsite search and campsite-type exclusion#414
Open
winfij wants to merge 15 commits into
Open
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…seDirect providers
…mpsites command Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Wraps provider.refresh_metadata() in try/except in _build_usedirect_search so that providers returning empty or malformed HTTP responses (JSONDecodeError) are logged as warnings and skipped rather than crashing the entire geo search. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…omma list support - AvailableCampsite gains distance_miles field (optional, None for non-geo searches) - SearchGeo builds facility_id→distance map during provider fan-out and annotates each result in get_all_campsites() via pydantic .copy() - RecreationDotGov CampgroundFacility now captures FacilityLatitude/Longitude from RIDB API response so geo distances can be computed for recdotgov campgrounds - _log_availabilities appends "(X.X mi)" to each campground line when distance is set - exclude-type filter now also checks facility_name so --exclude-type horse removes campgrounds named "Horse Camp" (not just campsites typed HORSE) - --exclude-type accepts comma-separated values: --exclude-type group,horse Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
EmailNotifications.__init__ now catches SMTPException and raises CamplyError with a user-friendly message. CamplyError is now caught at the CLI top level and logged cleanly (no traceback) before exiting with code 1. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds geo-based campsite search and campsite-type exclusion to camply.
--near/--latitude/--longitude/--radiusCLI flags on thecampsitescommand and matching YAML config fields, backed by a newSearchGeomulti-provider orchestrator using Nominatim geocoding (geopy) and haversine distance.excluded_campsite_types(YAML) /--exclude-type(CLI) filtering inBaseCampingSearch, with comma-separated list support.RecreationArea/CampgroundFacilitycoordinates in UseDirect providers; allowRecreationDotGov.find_campgroundsto accept geo lat/lon/radius kwargs.Fixes
list_campsite_unitsonSearchGeoto satisfy the abstract method.CamplyErrorf-string in the usedirect provider.Test Plan
tests/utils/test_geo_utils.py,tests/search_providers/test_geo_search.py,tests/cli/test_campsites.py.pytestpasses.camply campsites --near "..." --radius 50.