This repo contains code for a Prefect flow to sync activity data from my Strava account to Bigquery.
The data is visualized and available at https://running-with-prefect.calmtech.link/.
Set up a pyenv:
pyenv install 3.10.11
pyenv virtualenv 3.10.11 rwp
pyenv activate rwp
pip install -r requirements.txt
Then run a sync like:
python flows/sync_activities.py
This will sync the past 3 days. Can sync specific date ranges like:
python flows/sync_activities.py --start_date=2023-01-01 --end_date=2023-05-01
Run:
prefect deployment apply sync_activities-deployment.yaml
Build image:
docker buildx build --platform linux/amd64 -t running-with-prefect:v1 .
docker tag running-with-prefect:v1 us-west1-docker.pkg.dev/running-with-prefect/running-with-prefect/running-with-prefect:v1
docker push us-west1-docker.pkg.dev/running-with-prefect/running-with-prefect/running-with-prefect:v1
prefect deployment build flows/sync_activities.py:sync_activities -n sync_activities -sb github/github-running-with-prefect -ib cloud-run-job/gcp-cloud-run-running-with-prefect -o sync_activities-deployment.yaml --apply
Run locally with:
streamlit run streamlit/app.py