All Projects → kiliankoe → iCalKit

kiliankoe / iCalKit

Licence: MIT License
📅 Parse and generate iCalendar (.ics) files in Swift

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to iCalKit

node-ical
NodeJS class for parsing iCalendar/ICS files
Stars: ✭ 53 (-1.85%)
Mutual labels:  icalendar, ical
rrule
🔁 Recurrence rule parsing & calculation as defined in the iCalendar RFC
Stars: ✭ 31 (-42.59%)
Mutual labels:  icalendar, ical
THCalendar
Calendar like iOS
Stars: ✭ 21 (-61.11%)
Mutual labels:  icalendar, ical
remarkable-calendar-creator
Create calendars to display on a reMarkable device as the suspend screen or to write notes on, including events from your own online iCal calendar
Stars: ✭ 28 (-48.15%)
Mutual labels:  icalendar, ical
ical
📅 Golang iCalendar lexer/parser implementing RFC 5545
Stars: ✭ 28 (-48.15%)
Mutual labels:  icalendar, ical
icalparser
Simple ical parser for PHP
Stars: ✭ 56 (+3.7%)
Mutual labels:  icalendar, ical
calcardbackup
calcardbackup: moved to https://codeberg.org/BernieO/calcardbackup
Stars: ✭ 67 (+24.07%)
Mutual labels:  icalendar
datebook
📅 Generates URLs and downloadable ICS files for adding events to popular calendar apps.
Stars: ✭ 273 (+405.56%)
Mutual labels:  icalendar
icsdb
Open repository of non-working days ics files
Stars: ✭ 20 (-62.96%)
Mutual labels:  icalendar
every2cal
🙌에브리타임 캘린더를 ics파일로 바꿔줍니다
Stars: ✭ 33 (-38.89%)
Mutual labels:  ical
cocktail
Elixir date recurrence library based on iCalendar events
Stars: ✭ 115 (+112.96%)
Mutual labels:  icalendar
NUAA ClassSchedule
NUAA_ClassSchedule 登录南京航空航天大学新教务系统,获取课表及考试信息,解析后生成iCal日历及xlsx表格文件,进而导入Outlook等日历...
Stars: ✭ 29 (-46.3%)
Mutual labels:  icalendar
kcl-timetable
Utilities in Python3 to fetch the KCL Timetable for a user, or export it as iCalendar (*.ics for Google or Apple)!
Stars: ✭ 14 (-74.07%)
Mutual labels:  icalendar
ical2gcal
sync ics(es) to google calendar
Stars: ✭ 13 (-75.93%)
Mutual labels:  ical
node-red-contrib-ical-events
Node-RED module to get events from a iCal Calender (Google e.g.), icloud or Caldav Server via kalender-events
Stars: ✭ 38 (-29.63%)
Mutual labels:  ical
Daylight-Calendar-ICS
Daylight Calendar is a dynamically generated .ics calendar that you can host and subscribe to in Google Calendar, iCal, or other calendar software.
Stars: ✭ 22 (-59.26%)
Mutual labels:  ical
croncal
Utility to convert a crontab file to a list of actual events within a date range.
Stars: ✭ 37 (-31.48%)
Mutual labels:  icalendar
python-jicson
python ics to json lib
Stars: ✭ 11 (-79.63%)
Mutual labels:  icalendar
rfc5545-rrule
RFC5545 RRule library for JavaScript
Stars: ✭ 22 (-59.26%)
Mutual labels:  ical
add2calendar
📆 Allow you to add event to calendar easier
Stars: ✭ 51 (-5.56%)
Mutual labels:  ical

📅 iCalKit

Very WIP. Please don't use this yet. It'll be a bit before this actually becomes presentable.

The purpose of this library is to parse and generate files that look somewhat like this:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
BEGIN:VEVENT
UID:[email protected]
DTSTAMP:19970714T170000Z
ORGANIZER;CN=John Doe:MAILTO:[email protected]
DTSTART:19970714T170000Z
DTEND:19970715T035959Z
SUMMARY:Bastille Day Party
END:VEVENT
END:VCALENDAR

Quickstart

Here's some quick examples of what's possible. Beware though that neither is the API currently stable nor are the types complete yet. This might as well also be outdated, but some basic examples are always nice to have.

var event = Event() // If no further params are supplied, only `uid` and `dtstamp` are set.
event.summary = "Awesome event"
print(event) // 20160513T003222+0200: Awesome event!

let calendar = Calendar(withComponents: [event])

let iCalString = calendar.toCal()
print(iCalString)

// BEGIN:VCALENDAR
// BEGIN:VEVENT
// UID:598C754E-A90A-4862-AAA6-E52BFFE3439F
// DTSTAMP:20160513T003547+0200
// SUMMARY:Awesome event
// END:VEVENT
// END:VCALENDAR
let url = URL(string: "https://raw.githubusercontent.com/kiliankoe/iCalKit/master/Tests/example.ics")!
let cals = try! iCal.loadURL(url)
// or loadFile() or loadString(), all of which return [Calendar] as an ics file can contain multiple calendars

for cal in cals {
    for event in cal.subComponents where event is Event {
        print(event)
    }
}

// 19970714T190000+0200: Bastille Day Party
// 19980714T190000+0200: Something completely different

Roadmap

Main ToDos:

  • Implement most of everything in RFC 5545
  • Validate iCal files

Also see the ruby gem icalendar as a broad goal where this should be headed.

Given complete freedom and a good bit of time, I'd love to implement an API something like the following. Huge kudos for the idea goes to @hoodie!

It's very debatable though and just an idea for now. Got any additional input? Just open an issue or PR and we can discuss it 😊

// date could stand for an NSDate or something equivalent

let importantMeeting.startDate(date)
                    .repeats(.BiWeekly)

let importantMeeting.startDate(date)
                    .every(.Days(7))

let birthday = Event.startDate(date)
                    .repeats(.Anually)

let xmas = Event.every(.December(24))

let sysadminday = Event.every(.July.last.Friday)

let tdo = Todo("buy milk")

let alarm = Alarm("get up").at("05:30").every(.Thursday)
let alarm = Alarm("get up").at("06:00").on(.Fridays)

let dontDisturb = Busy.between(date).and(date)
let dontDisturb = Busy.between("09..<12").am().on(.Mondays)

let dearDiary = Journal(description: "Dear Diary\nToday my cat ran away. Now I'm sad.")

let event = Event("this is a summary")
    .startDate(date)
    .endDate(date)
    .description("some description that is more descriptive than the summary")
    .attendee("mailto:[email protected]")
    .attendee(Attendee("[email protected]").hasDeclined())
    .attendee(Attendee("[email protected]").hasAccepted())
    .trigger("-PT15M")
    .repeatsEvery(.Wednesday)
    .ipClass(.Private)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].