'update'
This commit is contained in:
@@ -1,3 +1,20 @@
|
||||
"""
|
||||
booklist_parse.py
|
||||
-----------------
|
||||
功能:
|
||||
- 解析iBooks的Books.plist,提取所有书籍元数据(书名、作者、路径、时间等)。
|
||||
- 解析BKLibrary.sqlite,获取每本书的最近打开时间(苹果时间戳,基准2001-01-01)。
|
||||
|
||||
主要接口:
|
||||
- parse_books_plist(plist_path):返回所有书籍元数据,结构为{bk_id: {...}}
|
||||
- get_books_last_open(db_path):返回所有书籍最近打开时间,结构为{bk_id: {'last_open': 时间戳}}
|
||||
|
||||
依赖:plistlib, collections, sqlite3, os, datetime
|
||||
|
||||
典型用法:
|
||||
booksinfo = parse_books_plist('./data/Books.plist')
|
||||
books_open = get_books_last_open('data/BKLibrary.sqlite')
|
||||
"""
|
||||
import plistlib
|
||||
from collections import defaultdict
|
||||
|
||||
|
||||
Reference in New Issue
Block a user