Skip to main content

A simple HTTP API that supports lookups of CAIC classic Field Report IDs.

Project description

CAIC Classic ID to New ID Converter (clscidapi)

In the 2021-2022 season, the CAIC website was redesigned. Along with this change, a number of old references to the "classic" CAIC website's Field Reports were broken. This tool attempts to fix that by implementing a lookup service that provides several helpful ways to pivot from a classic Field Report's obs_id to a new CAIC Field Report or a working classic Field Report.

The lookup service is backed by a simple JSON file that was created with the help of caicpy. See the script that helped generate this file in my co-avy-research repo.

Currently the lookup service only supports classic IDs back to 2010. This is a limitation with the data available via the CAIC's new APIs. Further research needs to be done to enumerate older classic IDs. Manually browse to older "classic" Field Reports by adding the classic ID to the end of the URL http://classic.avalanche.state.co.us/caic/obs/obs_report.php?obs_id=.

Eventually this service will be running as a hosted app somewhere - the location is currently TBD.

API Usage

The API has a single endpoint, clscid-lookup.

This endpoint only accepts GET requests and accepts arguments in the form of URL parameters. All URL parameters have a descriptive long name and a single letter short name alias.

The q/query parameter is the only required parameter. The value can either be a single classic ID, or an entire CAIC classic URL that has the ID stored in the obs_id URL parameter.

By default, the endpoint takes the given query parameter, tries to find a corresponding new ID, and returns a JSON object containing the Field Report's new CAIC URL in the data key.

There are several modifications to default behavior that can be controlled via boolean URL parameters:

  • r/redirect: Tells the endpoint to initiate an HTTP redirect to the newly generated URL instead of returning a JSON object.
  • u/url: Tells the endpoint to return a full URL instead of just the new Field Report ID. This is true by defualt and can only be set to false.
  • c/classic: Redirect to or return the CAIC classic Field Report URL instead of the new Field Report URL. This is helpful as older Field Reports do not display fully on the new webpage.

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

clscidapi-0.1.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

clscidapi-0.1.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file clscidapi-0.1.0.tar.gz.

File metadata

  • Download URL: clscidapi-0.1.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for clscidapi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3683a22512373a92b1c22286ce697ba98e96560bee92c1fbd3216778e15a3e9c
MD5 e2ab5193738c3932900d9b362d39ab1f
BLAKE2b-256 bc1fb2e6569714ec1e71697c7fa11e4596951a486b46f9a709dcbb5839477454

See more details on using hashes here.

Provenance

File details

Details for the file clscidapi-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: clscidapi-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for clscidapi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 48b064a22a49c5dc6ff2b47c265216ec42b8b3223536cd082cd20cb3c6b19535
MD5 4eab5fab0dddbdafa9d4f4ae1fb55b98
BLAKE2b-256 3198433b2f7f242c11700ad346fa49b8d11fe5fe6b5c31d41729cb8f73a8ce51

See more details on using hashes here.

Provenance

Supported by

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