garmin tcx文件的简单解析器
python-tcxparser的Python项目详细描述
python tcx parser是garmin的tcx文件格式的最小解析器。它 并不是详尽无遗的。它提取的数据足够让我 把我的加敏先行者410手表的数据发布到 DailyMile’s原料药。
- 提取的数据:
- 训练起点的经纬度
- 锻炼类型(跑步、步行等)
- 完成训练的时间(以ISO UTC表示)
- 训练距离(米)
- 训练持续时间(秒)
- 锻炼期间消耗的卡路里(按设备估算)
- 锻炼期间的平均、最大和最小心率
- 锻炼期间的平均配速
- 训练期间的平均高度
- 训练的上升和下降
- 最大和最小高度
- 每个数据点的时间戳(以ISO UTC为单位)
- 平均和最大节拍(自行车活动)
安装
从pypi安装:
pip install python-tcxparser
用法
基本用法示例:
>>> import tcxparser >>> tcx = tcxparser.TCXParser('/home/vinod/Downloads/20121226-212953.tcx') >>> # Duration of workout in seconds ... tcx.duration 1992.78 >>> # latitude/longitude at start of workout ... tcx.latitude 35.951880198 >>> tcx.longitude -79.0931872185 >>> tcx.activity_type 'running' >>> # ISO UTC timestamp when workout completed ... tcx.completed_at '2012-12-26T22:03:05Z' >>> # distance of workout in meters ... tcx.distance 4686.31103516 >>> tcx.distance_units 'meters' >>> # calories burned (as reported by device) ... tcx.calories 379
兼容性
- python 2.7或3.7+
许可证
- bsd
联系人
如有任何问题,请联系我:vinod kurup(vinod@kurup.com)