Stats Tracking with Jupyter Notebooks
I personally believe that personal metrics are phenomenally important for anyone who has heavy ambitions and long-term goals. I made some lofty goals for myself in the form of New Years Resolutions and such, and I knew from the beginning that I'd have to relentlessly track progress in order to attain those goals. Now, previously, I'd been doing this in a notebook and on Asana. This solution is fine, technically, but it doesn't allow for visualization and insights very easily. I've been putting off a more intelligent solution for this for a while, but this morning as I was writing down my statistics in pen on a moleskin, I realized I was wasting a lot of time every morning checking my stats and recording them, and I didn't have a great way to visualize or otherwise analyze that data.
So, today, I banged out some quick code in Jupyter Notebook Python and now have a much more automated and intelligent way of recording my statistics. This will be the first of a (very) miniature series on developing my dashboard for stats recording and then automating the hell out of it.
Sound cool? You should subscribe to my newsletter to get all this juicy research in your inbox.
You can also check out part two of the series here!
What to track?
I track metrics on pretty much every entrepreneurial venture, or anything adjacent to it, that I take part in. This includes followers, Tweets and newsletter sign-ups for Twitter, views, likes, revenue and SEO information for my blog, subscribers and watch hours for YouTube and word count and revenue for my in-progress book. So the first thing I did was consult my handy dandy notebook and enumerate all of the stats I like to track as a header in a CSV file. After that, I spun up Jupyter Notebook and wrote a quick and easy function for accepting input in text fields from within the Notebook.
This is not, by any stretch, special or complicated code. It just takes text-box input from a user and spits it out to a CSV, that simple. I haven't even started looking at visualization or analysis yet, that's literally all I got.
However, now, every morning instead of spending 10 minutes hand-writing each individual stat, I just bust open a couple tabs and record everything I need in a CSV using the Notebook.
Next up, we've gotta start automating this stuff. Sure, I'm saving myself a fair bit of time this way, but I want to literally be able to smack a button and everything gets gathered for me. Hell, I don't even want to have to make the effort of smacking the button, just get it to run on sum cron job or something and we're golden. So, from what I've got right now, I'll need to write functionality to interact with:
- YouTube API
- Google Analytics API
- Google Search Console API
- Medium API
- Leanpub API
- Twitter API
- (eventually) GumRoad API
- Revue API
That's... a lot of API's, actually. Maybe this series won't be so miniature after all...
After that, we need to be able to run actual analytics on the data... otherwise we're just sticking it in a CSV and forgetting it. So analytics will come after we're fetching everything autonomously.
Before you go...
Does this sound like something you'd be interested in using as a SaaS product? I got to thinking about it and realized that a lot of people could use this (if it doesn't suck) so if you're interested, hit me up on Twitter and subscribe to my newsletter to get updates on development.