You don't need a 33K LOC enterprise library to read a calendar file.
Most apps just need to create a meeting invite, parse an .ics export, or read a contacts file. You shouldn't need to understand RFC 5545 to do that.
ezcal is iCalendar + vCard in one crate. Builder pattern in, valid .ics / .vcf out. Parse, modify, write back — unknown properties preserved.
cargo add ezcal
What Can You Do With It?
Create a Meeting Invite
Got a meeting? Turn it into a .ics file any calendar app can open.
use ;
let cal = new
.event
.build;
write?;
// → Opens in Google Calendar, Apple Calendar, Outlook
Parse Calendar Exports
Got a .ics file from Google Calendar? Read it in two lines.
use Calendar;
let calendar = parse?;
for event in calendar.events
Build a Contact Card
Create .vcf files that import into any contacts app.
use Contact;
let card = new
.full_name
.email
.phone
.organization
.build;
write?;
Read a Contacts File
Parse .vcf exports — even files with hundreds of contacts.
use Contact;
let contacts = parse_all?;
for c in &contacts
When to Use What?
| You Want To | Use This | Result |
|---|---|---|
| Create a calendar event | Calendar::new().event(Event::new()...) |
Valid .ics file |
| Parse an .ics file | Calendar::parse(&text) |
Typed Calendar struct |
| Create a contact card | Contact::new().full_name(...) |
Valid .vcf file |
| Parse a .vcf file | Contact::parse_all(&text) |
Vec of Contact structs |
| Add recurring events | .rrule(RecurrenceRule::parse("FREQ=WEEKLY")?) |
RRULE in your event |
| Add reminders | .alarm(Alarm::display("-PT15M", "Soon!")) |
VALARM in your event |
| Work with timezones | .starts_dt(DateTimeValue::DateTimeTz{...}) |
TZID parameter set |
| Convert to chrono | dt.to_chrono_utc() |
DateTime<Utc> |
Real-World Use Cases
1. Appointment Booking System
Problem: "Users book appointments, I need to send them a calendar invite."
use ;
// Attach to email or serve as HTTP response
let ics = create_booking;
2. Calendar Sync / Migration
Problem: "Export from one calendar, import to another."
use Calendar;
let cal = parse?;
println!;
for event in cal.events
3. Contact Import/Export
Problem: "Let users export their contacts as a .vcf file."
use ;
4. Recurring Event Schedules
Problem: "Set up a weekly standup that repeats for a year."
use ;
let cal = new
.event
.build;
5. Todo List Export
Problem: "Export tasks to a format other apps can read."
use ;
let cal = new
.todo
.todo
.todo
.build;
write?;
API Reference
iCalendar (ezcal::ical)
| Type | What It Does | Key Methods |
|---|---|---|
Calendar |
.ics container | new(), parse(), event(), todo(), build() |
Event |
VEVENT component | summary(), starts(), ends(), location(), rrule(), alarm() |
Todo |
VTODO component | summary(), due_date(), status(), priority(), percent_complete() |
Alarm |
VALARM component | display(trigger, desc), audio(trigger) |
RecurrenceRule |
RRULE | parse(str), new(Frequency) |
vCard (ezcal::vcard)
| Type | What It Does | Key Methods |
|---|---|---|
Contact |
.vcf container | new(), parse(), parse_all(), full_name(), email(), phone() |
StructuredName |
N property | new(family, given), with_prefix(), with_suffix() |
Address |
ADR property | new(), street(), city(), region(), postal_code(), country() |
DateTime (ezcal::datetime)
| Type | What It Does | Key Methods |
|---|---|---|
DateTimeValue |
Date/time values | parse(), to_chrono_utc(), from_chrono_utc(), to_property() |
Comparison
| Library | iCal | vCard | Read + Write | Status |
|---|---|---|---|---|
| ezcal | Yes | Yes | Yes | Active |
ical |
Yes | No | Read only | Archived (Aug 2024) |
icalendar |
Yes | No | Write-focused | Active |
calcard |
Yes | Yes | Yes | 33K LOC, complex API |
Compatibility
Output tested against:
- Google Calendar (.ics import)
- Apple Calendar (.ics import)
- Outlook (.ics import)
- Google Contacts (.vcf import)
- Apple Contacts (.vcf import)
Links
License
MIT