FastAPI wrapper around garminconnect, utilising DynamoDB to bypass request throttling from garmin connect, hosted on AWS.
- Create the following DynamoDB tables, with
Id
as the partition key:
Name
Activity
Stats
HeartRate
Steps
-
Add your garmin email/password to Secrets Manager. Call it something e.g.
secret_example
and add two rows,EMAIL
andPASSWORD
with your actual garmin email/password. -
Create
.env
file in project root like so:
SECRET_NAME=secret_example
SECRET_ARN=secret_example-arn # arn for secret created
REGION=eu-west-1
STAGE=dev
NAME_TABLE=Name
ACTIVITY_TABLE=Activity
STATS_TABLE=Stats
HEART_TABLE=HeartRate
STEPS_TABLE=Steps
ACTIVITY_SPLITS_TABLE=ActivitySplits
ACTIVITY_DETAILS_TABLE=ActivityDetails
ACTIVITY_WEATHER_TABLE=ActivityWeather
ACTIVITY_HEART_RATE_ZONES_TABLE=ActivityHeartRateZones
DEVICE_LAST_USED_TABLE=DeviceLastUsed
- From the terminal:
# Set up virtualenv
pyenv virtualenv VERSION garmin-api
pyenv local garmin-api
# Install deps
pip install -r requirements.txt
npm i -g serverless
npm i
# Set up aws keys
aws configure
# Start server locally
uvicorn main:app --reload
# Test serverless offline
sls offline
# Deploy to aws
npm run deploy-dev
npm run deploy-prod