程序简介
使用Python自动处理中文Kindle系统的书摘文件“My Clippings.txt”,为每本书生成独立的标注、笔记文档,显示标注、笔记及其对应的位置,支持导出txt, csv格式。可将txt, csv导入Notion, Google Sheets或Evernote等平台整理为更易浏览、编辑的清爽格式。
运行本程序需要安装Python3, 本程序下载地址请见本柴Github。
充满爱的开发团队: Shiba Woof (Dev) + Mavis Meow (QA)
整理开发思路和改进意见,在该Script的技术总结里。本柴是代码新手,欢迎大家友好地讨论、debug和report issues.
使用步骤
步骤一:从Github Clone Repository

步骤二:把My Clippings.txt拷贝至当前repo

步骤三:打开terminal运行程序
- PC用户打开Windows PowerShell
- Mac用户打开terminal
获取txt格式书摘
- PC用户请运行
python .\kindle_scraper.py importAsTxt
- Mac用户请运行
python3 kindle_scraper.py importAsTxt
- 本程序会在当前目录中新建一个文件夹
/highlights
,你的清爽书摘和对应的Kindle位置信息会被储存在/highlights
文件夹里。 - 把导出的txt文件拷贝至各类平台进行后续编辑,拷贝至Notion的效果如下,数字代表位置,文字代表标注或笔记:

notion批量导入tips
在Notion右上角菜单栏选择import:

选择txt文件格式:

在弹窗中选中本程序处理好的清爽书摘们:


在Notion内对书摘进行各种操作(编辑和注释)都很方便,看起来也很清爽。

获取csv格式书摘
- PC用户请运行
python .\kindle_scraper.py importAsCsv
- Mac用户请运行
python3 kindle_scraper.py importAsCsv
- 本程序会在当前目录中新建一个文件夹
/highlights
,你的清爽书摘和Kindle位置信息会被储存在/highlights
文件夹里。 - 请阅读terminal说明或本文“步骤四”内容来用Microsoft Excel打开
UTF-8 format
的书摘文件。
获取书摘目录
- PC用户请运行
python .\kindle_scraper.py showTitles
- Mac用户请运行
python3 kindle_scraper.py showTitles
- 书摘目录会显示在terminal上。
步骤四:转换csv文件并导入Notion
4.1 打开highlights
文件夹可以看见一家人都都整整齐齐:

4.2 打开一份空白Microsoft Excel, 选中Data -> From Text ->选择要打开的清爽书摘文件


4.3 在弹窗里选择Deliminated. 并在File Origin选择UTF-8. 然后点击下一步。


4.4 Delimiters选择Comma,这样是为了把位置(数字)和内容(文字)划分成两列,然后点下一步:

出现的预览长这样,选择finish.

4.5 最后的窗口会询问你把文档插入哪个表单,选择现有表单或新表单都可以,取决于个人需求和喜好。

4.6 导出的CSV文件长这样,可以直接复制粘贴到Notion的任何文档中。


获取程序的帮助文件
- PC用户请运行
python .\kindle_scraper.py help
- Mac用户请运行
python3 kindle_scraper.py help
- terminal中会显示帮助文件。
参考
kindler by sanjamaniam – 本柴的程序是基于kindler程序修改而成。对原程序改动会总结在稍后的技术文章里。
特别鸣谢
谢谢猫咪送的Kindle作为我的生日礼物之一,让我看了很多书并萌生了写这个Script的想法;
并且谢谢猫咪提供的6000+行My Clippings.txt让我们完善这个产品;
最后谢谢猫咪的感情支持?。