6 releases

new 0.5.2 May 20, 2024
0.5.1 May 18, 2024
0.4.0 May 12, 2024
0.3.3 May 8, 2024

#54 in Geospatial

Download history 83/week @ 2024-04-29 242/week @ 2024-05-06 261/week @ 2024-05-13

586 downloads per month

MIT license

374 lines

Quality Gate Status Coverage Status Crates.io Version Crates.io License docs.rs Stand With Ukraine


Rust async API wrapper (reqwest) & TUI (ratatui) for alerts.in.ua



The Alerts.in.ua API Client is a Rust library that simplifies access to the alerts.in.ua API service. It provides real-time information about air raid alerts and other potential threats.


To install the Alerts.in.ua API Client, run the following command in your terminal:

cargo add ralertsinua-geo


⚠️ Before you can use this library, you need to obtain an API token by submitting an API request form.

Here's an basic example of how to use the library to get a list of active alerts:


use ralertsinua_geo::AlertsInUaGeo;
// Initialize the client
geo_client = AlertsInUaGeo();

/// The API for the AlertsInUaClient
pub trait AlertsInUaGeo: WithBoundingRect + Sync + Send + core::fmt::Debug {
    fn boundary(&self) -> CountryBoundary;
    fn locations(&self) -> [Location; 27];
    fn get_location_by_uid(&self, uid: i32) -> Option<Location>;
    fn get_location_by_name(&self, name: &str) -> Option<Location>;


The Location struct represents a Ukraine's administrative unit lv4

/// Ukraine's administrative unit lv4  - *oblast*
#[derive(Debug, Deserialize, Clone, PartialEq, Serialize)]
pub struct Location {
    /// OSM Relation Id
    pub relation_id: String,
    /// Alerts.in.ua "uid"
    pub location_uid: i32,
    /// "state" or "city" or "special"
    pub location_type: String,
    /// Geometry for boundary (Polygon or MultiPolygon)
    pub geometry: Geometry,
    /// Name in uk
    pub name: String,
    /// Name in en
    pub name_en: String,

    /// And some functions from traits
    fn geometry(&self) -> &Geometry;
    fn boundary(&self) -> &Polygon;
    fn center(&self) -> (f64, f64);
    /// To be used in TUI when , implements `Shape`
    fn draw(&self, painter: &mut Painter);


MIT 2024

*[TUI]: Terminal User Interface


~206K SLoC