将iCal文件转换为Emacs组织模式数据
ical2org的Python项目详细描述
ical2org是一个命令行工具,用于从mac os x导出数据 应用程序,因此它可以与emacs工具org-mode一起使用。 数据传输是单向的(从iCal到Emacs),目的是 用于显示iCal在 组织的议程视图。
安装
ical2org作为一组Python源文件分发,并且 要求已安装python。源分布是 使用Distribute创建,它将与ical2org一起安装。
快速安装
使用普通的python应用程序步骤安装ical2org:
$ pip install ical2org
或:
$ easy_install ical2org
来源
下载并安装依赖项。
从project home page下载最新版本的tarball。
解压缩文件:
$ tar zxvf ical2org-VERSION.tar.gz
运行安装脚本:
$ cd ical2org-VERSION $ python setup.py install
注意
有些系统可能需要超级用户权限才能安装。
生成组织模式文件
虽然ical2org支持多种输出格式,但默认为 组织模式大纲。每个日历条目都包括摘要、位置, 日期和时间,以及完整的描述(用于搜索)。
例如,要从名为“meetup”的日历中提取条目: python“,您将运行:
$ ical2org "Meetup: Python" Starting 14 days ago at 2010-01-03 00:00:00-05:00 Ending 30 days from now at 2010-02-17 00:00:00-05:00 Processing: Meetup: Python Python Atlanta February Meetup # -*- coding: utf-8 -*- * Meetup: Python :clubs: :CATEGORY: Personal ** Python Atlanta February Meetup <2010-02-11 Thu 19:30-21:30> - PyAtl: Atlanta Python Programmers After an optional 6pm dinner at Figo Pasta at the corner of Howell Mill Road and Huff Road, we will meet as usual in the spacious and comfortable auditorium of the GTRI Food Processing Building at 7:30pm for our monthly meeting. Topics for this meeting: Brandon Rhodes will give his PyCon talk: "Learning Hosting Best-Practices From WebFaction" Atlanta, GA 30318 - USA Thursday, February 11 at 7:30 PM Photo: http://photos2.meetupstatic.com/photos/event/4/7/3/5/event_5238229.jpeg Attending: 3 Details: http://www.meetup.com/python-atlanta/calendar/12325308/
输出被编码为utf-8,这可能不适用于unix管道和 外壳重定向。将输出保存到文件而不是保存它 打印到标准输出,使用-o选项。
默认情况下,ical2org处理 以iCal显示。隐藏日历将被忽略,除非您将其 命令行上的名称。
生成日记文件
默认输出格式使用组织的大纲结构。如果你愿意 相反,使用emacs的日记模式,使用-f diary来切换模式。这个 日记条目不包括事件的全文。
推荐使用
使用ical2org的推荐方法是在 每天最少。这给了你一个新数据的移动窗口,因为 出口日期范围有限。将输出保存到文件 (例如,~/Documents/Notes/calendar.org)并将文件添加到org的 构建议程视图的输入列表。
如果使用组织模式在会议中记录笔记,请将每个事件重新填写为 你做笔记以避免下次日历时覆盖它 被导出。
例如,您可以运行如下命令:
$ ical2org -o ~/Documents/Notes/calendar.org -b 30 -e 30
从30天前开始到30天后结束的数据导出 到文件calendar.org。
经常性事件
iCal中的重复事件被“分解”以在 输出。这使得在添加注释时可以轻松地重新填充事件, 没有一次会议的记录出现在 日期不对。
命令行选项
-h | show this help message and exit |
-c CONFIG_FILENAME, --config=CONFIG_FILENAME | |
Configuration file name. Defaults to ~/.ical2org | |
-b DAYS_AGO, --begin=DAYS_AGO, --days-ago=DAYS_AGO | |
Number of days back in time to search. Defaults to 14. | |
-e DAYS_AHEAD, --end=DAYS_AHEAD, --days-ahead=DAYS_AHEAD | |
Number of days forward in time to search. Defaults to 30. | |
-v, --verbose | Increase verbose level |
-q, --quiet | Turn off verbose output |
-o OUTPUT_FILE_NAME, --output-file=OUTPUT_FILE_NAME | |
Write the output to the named file instead of stdout | |
--all | Include all calendars, not just active. |
--input-directory=INPUT_DIRECTORY | |
Directory containing calendars. Defaults to ~/Library/Calendars. | |
-f FORMAT, --format=FORMAT | |
Output format. One of [‘org’, ‘diary’]. Defaults to “diary”. | |
--opt=OPT, --formatter-option=OPT | |
Formatter-specific option name=value | |
--help | Verbose help |
历史记录
1.2
- Fix bug with event spans due to mis-interpretation of iCalendar standard.
1.1
- Fix DST handling for recurring events.
1.0.3
- Patches from KANEUCHI Tetsuya to fix problems with unicode console output and empty descriptions
1.0.2
- Updated installation instructions.
1.0.1
- Fixed some installation annoyances.
1.0
- First public release.