Skip to main content

PyQuakes is a Python wrapper for USGS Earthquake Catalog API that manages data querying and result processing.

Project description

PyQuakes

PyQuakes is a Python wrapper for USGS Earthquake Catalog API that manages data querying and result processing. PyEarthquake also integrates Bing Map API to manage geolocation of events.

Features of PyQuakes

  • Handles the HTTP requests, and the HTTP error. Only needs to focus on setting parameters and data processing.
  • Supports setting the query parameters
  • Supports searching with multiple time periods with easy-to-understand time format.
  • Supports searching with multiple locations with pre-defined location classes.
  • Provides geocoding functionality so that users are able to search the location without finding the coordinates.
  • Supports filtering, sorting and organizing the result.

Getting Started

Follow the instructions of Bing Map to get your own key and copy your Bing Map Key in key.txt file under src foler.

How to use

The EarthquakeQuery class has to be imported to use the API.

Import other classes if you would like to search by time and location or set other parameters.

Example

To use geocode API, please specify the path of the key file first:

EarthquakeQuery.set_geocode_key_path("filepath")

A typical usage to search a collection of results is:

from pyquakes import GeoRectangle, EarthquakeQuery, TimeFrame
import datetime

query = EarthquakeQuery()
query.set_time([TimeFrame(datetime(2010, 1, 1), datetime(2015, 1, 1))])
query.set_max_depth(1.0)
result = query.search()

A typical usage to search a specific earthquake by its event id is:

from pyquakes import EarthquakeQuery

event_id = "usc000lvb5"
result = EarthquakeQuery.search_by_event_id(event_id)

For more examples, please refer to the client folder. Several use cases are contained in the clinet folder with example codes. See the function without original suffix.

Test

Tests are placed in the test folder. Please cd into the folder and run each of the py files for testing.

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

pyquakes-0.0.1.tar.gz (21.8 kB view details)

Uploaded Source

Built Distribution

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

pyquakes-0.0.1-py3-none-any.whl (77.4 kB view details)

Uploaded Python 3

File details

Details for the file pyquakes-0.0.1.tar.gz.

File metadata

  • Download URL: pyquakes-0.0.1.tar.gz
  • Upload date:
  • Size: 21.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.10

File hashes

Hashes for pyquakes-0.0.1.tar.gz
Algorithm Hash digest
SHA256 93cdba2a80a7d82957cf6e51aaa416bdd9eebbd97499e1b75e1fa969679a24fd
MD5 1f564d5e9749e03da7258fd1da859bae
BLAKE2b-256 8604fbd3d959e99567e3e949d5e5d6307da1c57177675971d2dbf839f7d1c4c7

See more details on using hashes here.

File details

Details for the file pyquakes-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pyquakes-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 77.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.10

File hashes

Hashes for pyquakes-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 27ee6d55b084cfef0c8734f82e12b5305a5a4970c88d1575ce2a342e56d7c9a3
MD5 47eecbfec406dea29490f3314bb79028
BLAKE2b-256 834e74b4f96db7d7b69e4d58d14d554be0552975e38e141399ba0d5096a1a205

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