Skip to main content

A library to facilitate querying data from recreation.gov

Project description

recgov

Python modules to interface with recreation.gov in order to find suitable availability.

Usage:

In order to use this library, you'll need to sign up for an api account. Enabling developer access is under your account settings page. You can either store the API KEY in your environment variables as RECREATION_GOV_KEY or you can pass it to your _session.get_session calls (much trickier -- not really supported).

To install from the checked out code:

pip install .

To make a link in python to the current code-base:

pip install --editable .

Generalizing the script:

recreation.gov works a little different. It has a promising documented API that provides access to campground details, but it doesn't seem to include any availability data.

Common fields used across the api:

Field Name Description
asset_id The campground overall
name Campsite name (often a number)
org_name Who owns the campsite
loop The loop where you can find the site

The most promising undocumented endpoint is here:

  • Month
    • Gets availability for an entire month.

The response object looks something like this:

{
 "availabilities": {
  "2021-03-01T00:00:00Z": "Available",
  // . . . .
  "2021-03-05T00:00:00Z": "Reserved",
  // . . . .
  "2021-03-12T00:00:00Z": "Not Available",
  // . . . .
  "2021-03-31T00:00:00Z": "Reserved"
 },
 "campsite_id": "7859",
 "campsite_reserve_type": "Site-Specific",
 "campsite_type": "GROUP TENT ONLY AREA NONELECTRIC",
 "capacity_rating": "Single",
 "loop": "DEVILS GARDEN CAMPGROUND",
 "max_num_people": 55,
 "min_num_people": 11,
 "quantities": null,
 "site": "JUNIPER BASIN",
 "type_of_use": "Overnight"
}

MIT License

Copyright (c) [year] [fullname]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Release 0.1.4:

  • Implemented timezone aware datetimes
  • Added a changelog

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

recgov-0.1.4.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

recgov-0.1.4-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file recgov-0.1.4.tar.gz.

File metadata

  • Download URL: recgov-0.1.4.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for recgov-0.1.4.tar.gz
Algorithm Hash digest
SHA256 be93e46122f347cc1f3c38b337a5ac33f62d600c5048d3d1f209bfde881fe07f
MD5 382be9ec3cc7193a0a95f15d76a8b5b5
BLAKE2b-256 077257c6b36c9e4913caf612cae1d862cd6740e7782a6d9c828aeb6907d6e977

See more details on using hashes here.

File details

Details for the file recgov-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: recgov-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for recgov-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 caf2697228b63d4a4a664c2c334a1d8c27de0b34cb5aebb30ae4e27e02513b49
MD5 395db7265ec7326e21b7248ff74dee86
BLAKE2b-256 e2db602866cb8b466988fe4d94bf2adcba8d98cc0b5c18323070dc091c3a5d05

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page