Skip to main content

quakefeeds

Python 3 tools for handling USGS earthquake data feeds.

The quakefeeds package provides a class QuakeFeed that captures data from a GeoJSON feed, given a valid severity level and time period. The class provides some shortcuts for accessing data of interest within the feed and provides other useful methods - e.g. one to generate a simple Google map plotting quake locations and magnitudes.

The data feeds and a description of their GeoJSON format are available at http://earthquake.usgs.gov/earthquakes/feed/v1.0/geojson.php.

Examples of Use

>>> from quakefeeds import QuakeFeed
>>> feed = QuakeFeed("4.5", "day")
>>> feed.title
'USGS Magnitude 4.5+ Earthquakes, Past Day'
>>> feed.time
datetime.datetime(2015, 4, 16, 19, 18, 39, tzinfo=datetime.timezone.utc)
>>> len(feed)
6
>>> feed[0]
{'properties': {'cdi': 1, 'tsunami': 0, 'alert': None, ...}
# full JSON data for first event in feed
>>> feed.location(0)
[26.8608, 35.135]
>>> feed.magnitude(0)
6.1
>>> feed.event_title(0)
'M 6.1 - 47km SW of Karpathos, Greece'
>>> feed.depth(0)
20.86
>>> feed.depths
<generator object depths at 0x7fef054b5fc0>
>>> list(feed.depths)
[20.86, 46.35, 76.54, 48.69, 10, 28.64]
>>> map1 = feed.create_google_map()
>>> map2 = feed.create_google_map(style="titled")
>>> feed.write_google_map("map.html", style="titled")

Scripts

The installation process will install some scripts in addition to the quakefeeds package:

  • quakemap, which plots earthquakes on a Google map

  • quakestats, which computes basic statistics for a feed

Dependencies

Installation

Use pip to install the package, its scripts and their dependencies:

pip install quakefeeds

Alternatively, you can install from within the unpacked source distribution:

python setup.py install

(Note that this requires prior installation of setuptools.)

If you don’t want the scripts, copying the quakefeeds directory from the source distribution to somewhere in your PYTHONPATH will suffice.

Metadata

Release files for quakefeeds 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for quakefeeds 0.2
File Size Uploaded Provenance Actions
quakefeeds-0.2.tar.gz 7.1 kB Without provenance Details for quakefeeds-0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for quakefeeds 0.2
File Interpreter ABI Platform Actions
quakefeeds-0.2-py3-none-any.whl Python 3 none any Details for quakefeeds-0.2-py3-none-any.whl

Total release size: 17.3 kB

Release files / quakefeeds-0.2.tar.gz

Download URL quakefeeds-0.2.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
527e9569f8bf68d6801f37ba44920fb5f62ba4a0f120166dec59070a1463c86e
BLAKE2b-256 checksum
How to use checksums
0caf020f6d9b997b6029e632c630eaffa34f4a45e4263450df3e0e0958a7dd24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / quakefeeds-0.2-py3-none-any.whl

Download URL quakefeeds-0.2-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d97d04ea6cbec592cdd649920ddbb8bfbbddca35079289ec78c463d1490b07a
BLAKE2b-256 checksum
How to use checksums
9c499d7199c49e16280b10a33e0c142fc0085f7ed2b172e29cec57d580ee4289
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for quakefeeds 0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page