An async INGV Centro Nazionale Terremoti (Earthquakes) QuakeML client library.
Project description
python-quakeml-ingv-centro-nazionale-terremoti-client
This library provides convenient async access to the INGV Centro Nazionale Terremoti (Earthquakes) QuakeML feeds.
Examples
Retrieve all events from the last 24 hours (default timeframe):
import asyncio
from aiohttp import ClientSession
from aio_quakeml_ingv_centro_nazionale_terremoti_client import IngvCentroNazionaleTerremotiQuakeMLFeed
async def main() -> None:
async with ClientSession() as websession:
# Home Coordinates: Latitude: 43.7, Longitude: 11.2
feed = IngvCentroNazionaleTerremotiQuakeMLFeed(websession,
(43.7, 11.2))
status, entries = await feed.update()
print(status)
if entries:
for entry in entries:
print(f"- ID: {entry.external_id} - Magnitude: {entry.magnitude.mag} - Distance: {entry.distance_to_home:.2f}")
asyncio.get_event_loop().run_until_complete(main())
Retrieve all events from the last 24 hours (default timeframe) and within a radius of 100km around the provided home coordinates:
import asyncio
from aiohttp import ClientSession
from aio_quakeml_ingv_centro_nazionale_terremoti_client import IngvCentroNazionaleTerremotiQuakeMLFeed
async def main() -> None:
async with ClientSession() as websession:
# Home Coordinates: Latitude: 43.7, Longitude: 11.2
# Filter radius: 100 km
feed = IngvCentroNazionaleTerremotiQuakeMLFeed(websession,
(43.7, 11.2),
filter_radius=100)
status, entries = await feed.update()
print(status)
if entries:
for entry in entries:
print(f"- ID: {entry.external_id} - Magnitude: {entry.magnitude.mag} - Distance: {entry.distance_to_home:.2f}")
asyncio.get_event_loop().run_until_complete(main())
Retrieve all events from the last 24 hours (default timeframe), within a radius of 100km around the provided home coordinates, and with a magnitude of 2.0 or higher:
import asyncio
from aiohttp import ClientSession
from aio_quakeml_ingv_centro_nazionale_terremoti_client import IngvCentroNazionaleTerremotiQuakeMLFeed
async def main() -> None:
async with ClientSession() as websession:
# Home Coordinates: Latitude: 43.7, Longitude: 11.2
# Filter radius: 100 km
# Filter minimum magnitude: 2.0
feed = IngvCentroNazionaleTerremotiQuakeMLFeed(websession,
(43.7, 11.2),
filter_radius=100,
filter_minimum_magnitude=2.0)
status, entries = await feed.update()
print(status)
if entries:
for entry in entries:
print(f"- ID: {entry.external_id} - Magnitude: {entry.magnitude.mag} - Distance: {entry.distance_to_home:.2f}")
asyncio.get_event_loop().run_until_complete(main())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for aio_quakeml_ingv_centro_nazionale_terremoti_client-0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 100dc0b233899aff8c696a92c2be8b169811394acb16a9c214b5c9117bf8d488 |
|
MD5 | 3332e0075160554982928cd33783a920 |
|
BLAKE2b-256 | cd7a0a2f417aae338c58d7d27133d1fe2391edb2d609e137071de43a648b5f21 |
Close
Hashes for aio_quakeml_ingv_centro_nazionale_terremoti_client-0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 184b3258799c33406f600e4dba4a773ca8b769d98809d0afa65651e0d1f7ff6b |
|
MD5 | f966937105acb851335dcede44dae456 |
|
BLAKE2b-256 | ccf32a782d61ba39e3a619036093a071d55c19fd01a5ab983acf48b5bc1f885d |