{"id":16783866,"url":"https://github.com/testeurmaniak/icalendar_parser","last_synced_at":"2025-03-17T02:31:47.450Z","repository":{"id":42393171,"uuid":"302074455","full_name":"TesteurManiak/icalendar_parser","owner":"TesteurManiak","description":"Flutter package to parse iCalendar (.ics) files.","archived":false,"fork":false,"pushed_at":"2024-04-22T14:45:44.000Z","size":441,"stargazers_count":32,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-02T04:01:34.644Z","etag":null,"topics":["dart","flutter","ical-parser","icalendar","ics","ics-files","parser"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/icalendar_parser","language":"Dart","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/TesteurManiak.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-07T15:10:21.000Z","updated_at":"2024-05-06T15:36:10.825Z","dependencies_parsed_at":"2023-02-10T08:31:02.703Z","dependency_job_id":"6a847b22-4b45-4132-8428-8b998a432fa6","html_url":"https://github.com/TesteurManiak/icalendar_parser","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TesteurManiak%2Ficalendar_parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TesteurManiak%2Ficalendar_parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TesteurManiak%2Ficalendar_parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TesteurManiak%2Ficalendar_parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TesteurManiak","download_url":"https://codeload.github.com/TesteurManiak/icalendar_parser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243841202,"owners_count":20356441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["dart","flutter","ical-parser","icalendar","ics","ics-files","parser"],"created_at":"2024-10-13T07:52:32.610Z","updated_at":"2025-03-17T02:31:46.905Z","avatar_url":"https://github.com/TesteurManiak.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# icalendar_parser\n\n[![Pub Version](https://img.shields.io/pub/v/icalendar_parser?color=blue\u0026logo=dart)](https://pub.dev/packages/icalendar_parser)\n[![Stars](https://img.shields.io/github/stars/TesteurManiak/icalendar_parser)](https://github.com/TesteurManiak/icalendar_parser/stargazers)\n[![Dart](https://github.com/TesteurManiak/icalendar_parser/actions/workflows/dart.yml/badge.svg)](https://github.com/TesteurManiak/icalendar_parser/actions/workflows/dart.yml)\n[![Coverage Status](https://coveralls.io/repos/github/TesteurManiak/icalendar_parser/badge.svg?branch=main)](https://coveralls.io/github/TesteurManiak/icalendar_parser?branch=main)\n\nPackage to parse iCalendar (.ics) files written in pure Dart.\n\nImplementation of [AnyFetch's ics-parser](https://github.com/AnyFetch/ics-parser) in JavaScript.\n\n## Getting Started\n\nAdd `icalendar_parser` to your pubspec.yaml:\n\n```bash\nicalendar_parser: any\n```\n\n## How to use\n\nYou can refer to the `example/` folder for a complete example implemented in Flutter.\n\n## Constructor\n\n### ICalendar.fromString\n\n```dart\nimport 'package:flutter/services.dart' show rootBundle;\nimport 'package:icalendar_parser/icalendar_parser.dart';\n\nfinal icsString = await rootBundle.loadString('assets/your_file.ics');\nfinal iCalendar = ICalendar.fromString(icsString);\n```\n\n### ICalendar.fromLines\n\n```dart\nfinal icsLines = await File('your_file.ics').readAsLines();\nfinal iCalendar = ICalendar.fromLines(lines);\n```\n\n## Other methods\n\n### ICalendar.registerField\n\nWith this method you can add fields that are not already supported (check [Supported Properties](#supported-properties)) to the parsing and you can specify a custom `function` to parse its content :\n\n```dart\nICalendar.registerField(field: 'TEST');\n\nICalendar.registerField(\n    field: 'TEST2',\n    function: (value, params, event, lastEvent) {\n        lastEvent['test2'] = 'test';\n        return lastEvent;\n    },\n);\n```\n\n### ICalendar.unregisterField\n\nWith this method you can remove parsed fields to ignore them in your file :\n\n```dart\nICalendar.unregisterField('TEST');\n```\n\n### ICalendar.toJson\n\nConvert [ICalendar] object to a `Map\u003cString, dynamic\u003e` containing all its data, formatted into a valid JSON `Map\u003cString, dynamic\u003e` .\n\n```dart\nfinal icsObj = ICalendar.fromLines(File('assets/my_file.ics').readAsLinesSync());\nprint(jsonEncode(icsObj.toJson()));\n```\n\n**Input**\n\n```\nBEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//hacksw/handcal//NONSGML v1.0//EN\nCALSCALE:GREGORIAN\nMETHOD:PUBLISH\nBEGIN:VEVENT\nCREATED:19960329T133000Z\nUID:uid1@example.com\nDTSTAMP:19970714T170000Z\nORGANIZER;CN=John Doe:MAILTO:john.doe@example.com\nDTSTART:19970714T170000Z\nDTEND:19970715T035959Z\nSUMMARY:Bastille Day Party\nGEO:48.85299;2.36885\nEND:VEVENT\nEND:VCALENDAR\n```\n\n**Output**\n\n```json\n{\n    \"version\": \"2.0\",\n    \"prodid\": \"-//hacksw/handcal//NONSGML v1.0//EN\",\n    \"calscale\": \"GREGORIAN\",\n    \"method\": \"PUBLISH\",\n    \"data\": [\n        {\n            \"type\": \"VEVENT\",\n            \"created\": {\n                \"dt\": \"19960329T133000Z\"\n            },\n            \"uid\": \"uid1@example.com\",\n            \"dtstamp\": {\n                \"dt\": \"19970714T170000Z\"\n            },\n            \"organizer\": {\n                \"name\": \"John Doe\",\n                \"mail\": \"john.doe@example.com\"\n            },\n            \"dtstart\": {\n                \"dt\": \"19970714T170000Z\"\n            },\n            \"dtend\": {\n                \"dt\": \"19970715T035959Z\"\n            },\n            \"summary\": \"Bastille Day Party\",\n            \"geo\": {\n                \"latitude\": 48.85299,\n                \"longitude\": 2.36885\n            }\n        }\n    ]\n}\n```\n\n## Supported Properties\n\n-   VERSION\n-   PRODID\n-   CALSCALE\n-   METHOD\n-   COMPONENT: BEGIN\n-   COMPONENT: END\n-   DTSTART\n-   DTEND\n-   DTSTAMP\n-   TRIGGER\n-   LAST-MODIFIED\n-   COMPLETED\n-   DUE\n-   UID\n-   SUMMARY\n-   DESCRIPTION\n-   LOCATION\n-   URL\n-   ORGANIZER\n-   GEO\n-   CATEGORIES\n-   ATTENDEE\n-   ACTION\n-   STATUS\n-   SEQUENCE\n-   REPEAT\n-   RRULE\n-   EXDATE\n-   CREATED\n\n## Contributors\n\n\u003c!-- readme: contributors -start --\u003e\n\u003ctable\u003e\n\t\u003ctbody\u003e\n\t\t\u003ctr\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/TesteurManiak\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/14369698?v=4\" width=\"100;\" alt=\"TesteurManiak\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eGuillaume Roux\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/LucaCoduriV\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/43602144?v=4\" width=\"100;\" alt=\"LucaCoduriV\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eLuca\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/simonbengtsson\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/3586691?v=4\" width=\"100;\" alt=\"simonbengtsson\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eSimon Bengtsson\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/Levi-Lesches\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/20747538?v=4\" width=\"100;\" alt=\"Levi-Lesches\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eLevi Lesches\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/jjchiw\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/642319?v=4\" width=\"100;\" alt=\"jjchiw\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eNull\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/stevenboeckmans\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/10263529?v=4\" width=\"100;\" alt=\"stevenboeckmans\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eNull\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\u003ctbody\u003e\n\u003c/table\u003e\n\u003c!-- readme: contributors -end --\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftesteurmaniak%2Ficalendar_parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftesteurmaniak%2Ficalendar_parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftesteurmaniak%2Ficalendar_parser/lists"}