Skip to content

redryerye/iCalendarParser

Repository files navigation

iCalendarParser

A RFC 5545 compatible parser for iCalendar files in Swift.

Installation

To use iCalendarParser just add it as Swift Package Manager dependency:

via Xcode

Open your project, click on File → Add Packages, enter the repository URL (https://github.com/redryerye/iCalendarParser.git), and add the package product to your app target.

via SPM Package.swift

dependencies: [
    .package(
      name: "iCalendarParser",
      url: "https://github.com/redryerye/iCalendarParser",
      from: "0.4.0"
    )
]

Usage

To get started with iCalendarParser, all you have to do is to import it and use its ICParser type to convert any ICS file into iCalendar object:

import iCalendarParser

let rawICS: String = ...
let parser = ICParser()
let calendar: ICalendar? = parser.calendar(from: rawICS)

Is it production ready?

iCalendarParser is currently not feature complete yet. While it requires an additional implementation to be fully compatible with RFC5545, we appreciate contributions from the community to help us improve the library.

TODO

  • Components
    • Parse VEVENT
    • Parse VTIMEZONE
    • Parse VTODO
    • Parse VJOURNAL
    • Parse VFREEBUSY
    • Parse VALARM
  • VEVENT properties
    • Add COMMENT, CONTACT, and RESOURCES
    • Add EXDATE and RDATE
    • Add DURATION
    • Add ATTACH
    • Add GEO
    • Add RELATED-TO
    • Add REQUEST-STATUS
  • Recurrence
    • Parse basic RRULE
    • Expand recurring events into instances
    • Apply EXDATE
    • Apply RDATE
    • Handle RECURRENCE-ID overrides
  • Property parameters
    • Preserve common parameters on parsed properties
    • Support quoted parameter values
    • Support multi-value parameters
    • Support ALTREP, LANGUAGE, CN, ROLE, PARTSTAT, RSVP, TZID, and VALUE
  • Value types
    • Parse DATE
    • Parse DATE-TIME
    • Parse DURATION
    • Parse PERIOD
    • Parse URI
    • Parse UTC-OFFSET
  • Serialization
    • Format calendars back to valid .ics
    • Fold long lines correctly
    • Escape text values correctly
  • Validation
    • Validate required properties per component
    • Validate mutually exclusive properties, such as DTEND and DURATION
    • Validate property cardinality rules
  • Compatibility
    • Preserve unknown standard properties
    • Preserve X- properties and parameters
    • Add fixture coverage from real-world calendars

Contributing

Contributions to iCalendarParser are welcomed and encouraged!

License

iCalendarParser is available under the MIT license. See LICENSE for more information.

Credits

About

iCalendar (RFC5545) parser in Swift

Topics

Resources

License

Contributing

Stars

44 stars

Watchers

2 watching

Forks

Packages

 
 
 

Contributors