20 releases
Uses new Rust 2024
| 0.1.3 | Sep 10, 2025 |
|---|---|
| 0.1.2 | Aug 25, 2025 |
| 0.0.14 | Aug 18, 2025 |
| 0.0.9 | May 12, 2025 |
| 0.0.3 | Feb 14, 2024 |
#71 in Date and time
1.5MB
2.5K
SLoC
python Holidays package in Rust
In beta, feel free to PR.
Usage
NB: This package requires an internet connection at runtime, unless you use the feature offline.
Turning that feature on will embed holidays into your compiled artifact and may have size implications.
x86_64 (default-features = true)
// Result<Arc<CountryHolidayMap>, String>
let all_holidays = py_holidays_rs::get_all_holidays(CountryCode::AU);
// Result<BTreeMap<SubDivision, BTreeMap<chrono::NaiveDate, String>>, String>
let australian_holidays = py_holidays_rs::get_holidays_by_country(CountryCode::AU);
x86_64 (features = ["offline"])
// Result<Arc<CountryHolidayMap>, String>
let all_holidays = py_holidays_rs::get_all_holidays(CountryCode::AU);
// Result<BTreeMap<SubDivision, BTreeMap<chrono::NaiveDate, String>>, String>
let australian_holidays = py_holidays_rs::get_holidays_by_country(CountryCode::AU);
wasm32 (default-features = true)
py_holidays_rs::wasm32::initialise_all_holidays(CountryCode::AU).await; // you must call this somewhere before you call the get_* function, you only need to call it once
// Result<Arc<CountryHolidayMap>, String>
let all_holidays = py_holidays_rs::get_all_holidays(CountryCode::AU);
py_holidays_rs::wasm32::initialise_holidays_by_country(CountryCode::AU).await; // you must call this somewhere before you call the get_* function, you only need to call it once per country code
// Result<BTreeMap<SubDivision, BTreeMap<chrono::NaiveDate, String>>, String>
let australian_holidays = py_holidays_rs::get_holidays_by_country(CountryCode::AU);
wasm32 (features = ["offline"])
// Result<Arc<CountryHolidayMap>, String>
let all_holidays = py_holidays_rs::get_all_holidays(CountryCode::AU);
// Result<BTreeMap<SubDivision, BTreeMap<chrono::NaiveDate, String>>, String>
let australian_holidays = py_holidays_rs::get_holidays_by_country(CountryCode::AU);
Dependencies
~2–21MB
~256K SLoC