40 releases (4 stable)

new 1.0.3 Feb 7, 2025
0.11.1 Feb 2, 2025
0.11.0 Dec 30, 2024
0.9.1 Nov 26, 2024
0.4.1 Feb 22, 2021

#152 in Geospatial

Download history 99/week @ 2024-10-18 576/week @ 2024-10-25 236/week @ 2024-11-01 168/week @ 2024-11-08 443/week @ 2024-11-15 318/week @ 2024-11-22 156/week @ 2024-11-29 151/week @ 2024-12-06 82/week @ 2024-12-13 31/week @ 2024-12-20 329/week @ 2024-12-27 124/week @ 2025-01-03 102/week @ 2025-01-10 110/week @ 2025-01-17 123/week @ 2025-01-24 680/week @ 2025-01-31

1,023 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
~78K SLoC