Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aio-quakeml-ingv-centro-nazionale-terremoti-client

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aio-quakeml-ingv-centro-nazionale-terremoti-client

An async INGV Centro Nazionale Terremoti (Earthquakes) QuakeML client library.

  • 0.4
  • PyPI
  • Socket score

Maintainers
1

python-quakeml-ingv-centro-nazionale-terremoti-client

Build Status codecov PyPi Version

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())

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc