Crates.io | yasumi |
lib.rs | yasumi |
version | 0.2.1 |
source | src |
created_at | 2024-09-16 12:17:26.50723 |
updated_at | 2024-09-17 09:28:45.511617 |
description | Yasumi is a library for calculating the dates of Japanese holidays. |
homepage | https://github.com/telumo/yasumi-rs |
repository | https://github.com/telumo/yasumi-rs |
max_upload_size | |
id | 1376276 |
size | 78,045 |
Yasumi is a Rust library inspired by the popular jpholiday Python package. It allows you to determine whether a given date is a holiday in Japan and retrieve holiday lists for specific years.
With Yasumi, you get an ergonomic, high-performance Rust library for managing Japanese holidays, while maintaining the familiar interface of jpholiday.
To include Yasumi in your Rust project, add the following to your Cargo.toml
:
[dependencies]
yasumi = "0.1.0"
Then build your project with:
cargo build
Hereβs a quick example to get started with Yasumi:
use yasumi::{is_holiday, holiday_name, year_holidays};
fn main() {
let date = "2024-01-01";
if let Some(holiday) = holiday_name(date) {
println!("{} is a holiday: {}", date, holiday);
} else {
println!("{} is not a holiday.", date);
}
let holidays = year_holidays(2024);
for (date, name) in holidays {
println!("Holiday on {}: {}", date, name);
}
}
Rust is known for its memory safety, speed, and concurrency support. Yasumi leverages Rustβs strengths to provide a high-performance alternative to jpholiday. You get the reliability of Rust with the simplicity of a familiar API.
Clone the repository and build the project:
git clone https://github.com/telumo/yasumi.git
cd yasumi
cargo build
To run tests:
cargo test
Yasumi is inspired by the jpholiday Python package. Special thanks to the jpholiday community and all contributors who made this project possible.