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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1ff10ddcc56e3cf2d6b6c32ecc5fcbc39dea680b1a8281e8e3ae8adcaaef1fa |
|
MD5 | 2f6b4b7453c7aaed9127aa0f2796ef62 |
|
BLAKE2b-256 | 4c18fcc6d8f1d27d9a2cd3e3714326174811f909a7257f889d6f9f580e2704f9 |
Close
Hashes for aio_quakeml_ingv_centro_nazionale_terremoti_client-0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 664c537c6d7858fcd8eb94c4e203501ee84aab31185c5a230d434336a85fa3bd |
|
MD5 | 3bbfad2d6951180163607cdad02b24e9 |
|
BLAKE2b-256 | de4707502ebde5a86f9c8fe2044ad46f84a299dd5218fedeed99977392eee468 |