Skip to content

This is a project for tracking miles ridden on my bike during July 2020 for the Trek Century Challenge on Strava.

License

Notifications You must be signed in to change notification settings

dcribb19/trek_century_challenge

Repository files navigation

Trek Century Challenge - 2020

This is a project for tracking miles ridden on my bike during July 2020 for the Trek Century Challenge on Strava in Python, using matplotlib, numpy, reportlab, and PySimpleGUI.

Motivation

The Trek Century Challenge is a cycling challenge on the popular exercise tracking app Strava. The challenge runs for the entire month of July and has 3 goals for miles ridden: 100, 500, and 1,000. The best reward (Coffee Mug!) unlocks after only 100 miles. But, as an avid cyclist, I wanted to see how far I can push myself. Looking back at the last few years that I have been cycling, my 2 biggest months in terms of mileage were 717 and 702. With that being said, I routinely ride over 500 miles per month, so I decided to go all out for the 1,000. Then, I decided that I wanted an easy way to see how I was progressing daily vs my new lofty goal.

There were 3 things that I wanted to create:

  1. Bar chart to visualize miles ridden per day
  2. Line graph to visualize total miles ridden vs. a linear pace to hit 1,000 miles over 31 days
  3. A text representation of my current progress

I used matplotlib to create the bar chart and line graph. After creating them, I wanted to consolidate them with some text into one report that can be generated after each ride to check where I stand. After listening to episode 17 of The Real Python Podcast, I learned about the reportlab package, which can be used to create .pdfs, and figured that a .pdf would be an ideal document type for this.

Then, I heard episode 13 of The Real Python Podcast, which introduced me to PySimpleGUI, which I thought could be a nice way to enter and save ride data. So, I created a GUI that allows me to enter ride info, and upon clicking 'Submit', generates a new report.

Finally, I have added email functionality with ezgmail, which I have scheduled to run every night with Windows Task Scheduler to keep people informed of my progress.

Examples

What is Zwift?

You may have noticed in the bar chart that most of my rides have taken place on Zwift. Zwift is a massively mutltiplayer online platform for cycling and running. It has many different virtual worlds with routes of varied terrain, and during the current times of COVID-19, offers safe, social group rides with people from all over the world. Best yet, there's absolutely no car traffic, and there aren't any stoplights.

Zwift even hosted the Official Virtual Tour de France 2020!

Technologies

  • Python 3.8
  • matplotlib 3.3.0
  • numpy 1.19.0
  • PySimpleGUI 4.26.0
  • reportlab 3.5.36
  • ezgmail 0.0.8

Usage

python ride_gui.py
  1. GUI will display.

  1. ... button will bring up calendar in order to select date.

  1. Enter miles
  2. Select location
  3. Submit

Output (All files saved with _month_day.extension)

- Bar chart saved as .jpg to graphs directory
- Line graph saved as .jpg to graphs directory
- Report .pdf saved to reports directory

Credits

License

License

About

This is a project for tracking miles ridden on my bike during July 2020 for the Trek Century Challenge on Strava.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages