holiday_checker-0.1.1 has been yanked.
🗓️ holiday_checker
A Rust library for querying and analyzing Sri Lankan public holidays for the year 2025. This crate allows you to load holiday data from a JSON file and check dates, filter by type/month/category, and search by holiday name.
📆 Installation
Add this crate to your Cargo.toml:
[]
= "0.1.0"
🛠️ How to Use
✅ Load data and check for a holiday
use ;
📁 JSON File Format
The crate expects a JSON file like this:
Save it as holidays_2025.json in your project root or specify your own path.
🔍 Available Methods
let holidays = load_holidays_from_file?;
// Get all holidays
holidays.get_all_holidays;
// Filter by month
holidays.get_holidays_by_month;
// Filter by type
holidays.get_holidays_by_type;
// Filter by category
holidays.get_holidays_by_category;
// Search by name
holidays.search_holiday_by_name;
// Check if a specific date is a holiday
holidays.is_holiday;
// Find holiday by exact date
holidays.get_holiday_by_date;
Each method is well-documented and returns results you can use immediately in applications or APIs.
▶️ How to Run
Once added to a binary crate or test project:
Make sure the JSON file (e.g. holidays_2025.json) is in the same directory where you're running the command.
✅ When to Use This Crate
- Holiday calendars
- HR attendance systems
- School academic tools
- Event planners
- National observance trackers
Pull requests and contributions welcome!