{"id":20764689,"url":"https://github.com/bounoable/ical","last_synced_at":"2026-05-25T00:02:26.782Z","repository":{"id":57532729,"uuid":"279177896","full_name":"bounoable/ical","owner":"bounoable","description":"iCalendar (.ics) parser","archived":false,"fork":false,"pushed_at":"2020-08-10T17:15:16.000Z","size":74,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-26T12:26:55.786Z","etag":null,"topics":["go","golang","ical","icalendar","ics","parser"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bounoable.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-13T01:13:04.000Z","updated_at":"2021-07-27T23:55:07.000Z","dependencies_parsed_at":"2022-09-26T18:20:44.422Z","dependency_job_id":null,"html_url":"https://github.com/bounoable/ical","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/bounoable/ical","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bounoable%2Fical","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bounoable%2Fical/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bounoable%2Fical/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bounoable%2Fical/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bounoable","download_url":"https://codeload.github.com/bounoable/ical/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bounoable%2Fical/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33455026,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-24T19:21:36.376Z","status":"ssl_error","status_checked_at":"2026-05-24T19:21:10.562Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","ical","icalendar","ics","parser"],"created_at":"2024-11-17T10:53:20.516Z","updated_at":"2026-05-25T00:02:26.749Z","avatar_url":"https://github.com/bounoable.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iCalendar (.ics) parser\n\n![Test](https://github.com/bounoable/ical/workflows/Test/badge.svg?branch=master)\n\nThis package parses iCalendars specified by [RFC 5545](https://tools.ietf.org/html/rfc5545).\n\n## Features\n\n- [x] Concurrent lexing \u0026 parsing\n- [x] Buffered lexer\n- [x] allows `CRLF` \u0026 `LF` line breaks\n- [ ] Component validation\n\n## Implemented components\n\n- [x] [Event](https://tools.ietf.org/html/rfc5545#section-3.6.1)\n- [x] [Alarm](https://tools.ietf.org/html/rfc5545#section-3.6.6)\n- [ ] [To-Do](https://tools.ietf.org/html/rfc5545#section-3.6.2)\n- [ ] [Journal](https://tools.ietf.org/html/rfc5545#section-3.6.3)\n- [ ] [Free/Busy](https://tools.ietf.org/html/rfc5545#section-3.6.4)\n- [ ] [Time Zone](https://tools.ietf.org/html/rfc5545#section-3.6.5)\n\n## Install\n\n```sh\ngo get github.com/bounoable/ical\n```\n\n## Usage\n\nView the [docs](https://pkg.go.dev/github.com/bounoable/ical) for more examples.\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n  \"os\"\n  \"github.com/bounoable/ical\"\n)\n\nfunc main() {\n  f, err := os.Open(\"/path/to/calendar.ics\")\n  if err != nil {\n    panic(err)\n  }\n  defer f.Close()\n\n  cal, err := ical.Parse(f)\n  if err != nil {\n    panic(err)\n  }\n\n  // use events\n  for _, evt := range cal.Events {\n    fmt.Println(evt)\n  }\n}\n```\n\n## Context\n\nYou can attach a `context.Context` to both the lexer \u0026 parser via an option:\n\n```go\npackage main\n\nimport (\n  \"context\"\n  \"os\"\n  \"time\"\n  \"github.com/bounoable/ical\"\n)\n\nfunc main() {\n  f, err := os.Open(\"/path/to/calendar.ics\")\n  if err != nil {\n    panic(err)\n  }\n  defer f.Close()\n\n  // cancel the lexing \u0026 parsing after 3 seconds\n  ctx, cancel := context.WithTimeout(time.Second * 3)\n  defer cancel()\n\n  cal, err := ical.Parse(f, ical.Context(ctx))\n  if err != nil {\n    panic(err)\n  }\n}\n```\n\n## Strict line breaks\n\nBy default, the lexer allows the input to use `LF` linebreaks instead of `CRLF`, because many iCalendars out there don't fully adhere to the [spec](https://tools.ietf.org/html/rfc5545). You can however enforce the use of `CRLF` line breaks via an option:\n\n```go\npackage main\n\nimport (\n  \"os\"\n  \"github.com/bounoable/ical\"\n  \"github.com/bounoable/ical/lex\"\n)\n\nfunc main() {\n  f, err := os.Open(\"/path/to/calendar.ics\")\n  if err != nil {\n    panic(err)\n  }\n  defer f.Close()\n\n  cal, err := ical.Parse(f, ical.LexWith(\n    lex.StrictLineBreaks, // lexer option\n  ))\n\n  if err != nil {\n    panic(err)\n  }\n}\n```\n\n## Timezones\n\nYou can explicitly set the `*time.Location` that is used to parse `DATE` \u0026 `DATE-TIME` values that would otherwise be parsed in local time. This option overrides `TZID` parameters in the iCalendar.\n\n```go\npackage main\n\nimport (\n  \"os\"\n  \"time\"\n  \"github.com/bounoable/ical\"\n  \"github.com/bounoable/ical/parse\"\n)\n\nfunc main() {\n  f, err := os.Open(\"/path/to/calendar.ics\")\n  if err != nil {\n    panic(err)\n  }\n  defer f.Close()\n\n  loc, err := time.LoadLocation(\"Europe/Berlin\")\n  if err != nil {\n    panic(err)\n  }\n\n  cal, err := ical.Parse(f, ical.ParseWith(\n    parse.Location(loc),\n  ))\n\n  if err != nil {\n    panic(err)\n  }\n}\n```\n\n## Lexing \u0026 parsing\n\nBoth the lexer \u0026 parser are being exposed as separate packages, so you could do the following:\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n  \"os\"\n  \"github.com/bounoable/ical/lex\"\n  \"github.com/bounoable/ical/parse\"\n)\n\nfunc main() {\n  f, err := os.Open(\"/path/to/calendar.ics\")\n  if err != nil {\n    panic(err)\n  }\n  defer f.Close()\n\n  items := lex.Reader(f) // items is a channel of lexer items/tokens\n\n  cal, err := parse.Items(items) // pass the items channel to the parser\n  if err != nil {\n    panic(err)\n  }\n\n  for _, evt := range cal.Events {\n    fmt.Println(evt)\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbounoable%2Fical","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbounoable%2Fical","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbounoable%2Fical/lists"}