43 releases (7 stable)

new 1.1.2 Mar 14, 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

#177 in Geospatial

Download history 306/week @ 2024-11-20 206/week @ 2024-11-27 138/week @ 2024-12-04 101/week @ 2024-12-11 78/week @ 2024-12-18 293/week @ 2024-12-25 131/week @ 2025-01-01 94/week @ 2025-01-08 95/week @ 2025-01-15 142/week @ 2025-01-22 595/week @ 2025-01-29 467/week @ 2025-02-05 200/week @ 2025-02-12 101/week @ 2025-02-19 386/week @ 2025-02-26 164/week @ 2025-03-05

878 downloads per month
Used in opening-hours

MIT/Apache

100KB
2.5K SLoC

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

~3–4MB
~76K SLoC