35 releases (7 breaking)

new 0.11.0 Dec 30, 2024
0.9.1 Nov 26, 2024
0.6.18 Nov 27, 2023
0.6.15 Jun 14, 2023
0.4.1 Feb 22, 2021

#168 in Geospatial

Download history 135/week @ 2024-09-14 110/week @ 2024-09-21 175/week @ 2024-09-28 125/week @ 2024-10-05 102/week @ 2024-10-12 100/week @ 2024-10-19 632/week @ 2024-10-26 209/week @ 2024-11-02 176/week @ 2024-11-09 439/week @ 2024-11-16 306/week @ 2024-11-23 162/week @ 2024-11-30 135/week @ 2024-12-07 76/week @ 2024-12-14 30/week @ 2024-12-21 307/week @ 2024-12-28

576 downloads per month
Used in opening-hours

MIT/Apache

64KB
1.5K SLoC

Rust 1.5K SLoC // 0.0% comments Pest 184 SLoC // 0.1% comments

Rust parser for OSM Opening Hours

Parsing component of opening-hours crate.

Usage

Add this to your Cargo.toml:

[dependencies]
opening-hours-syntax = "0"

And then a basic usage would look like that:

use opening_hours_syntax::parse;

// Opens until 18pm during the week and until 12am the week-end.
const OH: &str = "Mo-Fr 10:00-18:00; Sa-Su 10:00-12:00";

fn main() {
    let oh = parse(&OH).unwrap();
    eprintln!("{:?}", oh);
}

Supported features

Logging

The log feature can be enabled to emit warnings the [crate-log] crate.

Dependencies

~4MB
~76K SLoC