Tip Sheet #12: New Python libraries you should be learning


Welcome to the first tip sheet of 2025! This will be a big year for me, as my book Hands-on APIs for AI and Data Science will be released in March, so I'm excited for it to get started!

Meet the Experts: Francisco Goitia, Statsbomb

When I was looking for sports-related companies that really have figured out how to use SDKs in their API and data strategies, I quickly zeroed in on Statsbomb. Statsbomb (which was recently purchased and named Hudl Statsbomb) has a big presence in the soccer analytics field and has been expanding into American football in recent years.

They publish a soccer data SDK in Python (statsbomby) and R (StatsBombR) and the cool feature is that these SDKs work for free users and paid users in two different methods: the SDKs pull open static data for free users, and call the API for paid users. That feature inspired how I built the SDKs in the book, which can take a parameter for bulk file downloads or direct API calls.

To learn more about their SDK strategy (especially for Python users), I interviewed Francisco Goitia, a lead machine learning engineer at Statsbomb. He said the history of the statsbombpy library was pretty simple: when he first joined the company, he needed to call the Statsbomb APIs in Python, so he started creating a basic client. He was following best practices -- keep your API code separate -- so it made sense. After he used it for a short time, the company open-sourced it so that customers could use it. Classic case of eating your own dog food/drinking your own champagne, right?

Francisco shared a lot of great tips, and I used this quote in the book because it's a really clear explanation of why publishing SDKs in PyPi is so powerful when your users are data scientists:

...if they can install a Python library with pip install and start using the data, it makes their life easier.
- Francisco Goitia, Statsbomb

Statsbomb does a nice job providing webinars and blog posts about using their SDKs. Here's a recent blog post that mentions a webinar that Martha Reyna and Lily Wood-Blake gave on accessing the data: Using Hudl Statsbomb Free Data In Python.

Python's popularity and top Python libraries

I'll finish this week with a couple of articles I came across in PyCoders Weekly newsletter this week. Python's popularity continues to grow in the programming world, firmly putting it at #1 in two major indexes, according to Paul Krill's InfoWorld article Python scores its highest rating in Tiobe According to the article, Python's 18% share in the TIOBE index is the highest than any language has had in the last 8 years.

Tryloabs has an interesting blog post about new Python libraries that are getting a lot of interest: Top Python libraries of 2024. There are a couple that I'm going to put on my 2025 learning list:

  • The #1 library on the General Purpose list is uv, which they call "the new standard package and project manager" and say it replaces pip, poetry, and pyenv. I keep coming across this library everywhere, so I need to give it a try.
  • The #5 library on the AI/ML/Data list is LitServe, a fast and efficient method of deploying ML libraries based on FastAPI. Since serving ML models is one of the key uses of APIs in data science, I'll be checking this out, too.
  • A library that was already on my radar is PydanticAI, which came in at #10 on the AI/ML/Data list. It's a new AI agent framework from the creators of Pydantic - I interviewed Samuel Colvin about this new library in the book.

Take a look at the list, and you might find something interesting to check out.

Keep coding,

Ryan

https://handsonapibook.com/

Ryan Day

Every week or two I share tips for hands-on skills related to data science, APIs, and AI. From the author of Hands-on APIs for AI and Data Science:Python Development with FastAPI from O'Reilly Publishing

Read more from Ryan Day

Hi Tip-Sheeters, The World Cup starts today!!! I live in Kansas City, USA and we're one of the host cities for the World Cup games this year. We're also hosting the training camps for the Netherlands, England, and Argentina so it's going to be an exciting month. If you visit the airport, you'll see we are ready for the festivities to begin! So this week I'm sharing a variety of World Cup and soccer / voetbal / fútbol / football links related to data and analytics. I'll be rooting for the red,...

Hi Tip-Sheeters, This week has an everything-old-is-new-again flavor: we're looking at building command line interfaces (CLIs) for APIs. You remember those old things: the somewhat cryptic tools you run in a linux prompt or from your Mac's terminal. Well they're having a moment in the AI and API space because they're a useful way for agents to call your APIs. And we're going to build one for the Air Travel API. Read to the end to see an LLM use the CLI in an agent harness. Back from Summer...

Ricardo Heredia Joya

Hi Tip-Sheeters, This week I'm sharing highlights of virtual chat I had with Ricardo Heredia Joya, a Madrid data scientist with a background as a medical doctor. He is active in the Football analytics community, and shares his thoughts and tips in the Underdoc substack. (If you're enjoying the Tip Sheet I'm sure you'll get a lot from Ricardo's newsletter.) You are your best asset, so never stop learning. - Ricardo Heredia Joya Q1: Thanks for having a virtual chat with the Tip Sheet...