{"id":17826439,"url":"https://github.com/nexxus-vi/ingv_quake","last_synced_at":"2025-10-08T18:18:01.231Z","repository":{"id":166504130,"uuid":"641991542","full_name":"nexxus-vi/ingv_quake","owner":"nexxus-vi","description":"Ruby gem that simplifies access to earthquake event data from the INGV's fdsnws-event API!","archived":false,"fork":false,"pushed_at":"2023-05-17T15:49:23.000Z","size":43,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T13:18:06.962Z","etag":null,"topics":["earthquakes","fsdn","ingv","quakeml","ruby","ruby-gem","ruby-on-rails","seismic-data","seismology"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/ingv_quake","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nexxus-vi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-05-17T15:27:41.000Z","updated_at":"2023-05-23T23:07:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"e1f9ecfd-ffb0-48ce-b619-51c5ded0257b","html_url":"https://github.com/nexxus-vi/ingv_quake","commit_stats":{"total_commits":33,"total_committers":1,"mean_commits":33.0,"dds":0.0,"last_synced_commit":"abd194d80b88722b6ff29a5f22fcab5280af92d7"},"previous_names":["nexxus-vi/ingv_quake"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexxus-vi%2Fingv_quake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexxus-vi%2Fingv_quake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexxus-vi%2Fingv_quake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexxus-vi%2Fingv_quake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nexxus-vi","download_url":"https://codeload.github.com/nexxus-vi/ingv_quake/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243955750,"owners_count":20374373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["earthquakes","fsdn","ingv","quakeml","ruby","ruby-gem","ruby-on-rails","seismic-data","seismology"],"created_at":"2024-10-27T18:47:56.426Z","updated_at":"2025-10-08T18:17:56.190Z","avatar_url":"https://github.com/nexxus-vi.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IngvQuake\n\n### 🫨 Get details about Earthquake events.\n\nThis gem is a wrapper around the [fdsnws-event api](https://webservices.ingv.it/swagger-ui/dist/?url=https://ingv.github.io/openapi/fdsnws/event/0.0.1/event.yaml#) provided by the [INGV](https://www.ingv.it/) with some additions to improve the inspection of events and their data.\n\n[![Gem](https://img.shields.io/gem/v/ingv_quake?color=blue\u0026label=gem%20version\u0026logo=rubygems)](https://rubygems.org/gems/ingv_quake)\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/nexxus-vi/ingv_quake/ci.yml?label=rspec\u0026logo=github)](https://github.com/nexxus-vi/ingv_quake/actions/workflows/ci.yml)\n[![Coveralls](https://img.shields.io/coverallsCoverage/github/nexxus-vi/ingv_quake?logo=coveralls)](https://coveralls.io/github/nexxus-vi/ingv_quake?branch=master)\n[![Rubydoc](https://img.shields.io/badge/doc-rubydoc.info-informational?logo=readthedocs)](https://rubydoc.info/gems/ingv_quake)\n\n### ⚠ Requirements\n- Ruby 2.6+\n\n## ⚙️ Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'ingv_quake'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install ingv_quake\n\n## 📝 Usage\n\n- #### Initialize the Client\n\nCreate a new instance of the `IngvQuake::Client` class to interact with the INGV Earthquake web services API:\n\n```ruby\nclient = IngvQuake::Client.new\n```\n\nYou can also provide your preferred adapter for the underlying Faraday connection:\n\n```ruby\nclient = IngvQuake::Client.new(adapter: httpx)\n```\nA curated list of supported adapters can be found in the [awesome-faraday](https://github.com/lostisland/awesome-faraday#adapters) repo\n\n- #### Get Events Data\n\nUse the get_events method to initialize an EventResource and then fetch earthquake events from the API:\n\n```ruby\nevents = client.get_events\nevents.within_last_hour\n```\n\n#### The Ingv api can return 2 kinds of response format: `text` or `xml` (default).\n\n- #### Text response\n\n  The `text` response is a simplified representation of an event, containing basic information:\n  \n  ```\n  #EventID|Time|Latitude|Longitude|Depth/Km|Author|Catalog|Contributor|ContributorID|MagType|Magnitude|MagAuthor|EventLocationName|EventType\n  34726341|2023-04-19T14:50:48.640000|43.8972|11.9382|14.1|SURVEY-INGV||||ML|0.9|--|5 km NW Bagno di Romagna (FC)|earthquake\n  ```\n  This response is parsed as a [`BasicInfoEvent`](https://rubydoc.info/gems/ingv_quake/IngvQuake/BasicInfoEvent)\n\n- #### Xml response\n\n  The `xml` response has all the information about an event.\n  [Here an example](https://webservices.ingv.it/fdsnws/event/1/query?starttime=2023-04-25T00:00:00\u0026endtime=2023-05-01T23:59:59\u0026limit=5).\n\n  This response is parsed as a [`FullInfoEvent`](https://rubydoc.info/gems/ingv_quake/IngvQuake/FullInfoEvent)\n\nYou can choose which level of information to get by passing or omitting the `format: 'text'` param when querying for events.\n\n### 🧐 Query Events with Filters\n\nThe EventResource class provides several methods for querying events with specific filters. Some examples:\n\n#### 📆 By date range:\n```ruby\nevents.between_dates(starttime: '2023-05-08', endtime: DateTime.now)\n```\n\n#### 🎚️ By magnitude range:\n```ruby\nevents.between_magnitude(minmag: 3.5, maxmag: 6.0)\n```\n\n#### ⌚️ Within the last hour:\n```ruby\nevents.within_last_hour\n```\n\n#### ☝🏼 Custom Query\nUse the `where` method to create a custom query with specific parameters:\n\n```ruby\nevents.where(starttime: '2023-04-25', endtime: '2023-05-01', minmag: 4.5, maxmag: 6.0)\n\nevents.where(address: 'Roma, Via Condotti', maxradiuskm: 400, maxmag: 6.0)\n```\n\n\u003cb\u003eNote\u003c/b\u003e: the `address` param is an addition of the `ingv_quake` gem, you won't find it in the original api specifications.\nUnder the hood the string address is transformed into `lat` and `long` params by the [geocoder](https://github.com/alexreisner/geocoder) gem.\n\n### ShakeMap\n\nShakeMap attributes are images that provides near-time maps of ground shaking for Magnitude \u003e= 3.0 earthquakes in Italy and neighbouring areas.\nAn example of intensity shake map is this:\n\n\u003cp class='img'\u003e\n  \u003cimg src=\"http://shakemap.rm.ingv.it/shake4/data/31299001/current/products/intensity.jpg\" alt=“intensity map” width=\"600\" height=\"800\"\u003e\n\u003c/p\u003e\n\n### For a full list of methods and params, take a look at the [full documentation](https://rubydoc.info/gems/ingv_quake/IngvQuake/EventResource)\n\n## 🛟 Contributing\n\nBug reports and pull requests are welcome on [GitHub](https://github.com/nexxus-vi/ingv_quake/issues).\n\n## 📃 License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnexxus-vi%2Fingv_quake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnexxus-vi%2Fingv_quake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnexxus-vi%2Fingv_quake/lists"}