Skip to content

Instantly share code, notes, and snippets.

@not7cd
Created October 2, 2017 12:25
Show Gist options
  • Save not7cd/0805f365717e72f6347c06677b2d57ca to your computer and use it in GitHub Desktop.
Save not7cd/0805f365717e72f6347c06677b2d57ca to your computer and use it in GitHub Desktop.
from icalendar import Calendar, Event
file_path = 'fizyka_techniczna.ics'
g = open(file_path,'rb')
cal = Calendar.from_ical(g.read())
for component in cal.walk():
if component.name == "VEVENT":
component['uid'] = '%s%s' % (component['uid'], component['dtstart'])
f = open('fixed_' + file_path, 'wb')
f.write(cal.to_ical())
f.close()
g.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment