question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support ICS files

See original GitHub issue

Feature

Support ICS files. https://en.wikipedia.org/wiki/ICalendar

Sample ICS file:

BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook MIMEDIR//EN
VERSION:1.0
BEGIN:VEVENT
DTSTART:19980114T210000Z
DTEND:19980114T230000Z
LOCATION:My office
CATEGORIES:Business
DESCRIPTION;ENCODING=QUOTED-PRINTABLE:This is a note associated with the meeting=0D=0A
SUMMARY:Meeting to discuss salaries
PRIORITY:3
END:VEVENT
END:VCALENDAR

See this repository for more calendars: https://github.com/xmha97/Calendars

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:4
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
anufrievromancommented, Jul 21, 2022

Okay, I had some time to work on it. For now, I am trying to figure out limitations and possible issues with different format. But so far, this script based on ics library works quite well with Nextcloud-generated ics files (everything in one file). I’ll leave it here for future reference:

from ics import Calendar

event_file = "myevent.ics"
task_file = "mytasks.ics"

print("====== EVENTS ======")

with open(event_file, 'r') as f:
    ics_text = f.read()

c = Calendar(ics_text)
for event in c.events:
    print(event.name)
    print(event.begin)
    print(event.all_day)
    print(event.description)
    print(event.status)
    print(event.classification)

print("====== TASKS ======")

with open(task_file, 'r') as f:
    ics_text = f.read()

c = Calendar(ics_text)
for task in c.todos:
    print(task.name)
2reactions
tkapiascommented, Jul 18, 2022

And about the libraries, 2 of them were listed above in this thread, there is a third one, vobject.

  • ics-py
    • Well documented
    • Maintained
    • But, too much issues like you said above
  • icalendar
    • Partial documentation
    • Maintained
    • Use by Khal or Vdirsync projects, but with wrappers or forked because of limitations
    • The lack of some parts in the documentation make it hard to check what is missing actually
  • vobject
    • Well documented
    • Not maintained for 4 years but still get PRs and issues. Apparently the maintainer is still in business in the calendars but stopped sharing updates.
    • Support VCARDs too, can be nice to parse birthdays
    • Support most feature lacking in the 2 other ones
    • A lot of ongoing issues and PRs that need to be assessed to see if it’s usable.

Something like https://github.com/sabre-io/vobject but not in PHP would have been nice.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ICS File Extension - What is an .ics file and how do I open it?
An ICS file is a calendar file saved in a universal calendar format used by several email and calendar programs, including Microsoft Outlook, ......
Read more >
Calendar ICS File Help
An ICS file is a file format for iCalendar. You can recognize it by its .ics file extension. This file format allows you...
Read more >
What Is an ICS File? - Lifewire
An ICS file is an iCalendar file. These are plain text files that include calendar event details like a description, beginning and ending...
Read more >
iCalendar - Wikipedia
ics . With supporting software, such as an email reader or calendar application, recipients of an iCalendar data file can respond to the...
Read more >
iCalendar.org - iCalendar Resources, Specifications and Tools
This site is devoted to promoting the iCalendar standard, which includes specifications, resources, a validation tool and PHP library. iCalendar is an open ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found