hans / ical2csv Goto Github PK
View Code? Open in Web Editor NEWEnumerates events described in an iCal ICS file and saves their data to a CSV file
Enumerates events described in an iCal ICS file and saves their data to a CSV file
I had to use pip to install:
Otherwise ical2csv would not work.
The file at the end of this issue leads to a crash:
$ python3 ical2csv.py noloc.ics
UID,CREATED,LAST-MODIFIED,DTSTART,DTEND,SUMMARY,LOCATION
Traceback (most recent call last):
File "ical2csv.py", line 148, in <module>
args.include_full_day):
File "ical2csv.py", line 56, in process
item['LOCATION'] = item['LOCATION'].replace(',', ';')
File "/usr/local/lib/python3.5/dist-packages/icalendar/caselessdict.py", line 42, in __getitem__
return super(CaselessDict, self).__getitem__(key.upper())
KeyError: 'LOCATION'
BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
BEGIN:VTIMEZONE
TZID:Europe/Berlin
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
CREATED:20160715T134945Z
LAST-MODIFIED:20160718T074326Z
DTSTAMP:20160718T074326Z
UID:16CC71D0-3938-484A-8348-D450D5A3AEC5
SUMMARY:test
STATUS:CONFIRMED
DTSTART;TZID=Europe/Berlin:20160718T090000
DTEND;TZID=Europe/Berlin:20160719T140000
SEQUENCE:0
X-DEFAULT-ALARM:TRUE
END:VEVENT
END:VCALENDAR
When trying to export a full-day event, I get a crash:
$ python3 ical2csv.py --include-full-day=1 fullday.ics
UID,CREATED,LAST-MODIFIED,DTSTART,DTEND,SUMMARY,LOCATION
Traceback (most recent call last):
File "ical2csv.py", line 151, in <module>
args.include_full_day):
File "ical2csv.py", line 52, in process
if (start_date is not None and start_date > item_start) or end_date < item_end:
TypeError: can't compare datetime.datetime to datetime.date
BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
BEGIN:VTIMEZONE
TZID:Europe/Berlin
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
CREATED:20151218T191453Z
LAST-MODIFIED:20151222T082058Z
DTSTAMP:20151222T082058Z
UID:[email protected]
SUMMARY:test
STATUS:CONFIRMED
DTSTART;VALUE=DATE;TZID=Europe/Berlin:20151223
DTEND;VALUE=DATE;TZID=Europe/Berlin:20160104
TRANSP:TRANSPARENT
SEQUENCE:0
X-DEFAULT-ALARM:TRUE
END:VEVENT
END:VCALENDAR
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.