Hey guys, welcome to day 38 of 100 Days of Code. Now,
today I've got a challenge project for you.
And this challenge project is going to be building an exercise tracking
application using Python and Google sheets.
One of the things I've been trying to do recently is to track my workouts and
I've been doing that on pretty much pen and paper.
But wouldn't it be nice if we could track the workout that we're doing,
what time, how long we've been doing the exercises for,
and also figure out how many ice creams we can eat because of the workout that
we did. So tracking the amount of calories we've used up as well.
Now,
a lot of the inspiration for this project comes from the recent news on the Open
AI's GPT-3 AI model.
And it's a really smart, natural language processing model where for example,
if you went onto Wikipedia, you found an article on bread,
you decide to use this model to ask it, well, why is bread so fluffy?
It can actually search through all of the text and find you the relevant part.
So it's doing some intelligent stuff behind the scenes to understand what you're
saying and also understand what the article is all about.
And this is called natural language processing,
but it's just a very powerful one. Now, in our case,
we're also going to use natural language processing,
and we're going to write down the exercises that we did,
but in a normal English sentence.
You can imagine the situation where you're in the gym and you pull up your final
Repl.it. So this is the link to the completed app's console.
Right
Now I've pulled up this same page,
but on the Chrome browser on my mobile phone.
So this is what I might do after a gym workout or after a quick cycle.
And what we're going to try and do is to get the data to go into our spreadsheet
here on Google sheets.
So here I'm gonna type the I ran 5K and cycled for let's say,
20 minutes.
So this is my full input and it's pretty much just a plain English sentence.
Now I'm going to go ahead and hit return to trigger the code to run.
And immediately you can see that my activities have been logged.
So the date and time have been added automatically,
it's understood that one of my activities was running and it figured out the
duration based on the distance. So on average,
it might take somebody 31 minutes in order to run 5 kilometers.
And then it worked out the number of calories I've expended doing that activity.
And it did the same thing for my cycling,
except this time the duration comes from my input and the calories is calculated
automatically.
So this is really exciting and the best part you're going to be building it all
by yourself.
You're going to be using a bunch of things that you've learned so far,
including the Python datetime, strftime method,
using APIs, making post requests, creating authorization headers,
and environment variables.
You're going to be doing a bunch of this, step by step, by yourself.
And if you head over to the next lesson,
there's the instructions for how to get started.
So I hope you're excited to get started and I'll see you on the next lesson.