用于从 Garmin Connect 下载活动的 Python 客户端
项目描述
garpy是一个简单的应用程序,用于从 Garmin Connect 备份您的数据。它可用于对 Garmin Connect 中的数据进行增量备份或下载一项特定活动。
活动的增量备份
首次使用时,您在 Garmin Connect 帐户中找到的所有活动都将下载到您指定的目录中。之后,每次运行命令时,只会下载新可用的活动。
该命令使用如下:
garpy download {backup-dir}
在幕后,将会发生这样的事情:
garpy将提示您输入密码,然后将针对 Garmin Connect 进行身份验证。
它将首先从 garmin 获取您所有活动的列表。
它将检查哪些活动已在给定的备份目录上备份
它将继续下载所有缺少的活动。
从其 ID 下载一项活动
如果您只想下载一个活动,或者您想刷新一个已下载的活动,请使用“-a/–活动”标志,如下所示:
garpy download --activity 1674567326 {backup-dir}
这会将所有现有格式的活动下载到给定的备份目录
完整的 CLI 选项
有关更详细的用法,请调用“–help”命令:
$ garpy download --help
Usage: garpy download [OPTIONS] [BACKUP_DIR]
Download activities from Garmin Connect
Entry point for downloading activities from Garmin Connect. By default, it
downloads all newly created activities since the last time you did a
backup.
If you specify an activity ID with the "-a/--activity" flag, only that
activity will be downloaded, even if it has already been downloaded
before.
If no format is specified, the app will download all possible formats.
Otherwise you can specify the formats you wish to download with the
"-f/--formats" flag. The flag can be used several times if you wish to
specify several formats, e.g., 'garpy download [OPTIONS] -f original -f
gpx [BACKUP_DIR]' will download .fit and .gpx files
Options:
-f, --formats [tcx|gpx|original|summary|fit|details]
Which formats to download. The flag can be
used several times, e.g. '-f original -f
gpx'
-u, --username {username} Username of your Garmin account
-p, --password {password} Password of your Garmin account
-a, --activity {ID} Activity ID. If indicated, download only
that activity, even if it has already been
downloaded. Otherwise, do incremental update
of backup
--help Show this message and exit.
安装
garpy在您的系统上需要 Python 3.6 或更高版本。对于那些熟悉 Python 的人,请使用 pip 安装 garpy,如下所示:
pip install -U garpy
如果您是 Python 新手或在您的计算机上安装了 Python 2,我建议您安装Miniconda。据我所知,这是安装健壮且轻量级的 Python 环境的最简单方法。
致谢
该库基于garminexport。我借用了 GarminClient,根据我的喜好对其进行了重构,并从中创建了一个包。
项目详情
下载文件
下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。
源分布
garpy-0.3.6.tar.gz
(16.3 kB
查看哈希)
内置分布
garpy-0.3.6-py3-none-any.whl
(17.6 kB
查看哈希)