How I Used Python & SQL To Build A Looker Dash During A Baseball Game

The 35 line SQL Query That Powers A Top 3 SQL Publication’s Analytics (Part II).

Share

Within the past 3 years, Major League Baseball did something incredible with its games. It sped them up. With games taking, on average, over 3 hours to complete, the MLB introduced the pitch clock, which functions as a really slow version of the NFL’s 40-second game clock. This innovation has reduced the average MLB game time to 2.5 hours.

And this is roughly the time in which it took me to put the pieces together of a project I’d been working on, in the background, for a few weeks: The automation of reporting for Learning SQL. As a co-editor of a publication focused on teaching the next generation of SQL developers, it seemed hypocritical and almost wrong that we didn’t yet have a comprehensive, reliable source of data-driven reporting.

So, as I explained in part I, I spent some time using the Unofficial Medium API to map out and then ingest data for the various metrics I’d need to better understand our content’s performance.

While part I covered the larger ideation and architecture, my goal in this part is to dive a bit deeper into the code to demystify the perceived complexity of building out a professional-grade analytics dashboard.

Build Your Pipeline To A Data Engineering Career

You’ve reached the limit of the public preview. The full version of this post includes the implementation details: The code, the edge cases, and the "why" behind the architecture.

When you join PipelineToDE, you get:

  • The DA → DE Pathway Course: A structured roadmap to bridge the gap between analysis and engineering.
  • Weekly Senior Deep Dives: Fresh, tactical insights on Python, Cloud (GCP/AWS), and modern orchestration delivered every week.
  • Production-Ready Blueprints: Access to 80+ protected stories and code repos from my time in the trenches as a Senior DE
  • The DE Job Board (Coming Soon): Exclusive access to a curated board of high-agency Data Engineering roles.