Skip to main content

Python wrapper around ComCat web API

Project description

Table of Contents

Introduction

libcomcat is a project designed to provide a Python equivalent to the ANSS ComCat search API. This includes a Python library that provides various classes and functions wrapping around the ComCat API, and a number of command line programs that use those:

  • findid Find the ID of an event closest to input parameters (time, latitude, longitude). Also can provide the authoritative ID if an event id is provided.
  • getcsv Generate csv or Excel files with basic earthquake information.
  • geteventhist Generate csv or Excel files with a history of product submission for an event.
  • getmags Download all available magnitudes from all sources.
  • getpager Download information that represents the PAGER exposure and loss results.
  • getphases Generate csv or Excel files with phase information.
  • getproduct Download ComCat product contents (shakemap grids, origin quakeml, etc.)

Installation

libcomcat is now installable via pip:

pip install usgs-libcomcat

Uninstalling and Updating

To uninstall:

pip uninstall usgs-libcomcat

To update:

pip install --upgrade usgs-libcomcat

Motivation

libcomcat is a python wrapper for the Comprehensive Catalog (ComCat), which has a web page interface and API. ComCat contains information in Events which contain Products. Products contain Contents in the form of files, maps, etc.

The ComCat interface is very user friendly, but does not support automation. The API supports automation, but limits the number of events that can be returned to 20,000. libcomcat uses the API in a way that allows for:

  • Searches returning more than 20,000 eventsource
  • Automation of product file downloads
  • Extraction of information in product content files

Documentation

Documentation can be found in the docs folder:

Example Jupyter notebooks show how the API can be used to get and manipulate information from ComCat:

Note: The ShakeMap/DYFI Station Pairs Notebook requires a geodetic distance calculation function , which can be installed via: pip install geopy

Getting Help

Any questions about libcomcat can be directed to the primary author:

Mike Hearne mhearne@usgs.gov

Citation

If you wish to cite this work in your own publication, you may use this DOI: https://doi.org/10.5066/P91WN1UQ

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

usgs_libcomcat-2.1.6.tar.gz (957.7 kB view details)

Uploaded Source

Built Distribution

usgs_libcomcat-2.1.6-py3-none-any.whl (975.6 kB view details)

Uploaded Python 3

File details

Details for the file usgs_libcomcat-2.1.6.tar.gz.

File metadata

  • Download URL: usgs_libcomcat-2.1.6.tar.gz
  • Upload date:
  • Size: 957.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.5

File hashes

Hashes for usgs_libcomcat-2.1.6.tar.gz
Algorithm Hash digest
SHA256 162ec87b45d44a53b27e60fabce20ab9671fe067bf6bb467ce8ee2e84a08d5e5
MD5 f37beae0fc0c2383e5e1138f36a0cc78
BLAKE2b-256 d15493536f0b85c16fb282b6f9c6c519b6cbd2a9ee8711e765b0a8e679ec4b7d

See more details on using hashes here.

File details

Details for the file usgs_libcomcat-2.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for usgs_libcomcat-2.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 066df927dc7bfcc8bcc7472afdc9ebdf325ee555faa6f139da2385cdd5682f02
MD5 8e5baadb969109ee5a563b2cbd555b77
BLAKE2b-256 91002f4eb154dd70841b4c3281985f807f485f9fbdcd074aed76360612057b3f

See more details on using hashes here.

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