连接 Apple 应用 Rond 的 Python API 工具
基于 Python 3.12,用于访问 macOS 应用容器内的数据库,提供 CLI 命令行接口和 MCP 服务器支持。
- 🐍 Python 3.12
- 🔒 数据库只读访问
- 🧭
timeline时间线查询(到访 + 交通混排) - 🧩 分层架构(config/db/repository/service/formatter/cli),便于后续扩展
- 指定日期时间线(
today/yesterday/YYYY-MM-DD) - 到访事件:地点、唯一用户分类、标签(Visit+Location 合并)
- 交通事件:交通方式、起止时间、时长、出发/到达地点
- 时间线事件按时间顺序混排输出
- 可读文本输出(默认带 Emoji)与 JSON 输出
- MCP 接口(本次仅预留代码结构)
- 游记/行程
- 健康/体能数据(macOS 不支持 HealthKit)
- 天气、日记、统计等其他查询能力
python -m pip install -r requirements.txt在项目根目录创建 .env 文件:
ROND_DB_PATH=/Users/你的用户名/Library/Containers/<Rond UUID>/Data/Library/Application Support/Rond/LifeEasy.sqlite开发环境可将数据库复制保存至 tests/LifeEasy.sqlite,避免误修改。
rond-api timeline --date todayrond-api timeline --date 2026-01-29 --output bothrond-api timeline --date yesterday --output pretty --no-emojirond-api timeline --date today --treefrom rond_api import get_timeline
timeline = get_timeline(date_expr="2026-01-29", db_path="tests/LifeEasy.sqlite")
print(timeline.query_date, timeline.timezone, len(timeline.events))- CLI:
--tree开启,--no-tree关闭 .env:tree=on|off(也支持TIMELINE_TREE=on|off)