-
-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Search on Recreation.gov for permits #281
base: main
Are you sure you want to change the base?
Conversation
👏 nice, very exciting. I would love to have this as part of camply. I'm on a long extended trip right now, I won't be home for a couple more weeks before I can take a closer look at this. I'll try to add some questions and comments as I can in the meantime. My first reaction is that everything looks very clean. Excited to dive deeper on this. |
facility_permit_map = { | ||
# Yosemite National Park Wilderness Permits | ||
445859: { | ||
44585904: "Beehive Meadows", | ||
44585907: "Cathedral Lakes", | ||
44585914: "Glen Aulin", | ||
44585915: "Glen Aulin -> Cold Canyon/Waterwheel (pass through)", | ||
44585917: "Happy Isles -> Little Yosemite Valley (No Donohue Pass)", | ||
44585918: "Happy Isles -> Past LYV (Donohue Pass Eligible)", | ||
44585921: "Lyell Canyon (Donohue Pass Eligible)", | ||
44585924: "May Lake", | ||
44585940: "Rafferty Creek -> Vogelsang", | ||
44585945: "Sunrise", | ||
44585956: "Young Lakes via Glen Trail", | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way to rely on the Recreation.gov API for this? Camply has a built-in API key to talk to the RIDB API here: https://ridb.recreation.gov/docs#/Permit%20Entrances/getFacilityPermitEntrances
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible, I don't want to hit every endpoint. It looks like which endpoint to use is actually handled here: https://github.com/changlan/camply/blob/e5425eebd811256d04d7108bd786a439fa11e8fb/camply/providers/recreation_dot_gov/recdotgov_permits.py#L66-L96
It seems like everyone uses the same generic endpoint, unless they show up on this mapping: https://www.recreation.gov/api/permitcontent/permitmapping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the workflow for this seems to be,
- Call the permitmapping API.
- For each facility in the permitmapping result, check if it is a parent facility.
- If it has children, create a subdictionary with its children, and use the facility retrieval API to get each child's name.
- If not, input it in the mapping dictionary with its name as the value.
I think I will take a stab at it.
Description
I took a stab at #82 and #22 to add support for searching on recreation.gov for permits. Similar to campgrounds, there is a 3-level hierarchy for permits: rec-area -> facility -> permit / trails. So I (ab)use the existing cli commands with the following mapping:
Let me know if this is a good idea. I would like to collect some feedback before moving on to adding documentations, etc.
Has This Been Tested?
List facilities in a rec-area
List permits in a rec-area
Search permits
Checklist:
.pre_commit
on all my code