我正在尋找自動化的狀態報告,我必須發送給我的經理。由於我使用寫入iCalendar格式的待辦事項軟件,我希望能夠從ics文件中格式化電子郵件。適用於Python的iCalendar閱讀器?
我開始與我的工作:http://codespeak.net/icalendar/這看起來不錯,但它確實有一些粗糙的邊緣。
什麼iCalendar讀者你會建議python?
我正在尋找自動化的狀態報告,我必須發送給我的經理。由於我使用寫入iCalendar格式的待辦事項軟件,我希望能夠從ics文件中格式化電子郵件。適用於Python的iCalendar閱讀器?
我開始與我的工作:http://codespeak.net/icalendar/這看起來不錯,但它確實有一些粗糙的邊緣。
什麼iCalendar讀者你會建議python?
我知道這個問題已經過時了,但現在看起來這是最流行的Python iCalendar解析器。它在Pypi上可用。
的PyPI頁:https://pypi.python.org/pypi/icalendar
文檔:http://icalendar.readthedocs.org/en/latest/
Github上:https://github.com/collective/icalendar
有ics.py其中有一個非常 「Python的」 接口和抽象掉iCalendar格式RFC5545的不是很直觀的語法。
例子:
>>> from ics import Calendar, Event
>>> from datetime import datetime
>>> c = Calendar()
>>> e = Event()
>>> e.name = "My cool event"
>>> e.begin = '20140101 10:00:00'
>>> e.end = datetime(2014, 1, 1, 11, 30)
>>> c.events.append(e)
>>> c.events
[<Event 'My cool event' begin:2014-01-01 10:00:00 end:2014-01-01 11:30:00>]
>>> with open('my.ics', 'w') as my_file:
>>> my_file.writelines(c)
應該是社會的維基 – SilentGhost 2009-08-11 11:46:35
罰款。我真的不在乎。 – Alterlife 2009-08-11 12:27:14