Latest / Talk Python To Me / #416: Open Source Sports Analytics with PySport
Transcript
- 0:00If you're looking for fun data sets for learning, for teaching, maybe a conference talk, or even if you're just really into them,
- 0:06sports offers up a continuous stream of rich data that many people can relate to.
- 0:11Yet accessing that data can be tricky.
- 0:14Sometimes it's locked away in obscure file formats.
- 0:18Other times the data exists, but without a clear API to access it.
- 0:22On this episode, we talk about PySport, something of an awesome list of a wide range of libraries,
- 0:28mostly but not all Python, for accessing a wide variety of sports data from the NFL, NBA, F1, and more.
- 0:36We have Kuhn Vassen, the founder of PySport, to talk through some of the more popular projects.
- 0:41This is Talk Python To Me, episode 416, recorded May 11th, 2023.
- 0:57Welcome to Talk Python To Me, a weekly podcast on Python.
- 1:03This is your host, Michael Kennedy.
- 1:05Follow me on Mastodon, where I'm @mkennedy, and follow the podcast using @talkpython, both on fosstodon.org.
- 1:12Be careful with impersonating accounts on other instances.
- 1:15There are many.
- 1:16Keep up with the show and listen to over seven years of past episodes at talkpython.fm.
- 1:22We've started streaming most of our episodes live on YouTube.
- 1:25Subscribe to our YouTube channel over at talkpython.fm/youtube to get notified about upcoming shows and be part of that episode.
- 1:33This episode is brought to you by JetBrains, who encourage you to get work done with PyCharm.
- 1:39Download your free trial of PyCharm Professional at talkpython.fm/done dash with dash PyCharm.
- 1:46And it's brought to you by InfluxDB.
- 1:49InfluxDB is the database purpose built for handling time series data at a massive scale for real-time analytics.
- 1:55Try them for free at talkpython.fm/InfluxDB.
- 1:59A quick announcement before we jump into the conversation around PySports.
- 2:04We have over 240 hours of Python course video content at Talk Python.
- 2:10And if you're watching that content on a mobile platform, phone, or tablet, the browser is definitely not the best experience.
- 2:17For example, on iOS, it won't even auto-advance or start playing without your interaction.
- 2:23We've had some mobile apps for our courses for a while now, but they have fallen a bit into disrepair for a couple of reasons, including App Store tyranny.
- 2:32But over the past four months, we've completely reimagined and rewrote our mobile apps in a modern and beautiful platform.
- 2:39And I'm super happy to announce that they are now available for Android and iOS on both phone and tablets in their respective app stores.
- 2:47So please visit talkpython.fm/apps to see for yourself how beautiful and clean the new apps are and why I'm so excited about them.
- 2:57Download them for free and even take a couple of our free courses included in there, as well as the paid ones that you might have gotten, of course.
- 3:04Finally, if you're curious for a bit of a look behind the curtain about how and why we rewrote them, check out my personal site, mkennedy.codes, for the full story.
- 3:14Thank you all for supporting our work.
- 3:16Now, on to the show.
- 3:18Kun, welcome to Talk Python To Me.
- 3:21Yeah, thanks.
- 3:22Thanks for having me.
- 3:22Really cool to talk about this topic.
- 3:25Yeah, I'm real excited to have you here.
- 3:27You have quite a collection of libraries.
- 3:30Now, up front, these are not all your libraries, right?
- 3:33These are sort of kind of an awesome list of Python and even beyond Python, sports libraries, data sets, APIs, models, everything, right?
- 3:42I think it's for people, it was quite hard to find open source packages.
- 3:47And I tried to collect everything I could find and make it available for everyone to find what I need.
- 3:54It sounds like a great mission.
- 3:55And as people will see, there is a bunch of stuff that we'll get you to talk about.
- 4:01So I noticed not absolutely every sport is covered there, but many of the popular sports are covered.
- 4:09And if you're interested in sports, I think also if you're interested in just examples that connect with people, right?
- 4:16Imagine you're a university professor and you don't want to use the New York City tax data one more time.
- 4:24You want to say, well, maybe people are into soccer, American football or NBA, whatever it is, right?
- 4:31Maybe you could come up with something more interesting.
- 4:33F1, for example, right?
- 4:35Yeah, definitely.
- 4:35There's quite some cool data available to use in your courses.
- 4:40Yeah, absolutely.
- 4:41Yeah.
- 4:41Also, if people are members of some kind of club or team, maybe they could use some of this to bring some cool visualizations or analysis to their own organization, right?
- 4:53Yeah, that's also one of the things that PySport likes to encourage to use open source packages that are already available instead of building your own stuff, because that actually happens a lot.
- 5:07So that's also a part of the mission of PySport to make people aware of what's already there and try to bring people together.
- 5:15One of the big problems, not problems, it's an opportunity, but it's also a challenge of Python.
- 5:20If you go to PyPI.org right now, there's 453,000 packages.
- 5:25I didn't know the number, but that's quite a lot.
- 5:27We're coming up on half a million.
- 5:29And if your goal is to work with some specific data set or try to solve a certain type of problem, often the hardest part is figuring out, well, what library do I use?
- 5:39Does it exist?
- 5:40And if so, is it up to date and all of these things?
- 5:43So having a list like this, a place that aggregates it and sorts it, filters it, super neat.
- 5:49So really looking forward to talking to you about it.
- 5:51Before we get to that, though, just give us a quick bit on your backstory.
- 5:54How'd you get into programming in Python?
- 5:56Yeah, this is an interesting story.
- 5:57I think I started programming when I was, I think, around 12, when I get Lego Mindstorms.
- 6:04Lego that you could also program.
- 6:06My father gave me a visual basic book.
- 6:09Yeah, I should just figure it out.
- 6:11So that's where I started with programming.
- 6:13And then during high school, I also did web development with PHP.
- 6:19I'm not really sure at what age, but eventually I ended up with, I think, the first Dutch search engine.
- 6:26They want to, yeah, they need a Python developer.
- 6:29And I didn't really know Python, but that wasn't an issue.
- 6:33So there I learned Python.
- 6:35And from that point on, I, yeah, only, or mostly used Python.
- 6:40Right on.
- 6:41You're like, all right, forget this PHP stuff.
- 6:42I'm going Python.
- 6:43Yeah, well, to be honest, we, my company, we still use PHP.
- 6:48Yeah, I'm sure.
- 6:49Because, well, it works quite well.
- 6:52The performance is okay.
- 6:53I'm not really sure if I'm allowed to say it on this show, but it also had some advances.
- 6:58Yeah, absolutely.
- 6:59Well, I mean, almost every language has some, something it's particularly good at and reasons to keep using it.
- 7:05And then also there's just tons of software that was written, you know, pick your language, written in that language.
- 7:09And it still works well.
- 7:10And there's plenty of reasons to just keep going with it, right?
- 7:13Yeah.
- 7:13But, yeah, Python is really my language of most interest and what I really use on my day-to-day work.
- 7:23Excellent.
- 7:24Yeah.
- 7:25Yeah, cool.
- 7:25What are you doing these days?
- 7:26Are you still working at the search engine?
- 7:28No, that was quite a while ago.
- 7:30I also worked at a huge online marketing agency where we did run the software department.
- 7:38We created tools to collect all the data from all kinds of different sources and make it available for the teams.
- 7:45Right now I'm running my own company.
- 7:48It's called TeamTV, where we provide all kinds of tools where we use video and data for, example, performance analysts, but also for highlight creation or live streaming.
- 8:02Just to make sure that we try, at least we try to combine video and data in all possible ways within the support domain.
- 8:10Yeah, that sounds like a really interesting thing to be working on.
- 8:14Yeah, I started mostly on the video engineering part.
- 8:18So we built quite some stuff ourselves there.
- 8:20So from people uploading huge amounts of footage that we need to transcode and how to scale it, how to serve it.
- 8:29So that's stuff we build ourselves.
- 8:31Yeah, later on, we keep on building more stuff around data and always keep the combination between data and the video.
- 8:40Because, well, you can see some sort of metric, but you always want to see the footage behind it to actually understand the context of it.
- 8:49Yeah, sure.
- 8:49Sounds really fun.
- 8:50And you're also involved with PyData Endover, is that right?
- 8:53Yeah, yeah.
- 8:54Give them a shout out.
- 8:55Yeah, yeah.
- 8:56Five years ago, we started with PyData Eindhoven.
- 8:59We were already friends with PyData Amsterdam.
- 9:02They said, well, maybe you should also start an Eindhoven chapter.
- 9:06I think this year will be the anniversary, the five-year anniversary for PyData Endover.
- 9:11And it's, yeah, it's an amazing community.
- 9:14And that's, yeah, also inspired me to start with PySport.
- 9:18I'm not really sure if people at all that are listening to this podcast know PyData.
- 9:24Maybe, I think.
- 9:26I hope so.
- 9:26Yeah, I suspect most of them probably do.
- 9:29At least the data science inclined among us.
- 9:32Yeah, I can tell a little bit about it.
- 9:34Right now, we have a nice way of organizing the meetups and trying to get more people involved
- 9:40and talk about data science and share knowledge.
- 9:43And then once a year, we have the conference where we try to get, yeah, collect money that
- 9:49we can send to NumFocus and they can share it over all the open source projects.
- 9:54So, yeah.
- 9:55It's a really amazing community.
- 9:58That's excellent.
- 9:59Yeah, NumFocus does a lot to support the bigger data science oriented projects.
- 10:05Yeah.
- 10:06I think that's kind of unique amongst the, in the Python space.
- 10:09You know, there's not really anything like that in the web or UI.
- 10:14You know, there's not a lot of areas where there's like organization that says, okay, we're going to try to find the popular projects and support them across organizations.
- 10:22Right.
- 10:22Like people support Flask, but they don't also support Django in the same sort of organization.
- 10:28Right.
- 10:28I think it's also an opportunity for all the companies that are using those open source packages to give back.
- 10:36And I think doing it through NumFocus, it makes it also easier because they use a lot of packages and can just donate to NumFocus and they will make sure it's distributed over those packages.
- 10:49Right.
- 10:49Absolutely.
- 10:50If you use Pandas, you should also support NumPy, right?
- 10:53Because that's kind of the foundation and so on.
- 10:56Yeah, yeah, yeah.
- 10:57Interesting.
- 10:58Oh, that makes a lot of sense.
- 10:59All right.
- 10:59Well, let's jump into sports and your project, PySport.
- 11:06Are there other people who are maintainers and working on this or is this just your project?
- 11:10To get the meetup that we had just a couple of weeks ago, we had some more people collected.
- 11:17And now we are building from there on to get more people involved with just PySport.
- 11:23But one of the projects we built with PySport is the Cloppy package.
- 11:27And there we have worked together with Jan van Haaren.
- 11:31He's a head of data science at Club Brugge, a big club in Belgium.
- 11:37We had the main maintainers there, but I think right now we have 22 contributors to the package.
- 11:44So there's quite some people contributing there.
- 11:47Yeah.
- 11:48Yeah, that's a big group.
- 11:49That's a lot of people contributing.
- 11:50Yeah.
- 11:50Let's start it this way.
- 11:51Tell people what PySport is and about that.
- 11:53And then we can talk a little broadly just about sports analytics before we get into the details.
- 11:57The most important mission of PySport is to bridge the gap between the clubs and the sports analytics and just people and by using open source packages.
- 12:10Because a lot of clubs are using open source packages.
- 12:14Open source packages are used by the clubs and people want to have a way to contribute to their favorite club.
- 12:21I think a lot of people are still struggling on how to do it.
- 12:24And with PySport, yeah, we want to share the knowledge and teach people on how to do it.
- 12:31So we try to get the experts from the clubs, but also getting the knowledge from, you know, like Thundas or other big packages and see how we can get all that knowledge into the sports analytics community.
- 12:46With Cloppy, we try to set an example on how to build such a package, how to work together on such a thing and also encourage people to contribute.
- 12:59Yeah.
- 12:59Show that you don't have to create a pull request that there's a major effector, but also like minor things like typing errors, fix and documentation and show people that that's also very valuable to a package.
- 13:15Interesting.
- 13:16So Cloppy is standardized soccer tracking and event data, right?
- 13:21So you started out with soccer or as I guess a lot of the world might refer to it as football, but in the U.S., that's already taken.
- 13:30It's a namespace collision.
- 13:31Yeah.
- 13:32Yeah.
- 13:34It's sometimes, yeah, it's difficult to talk about football, but here in Europe, we call it football, but for the package, because it's international.
- 13:43It's also worldwide, so I call it soccer.
- 13:46Yeah.
- 13:47Yeah.
- 13:47Namespace.
- 13:48Namespace.
- 13:49So give us a quick bit of background on Cloppy, but since it's kind of one of the founding, you created this as a way to sort of set an example, right?
- 13:57For how to create a package and it helps people understand this event, this club data.
- 14:03Where that started is on Twitter, there was already quite some people talking about sports analytics, of course.
- 14:09And one guy, Joe Mulberry, he's working at a Danish top club.
- 14:14He asked for help because he created a notebook and he wanted to build a Flask API on top of it.
- 14:20And I said, well, I know Python.
- 14:22I don't know really much about soccer or about data, but yeah, I would like to be involved.
- 14:28I would like to help you.
- 14:29And when I received a notebook, I noticed that like 80% of the code was about reading and standardizing the data to a format that he could work with.
- 14:41And when we talked about it, it seemed like most, at least a lot of people are struggling with that issue and doing the same thing over and over again.
- 14:49Because in more notebooks that I saw, people were doing the same thing, but in different ways.
- 14:54And some were not correct implementation or inefficient implementations.
- 15:00So I thought, well, one thing I know is how to read data and how to get it into a standardized format, because that was also one of the things I did at an online marketing company.
- 15:11Yeah.
- 15:12Like, I don't know much about your data format, but I know about processing data and normalizing it and all that, right?
- 15:18Yeah.
- 15:19I built a package start with just tracking data, but also try to explain what the next steps could be.
- 15:25And then people said, well, this is really useful.
- 15:27And from that part, I kept on adding deserializers for different kinds of data for the tracking data and also for the event data.
- 15:37Yeah.
- 15:37It tried to get knowledge from non-sport bigger projects.
- 15:42So I also got Will Kunnen from the Texel package.
- 15:48He also did several reviews on this package and give feedback to try to get the package on a higher level.
- 15:56So people within sports analytics community could also gain more knowledge from there.
- 16:01But maybe also a small background on the data.
- 16:06So the tracking data, that's like positioning data for all players on the pitch.
- 16:11I think it's most of the time 25 frames per second.
- 16:15So you know the location for each player and the ball.
- 16:18And on the other side, you have the event data.
- 16:20So there are all passes and shots and things like that.
- 16:23At this time from this position, there was a shot on the goal or there was a pass or there was a takeaway or penalty.
- 16:29Yeah.
- 16:29Yeah.
- 16:30Yeah.
- 16:30That's event data.
- 16:31Yeah.
- 16:32And all the vendors choose different formats.
- 16:34Yeah.
- 16:35Yeah.
- 16:36Oh, geez.
- 16:37That sounds hard.
- 16:39So first of all, 25 hertz of all the people's location.
- 16:44This is beyond somebody with just a pen and paper and notebook writing down, oh, at this time there was a shot on the goal by number 25.
- 16:53How do they get that data?
- 16:54That's crazy.
- 16:55Yeah.
- 16:55Yeah.
- 16:55That's quite an advanced systems that they use.
- 16:58So in the stadium, I think they have like 20 cameras around the pitch.
- 17:02They use computer vision to detect all the players and combine it.
- 17:07But I believe, and I'm not really sure if they're already vendors on the market that do it totally automated.
- 17:14But I think from the system that I'm currently used in soccer, there are still some people needed for difficult situations like a corner kick, where a lot of people in a small area and a lot of occlusions happen.
- 17:27You can't see the numbers, yeah.
- 17:27Yeah, they can't see the numbers.
- 17:28So just after a corner, some manual operator has to reassign some players or correct something.
- 17:35But it's quite an advanced system already.
- 17:38It sounds incredibly advanced.
- 17:39It sounds like an awesome data set to work with because with that much data, you really can make a lot of interesting predictions and trends.
- 17:48I mean, at some point, maybe we'll just put some sort of tracking RFID thing on the back of the player's heads, just stitch it on there.
- 17:56And then you can fully automate it, you know?
- 17:58Yeah, I think a soccer day ticket.
- 18:02Yeah, maybe.
- 18:03Yeah.
- 18:03Not sure if all players would accept it.
- 18:05But for example, on ice hockey, yeah, you can put it on the helmets.
- 18:09Yeah, you can put it on the helmets, sure.
- 18:11For football.
- 18:11Yeah.
- 18:13Yeah.
- 18:13Things like automobile racing, you know, they have, not all of them, but for example, F1 has incredibly high frequency of, like, points that measure where is this car, how fast is it going, the cars are sending out real-time telemetry.
- 18:28There's certainly many sports that have quite high fidelity in their data.
- 18:32I must admit, I haven't seen the data from F1 yet, but it would be really interesting to learn from them and now to work with data and see if it can be applied to football or soccer or the sport.
- 18:46This portion of Talk Python To Me is brought to you by JetBrains, who encourage you to get work done with PyCharm.
- 18:53PyCharm Professional is the complete IDE that supports all major Python workflows, including full-stack development.
- 19:00That's front-end JavaScript, Python backend, and data support, as well as data science workflows with Jupyter.
- 19:06PyCharm just works out of the box.
- 19:09Some editors provide their functionality through piecemeal add-ins that you put together from a variety of sources.
- 19:16PyCharm is ready to go from minute one.
- 19:18And PyCharm thrives on complexity.
- 19:21The biggest selling point for me personally is that PyCharm understands the code structure of my entire project, even across languages such as Python and SQL and HTML.
- 19:32If you see your editor completing statements just because the word appears elsewhere in the file, but it's not actually relevant to that code block, that should make you really nervous.
- 19:42I've been a happy paying customer of PyCharm for years.
- 19:45Hardly a workday passes that I'm not deep inside PyCharm working on projects here at Talk Python.
- 19:52What tool is more important to your productivity than your code editor?
- 19:56You deserve one that works the best.
- 19:58So download your free trial of PyCharm Professional today at talkpython.fm/done with PyCharm and get work done.
- 20:07That link is in your podcast player show notes.
- 20:09Thank you to PyCharm from JetBrains for sponsoring the show and keeping Talk Python going strong.
- 20:15I bet it's a lot, actually.
- 20:18I bet it is, you know, just in terms of actual quantity of data, you know, how fast are sampling and how many cars for how long.
- 20:25It's probably a lot of data.
- 20:26That's also one of the interesting things about working with sports data.
- 20:30I think the data engineering part and this package just focused on reading the data.
- 20:36But then the next step, yeah, how to work with the data, especially if you would like to use the tracking data for a whole season.
- 20:43Yeah, that's quite some data that also vendors can start struggling a bit with.
- 20:48It just occurred to me, there's probably a whole nother demographic or aspect who would be interested in this kind of data.
- 20:55It would be like sports betting people.
- 20:57I mean, not that I have any interest in that at all.
- 20:59But if you were trying to figure out like, OK, if this team plays that team, if you can understand, OK, this their star player,
- 21:05if we match up their moves against the other person's moves, it turns out there's a weakness in this way for their defense or who knows.
- 21:12Right. I mean, there's there's with that much data.
- 21:14There's probably some interesting stuff you can do.
- 21:16I think that a lot of vendors of the data also have the, yeah, the betting industry as well as their clients.
- 21:25Because, yeah.
- 21:25I don't really care to work for them or support them.
- 21:30It's a little bit shady, I suppose.
- 21:31But it does seem like you could, it's almost like really detailed information about companies for the stock market.
- 21:39This is kind of like a little bit like that for the sports betting in some ways, I suppose.
- 21:42Yeah.
- 21:43Yeah.
- 21:43Yeah.
- 21:44Yeah.
- 21:44Interesting.
- 21:44I think one of the challenges here is probably a lot of this data is not easily offered up.
- 21:51There's probably not a lot of JSON APIs with low latency that are super easy to access or some there must be, but not.
- 21:58There's probably a lot of data out there that is not overly welcome to either be given out or it's given out over in batch over slow periods or something like that.
- 22:09Right.
- 22:09Maybe speak to a little bit about the data availability.
- 22:11Yeah, that's quite an issue.
- 22:13And I know mostly about the soccer data, but I can imagine that the same applies to most of the other sports.
- 22:21And I think data availability is a major issue, at least if you want to encourage the community to work with it and do research on it and get people build more cool stuff without being within a club.
- 22:36There are some companies that already provide quite a big setup of open event data.
- 22:41Statsbomb is one of them.
- 22:43I think they provide around 1,500 data sets for event data.
- 22:48But if you're looking at the tracking data, maybe there are like 10, maybe 15 sets available because all those vendors have deals with the leaks.
- 22:58They are not allowed to start it.
- 23:00So you have to know someone within a club.
- 23:03Or use a beautiful soup or scrapey or something like that, right?
- 23:07That's the other option.
- 23:08But then it's still very hard to get the tracking data because I'm not sure if you can actually scrape it.
- 23:15But that's one of the things that I noticed when working on the open source of Piesport's website.
- 23:23There are really a lot of scrapers.
- 23:25And I think that's an indication that there's an issue with data availability.
- 23:32Yeah, it's not.
- 23:32This plugs into the API, but this is a scraper.
- 23:34Yeah.
- 23:35I guess it's worth pointing out or throwing out a bit of word of caution.
- 23:39Just because the website is publicly available and you can hit it with some kind of scraping tool.
- 23:45That doesn't mean you legally can do stuff with the data.
- 23:48You probably want to be pretty careful about that, right?
- 23:51Yeah, because I think even when it's not explicitly mentioned, most of the times it's not allowed to scrape the data at all.
- 23:59But also in soccer, there are quite some websites that are explicitly forbid it.
- 24:05And yeah, so the packages are there.
- 24:08And it's also a bit, I was thinking about should I include them or should I not include them?
- 24:13Because they kind of encourage non-legal actions, but yeah, not really sure about it again.
- 24:20Yeah, sure.
- 24:21I can see the case for both sides of that.
- 24:23But I just want to let people know, just be careful with what you do with the data.
- 24:28It's one thing if it's an academic research project and it's just for my own interest or whatever.
- 24:33Yeah, if you start scraping that entire website and trying to make money out of it, you should not do it.
- 24:38Or find a way to do it legitimately, right?
- 24:41But just don't sneak through.
- 24:43Yeah.
- 24:44All right.
- 24:44Well, I think it might be fun to, let's talk through some of the packages you have here.
- 24:52So if you go to PySport.org and there's a nav bar and on the left it says open source.
- 24:58And if people click that, then they end up with a whole bunch of, you know, I'll open it just this way for a moment.
- 25:05We can look at it and talk about it.
- 25:06So if you just click on it, it actually, there's a delay as it downloads.
- 25:10Yeah, there's still something I need to fix because, yeah, it's quite some packages.
- 25:16I mean, this is not a complaint.
- 25:17It's just, I don't know how many pages that is, but that's a really small scroll bar.
- 25:21What I noticed that's pretty cool is you can go in and there's a filter that you all have and you can filter by your language.
- 25:28Right now you have Haskell, Python and R and others.
- 25:31And then you can pick by sports and then you can pick by type of thing, right?
- 25:36So I filtered our discussion down to Python libraries just because, you know.
- 25:40We have a single title.
- 25:41Yeah.
- 25:41And you could also pick amongst the different types of tools.
- 25:46So we talked about the scrapers and probably to a lesser degree, the APIs, right?
- 25:51The API clients, which is cool.
- 25:52There are some in there.
- 25:53They say, here's the API and we just built a strongly typed package rather than just doing straight rest, which is great.
- 25:59But you also have models and calculators like for predicting things.
- 26:03And then IO for file formats, visualization, open data and databases.
- 26:08Right.
- 26:09So I encourage people to rather than try to read the whole list, which is hundreds and hundreds of packages to, you know, filter down maybe to the sport you're interested in or a couple of sports or the type of tooling you're interested in.
- 26:22Yeah.
- 26:22Yeah.
- 26:23I think filtering is a must, but maybe if you have plenty of time, you could just scroll and see what's interesting because it's still, I think, a very interesting list to see what's just what available and get inspiration.
- 26:37Yeah.
- 26:37It's quite a list.
- 26:38Yeah.
- 26:39Yeah.
- 26:39So what's the sort here?
- 26:40If I come here, how do I, how does this get sorted?
- 26:43Like, is there any meaning to the order they appear?
- 26:46Is it just when they were entered or?
- 26:47It's a good question.
- 26:49I also open source the data collection part of this website, but it's daily collected, at least to provide an update.
- 26:57And I think, I must say, I think there's an order.
- 27:01And when I added the packages, I think that's the order here.
- 27:05But to be honest, this can be pretty random.
- 27:08Excellent.
- 27:09All right.
- 27:09Excellent.
- 27:10All right.
- 27:10So here, I'll just sort of go through a couple of the scrapers here.
- 27:14And we can maybe dive into one or two potentially.
- 27:17So there's PyBall.
- 27:19We'll just go through just to give people a sense, right?
- 27:22Of the ones here, right?
- 27:23So there's PyBall, which is a Python API.
- 27:27Nice.
- 27:28Wrapper for stats.nba.com with a focus on NBA and WNBA application.
- 27:34That's pretty cool.
- 27:35I don't know anything about stats.nba.com.
- 27:38But it looks like, yeah, this is a whole website with all sorts of data.
- 27:42It's got players, teams, leaders.
- 27:44Looks great, actually.
- 27:45I think quite some people are also using this package.
- 27:49I think it's a mostly used package when working with basketball data.
- 27:54And it's not that they use the API to get this data.
- 27:59Yeah, you get quite a bit of data here.
- 28:00You've got like the player, their team, their age, their total number of points scored.
- 28:06A lot of stuff you can do to sort of compare them.
- 28:09And yeah, that's great.
- 28:10So if you're into basketball, I think it's a great start.
- 28:13It's also quite actively maintained.
- 28:17That's also one of the things that I intentionally mentioned on the list.
- 28:22Because some packages are not really maintained well.
- 28:25I think it's a benefit.
- 28:28Yeah, one of the things in the list that you call out is the number of contributors,
- 28:32the latest version, when the last commit was to the package.
- 28:36That's pretty cool.
- 28:37In the beginning, I thought, well, maybe I can just manually update the list.
- 28:40But then I decided, I think data engineering is fun.
- 28:47Let's find a way to automatically fetch the data and update it.
- 28:52Also, the license is pretty important to show it here.
- 28:56And also, I'm not going to commit to see how actively it's maintained, the latest versions.
- 29:01And also the contributors.
- 29:07Sure, the difference between a package with one contributor and one with 30 contributors.
- 29:13That's a big difference.
- 29:13It's a really big difference.
- 29:15Yeah.
- 29:15I think it's also good for people to see if there's a package with just a single contributor
- 29:21that might give an opportunity to contribute to it or work together.
- 29:26So PySport would like to encourage people to get involved in those projects.
- 29:31Yeah, that's a good idea.
- 29:31So that could help out here.
- 29:34Yeah.
- 29:34And each one of these packages, you can go in and open the details here.
- 29:37And it gives you a little bit more information.
- 29:39Like, for example, it actually lists the contributors and links to their GitHub profiles and choose
- 29:44their website and the GitHub page and PyPI and so on.
- 29:48Yeah.
- 29:48Yeah.
- 29:48And also, you can click on one of the contributes and see what other packages they built.
- 29:54Oh, really?
- 29:55Okay.
- 29:56So, like, if I click on this one, yeah, they've done just this one.
- 30:00Well, and this one, just a single one.
- 30:01Yeah.
- 30:02Some of them, they might have worked on multiple.
- 30:04I know Dependipods worked on a few.
- 30:05Yeah.
- 30:07That's a really nice contributor.
- 30:08Yeah.
- 30:09Yeah.
- 30:10Yeah.
- 30:10The absolutely prolific open source contributor.
- 30:13Yeah.
- 30:14Works on my project too.
- 30:15This portion of Talk Python To Me is brought to you by Influx Data, the makers of InfluxDB.
- 30:22InfluxDB is a database purpose built for handling time series data at a massive scale for real-time
- 30:29analytics.
- 30:30Developers can ingest, store, and analyze all types of time series data, metrics, events,
- 30:35and traces in a single platform.
- 30:37So, dear listener, let me ask you a question.
- 30:39How would boundless cardinality and lightning-fast SQL queries impact the way that you develop
- 30:44real-time applications?
- 30:45InfluxDB processes large time series data sets and provides low-latency SQL queries, making
- 30:52it the go-to choice for developers building real-time applications and seeking crucial insights.
- 30:58For developer efficiency, InfluxDB helps you create IoT, analytics, and cloud applications
- 31:03using timestamped data rapidly and at scale.
- 31:06It's designed to ingest billions of data points in real-time with unlimited cardinality.
- 31:11InfluxDB streamlines building once and deploying across various products and environments from
- 31:17the edge, on-premise, and to the cloud.
- 31:20Try it for free at talkpython.fm/influxDB.
- 31:24The link is in your podcast player show notes.
- 31:26Thanks to Influx Data for supporting the show.
- 31:32I didn't realize you could actually see all the projects that PySport knows about that that
- 31:37particular user works on.
- 31:38That's a cool aspect of it.
- 31:40I spent quite some time on fetching all the data and trying to combine it.
- 31:44Also, fetching data for PyTi and also do the similar for the R packages.
- 31:49Yeah.
- 31:49And seeing how to get all the available data on one place.
- 31:53It also tries to fetch images or screenshots from the readmes of the repo storage.
- 31:59That works for some.
- 32:01Oh, yeah.
- 32:01That's nice.
- 32:02Screenshots are really going to be very helpful.
- 32:04Less important on the scrapers, more on the visualizers, probably.
- 32:09But still.
- 32:09Yeah, definitely.
- 32:10What is opensource.pySport.org written in?
- 32:13It's written in React using Next.js.
- 32:19So it was also quite an adventure for me because it's the first application that might also explain
- 32:25why it's still a bit slow on loading because I didn't really dive into how to make it faster.
- 32:32It used still WIND.
- 32:33But in the backend, it's Python.
- 32:35It's using Luigi.
- 32:37Okay.
- 32:38That's, I still think it's a pretty interesting tool because it's really simple to set up
- 32:45like orchestration of some tasks.
- 32:48Right.
- 32:48Like the daily scraping, updating the packages and that kind of stuff.
- 32:51Yeah.
- 32:52And then there's a GitHub action that runs on a daily basis and then patches all the data
- 32:58and updates and commits it in a different branch.
- 33:01And that one gets deployed to the Purcell, I believe.
- 33:06Okay.
- 33:06Yeah.
- 33:06Very interesting.
- 33:07But if you are interested in the source, you can also, it's also HopeSource.
- 33:13Okay.
- 33:13Great.
- 33:14So, highball for NBA.
- 33:16We have the hockey scraper, which is for scraping NHL play-by-play and shift data with six contributors.
- 33:23That's pretty interesting.
- 33:25What you'll see on the filter list for every sport, there's a package also for the NHL, for
- 33:31ice hockey.
- 33:32That's a little bit less maintained, I think.
- 33:36But I have to, I'm not really sure if it still works because with those scrapers, it can work
- 33:43today and not tomorrow.
- 33:44It doesn't even necessarily mean that they were intentionally blocked.
- 33:48It could just be, hey, we've redesigned our site.
- 33:51Doesn't it look awesome?
- 33:52You're like, oh, the CSS selector is no longer pull up the thing.
- 33:55So, yeah.
- 33:57So, that's also on the scraping part.
- 33:59If it's last commit is like a while ago, it might be broken.
- 34:05Maybe, maybe not.
- 34:06Yeah, sure.
- 34:06All right.
- 34:07Let's see some more.
- 34:08I think the StatsBomb API is an official package.
- 34:12It's also cool that StatsBomb provides an open source package for accessing their data.
- 34:18Yeah.
- 34:18What is StatsBomb?
- 34:19I see that showing up in many places on these different packages.
- 34:22Yeah.
- 34:23StatsBomb is, I think, one of the leading providers of event data in football.
- 34:29And I think in both football and soccer and in football.
- 34:33So, they provide the event data.
- 34:35So, everything that happens on the pitch, like passes, dribbles, interceptions, everything.
- 34:41They are also one of the providers of the open data sets.
- 34:45Okay.
- 34:45Yeah.
- 34:46They've got a free data section.
- 34:47That's cool.
- 34:47Yeah.
- 34:48They proclaim themselves as data champions.
- 34:51That's kind of cool.
- 34:52Yeah.
- 34:53I think the data is pretty good.
- 34:55I think also one of the best in the market right now.
- 35:00But at least that's what I heard from some users.
- 35:03Sure.
- 35:04They even have courses.
- 35:05Modern scouting and data-driven recruitment.
- 35:08That's kind of interesting, isn't it?
- 35:10Yeah.
- 35:10You also have to figure out how to apply data science in your job.
- 35:16So, how to use it and how to use the data for scouting purposes.
- 35:21Yeah.
- 35:21If you work in a professional sports organization or even college sports, the U.S. at least,
- 35:28there's a lot of recruiting people up from lower levels.
- 35:31The tab is in all sports.
- 35:33But I think the data is really helping to make the number of players that you have to watch
- 35:40from the footage a lot less.
- 35:42So, if you can already make a short list instead of watching 15,000 players, then it's really
- 35:49convenient.
- 35:49Sure.
- 35:50Or maybe you're looking for a particular asset or a particular part of the play that a player
- 35:56is good at.
- 35:57Right?
- 35:57Maybe you're looking for a quarterback for a football team that is especially good at running
- 36:03the ball in addition to just throwing it.
- 36:05Right?
- 36:05You could ask the data for that and really narrow it quite quickly, I imagine.
- 36:10And then you have to work with the data, figuring out how to extract it.
- 36:14Because maybe that single metric that's really important for you is not available in the original
- 36:19data set.
- 36:20So, then you have to figure out how to work with the data and get those metrics out of
- 36:26the raw data.
- 36:27Yeah.
- 36:27Maybe it's something calculated or inferred.
- 36:29Yeah.
- 36:29And that's also one of the things that happens in soccer based on the tracking data.
- 36:34But it will probably happen also in football and all the other sports.
- 36:38That clubs will define their own metrics based on, for example, tracking data.
- 36:43And use that to figure out what players match their own play the most.
- 36:49Cool.
- 36:49Okay.
- 36:50So, yeah.
- 36:50That's what, as you can see, there's a bunch of stats bombs here.
- 36:53Pi Baseball, an MLB game, seem to be a couple of things around baseball data.
- 36:59And baseball is one of those games that's kind of, I feel like baseball is one of those games
- 37:05that was almost created by a statistician just so they could come up with stats.
- 37:10There's so many stats.
- 37:12And, you know, people get averages, you know, that what kind of hitter are they?
- 37:15Well, they're like a 0.3, you know, they're a 300 hitter.
- 37:19What are I, you know, 30% and all that.
- 37:22And I'm not a huge fan of baseball.
- 37:23I find it kind of a slow game.
- 37:25It's kind of fun to play, but to watch.
- 37:27And it's like, you know, same as golf.
- 37:29I don't watch those things.
- 37:30Yeah.
- 37:31I'm sure they're fun to play, but it's just like, in terms of stats, these kinds of games,
- 37:35there's probably a ton of stats here because it's all about stats there.
- 37:38I also believe that the baseball data science departments are one of the biggest departments
- 37:44overall sport.
- 37:45And maybe, but I'm not sure about it.
- 37:48You can also make a lot of impact there.
- 37:51Maybe.
- 37:51Sure.
- 37:52Because also in all the sport, for example, soccer, a lot of things has impact on the
- 37:57eventual outcome.
- 37:58It's also a discussion if all data is available to know what actually has the most impact.
- 38:06So that's also one of the discussions within the soccer analyst community.
- 38:11Yeah.
- 38:11For both of these, Pi Baseball and MLB Game, you can see from your Luigi automation.
- 38:18They're both quite, well, the MLB Game is not particularly up to date.
- 38:22I guess the Pi Baseball one is more up to date.
- 38:24But, you know, 13 contributors, 30 contributors.
- 38:27That's quite a lot.
- 38:28That's quite a lot.
- 38:29And the Pi Baseball was updated this month, right?
- 38:33But, you know, when I saw these, I'm like, oh, these are kind of similar.
- 38:36And then I look at your page here and I see, oh, well, Pi Baseball is, you know, way more
- 38:41up to date, modern.
- 38:42And you should check that out first, right?
- 38:43That's the kind of value you get for having the info.
- 38:45Yeah.
- 38:46That's also the intention that you have a quite quick overview of, yeah, how it's maintained
- 38:53it.
- 38:53And, yeah.
- 38:55Yeah.
- 38:55And that one also goes against the API.
- 38:57So let's see.
- 38:58A couple more.
- 38:59I guess it's worth giving a shout out to the NFL FastPie.
- 39:04That, well, you know, NFL's got a lot of data as well.
- 39:07What else?
- 39:07There's some college baseball.
- 39:09Here's one that I think is that shows up across a lot of the different categories because
- 39:12it seems to do a lot, which is Fast F1.
- 39:16Have you seen that?
- 39:17Have you played with this any?
- 39:17Also updated this month.
- 39:19I should dig into it because quite some contributors.
- 39:22And I think it's really interesting to also see the mode of sports or cycling or more of those
- 39:29sports to see what they are doing, how they're doing it.
- 39:32Yeah.
- 39:32I noticed looking through here that there's not a lot of motor sports compared to the other
- 39:36sports.
- 39:37And so people, if you're out there, like if you're an IndyCar or if you're in motocross
- 39:41or somewhere like, and you've got a package and shoot it over to these guys and have them
- 39:45put it in the list.
- 39:45That'd be cool.
- 39:46Yeah.
- 39:46The Fast F1, they've got a page here that has a bunch of things.
- 39:49It has access to timing data, telemetry, session results, and all the data is provided
- 39:55in an extended Panda data, pandas data frame format, which is pretty cool.
- 40:00Right.
- 40:01Integration with Matplotlib.
- 40:02There's an examples gallery too.
- 40:05You come over here and you can see it has things like position changes during the race.
- 40:10So this, it'll say, if you go up here, it'll do things like, you got to go forward, you
- 40:15know, go to the C, get season 23 race one or for race, I guess, rather than practice or
- 40:22qualifying.
- 40:22And that's Bahrain.
- 40:23And so then here's, you know, it has all the drivers, their time throughout the race, their
- 40:28position.
- 40:28You can see probably pit stop.
- 40:30There's a lot of cool stuff you can see in here.
- 40:31It looks really nice.
- 40:32And also with those examples, I think it's really helpful to get people started with those
- 40:38packages.
- 40:39Yeah.
- 40:40It's not exactly a Jupyter notebook.
- 40:41It's the HTML of a Jupyter notebook.
- 40:43But, you know, it's still exactly what you need, right?
- 40:46But I think you can even download it by a notebook.
- 40:49You download it right there.
- 40:50Absolutely.
- 40:50Yeah.
- 40:51Yeah.
- 40:51Yeah.
- 40:51And apparently two and a half seconds to generate this script.
- 40:54Let's see.
- 40:56You can even got cool visualizations like on the track, color it by speed around the tracks
- 41:03of the start.
- 41:03You know, there's a lot of cool data here.
- 41:05I'm not really sure why I haven't seen this one before, but yeah, it looks really, really
- 41:09cool.
- 41:09Yeah.
- 41:11When I looked, I looked around a couple of the different packages and this one, like
- 41:13the documentation and examples and stuff seem, seem super good.
- 41:16Okay.
- 41:17So that's the scrapers.
- 41:18There's many more.
- 41:20There's plenty more there.
- 41:21Another one, models, calculators.
- 41:23Maybe take us through some of the ones that stand out in this category.
- 41:26Like, for example, there's Lori's code for Metrica tracking data.
- 41:30I love it that it's just, it's Lori's code.
- 41:32Good job, Lori.
- 41:32Yeah.
- 41:33So this is mostly about how to also do all kinds of modeling on top of it, do predictions
- 41:39on top of data.
- 41:40You know, one of the packages that I think is pretty interesting is the soccer action.
- 41:45Yeah, of course.
- 41:46Again, it's soccer.
- 41:47There's only Python, possibly.
- 41:49But for example, they have soccer XG, which is, what is that?
- 41:53XG boost models for soccer event data?
- 41:55That's the expected goals.
- 41:59So what's the expected value for a certain shot?
- 42:02If it should go in or not.
- 42:05So it's also based on a position on the page, how many players are between the player with
- 42:13the ball and the goal.
- 42:14So you can use it to determine, yeah, how, if a player should score a goal and how many goals
- 42:22he should make.
- 42:23Yeah.
- 42:24Yeah.
- 42:24Yeah.
- 42:24Yeah.
- 42:24Yeah.
- 42:24I think this is actually one of the really interesting aspects is the model and calculate it.
- 42:28You know, the prediction side is pretty cool.
- 42:30There's quite some work to do for PiSports because, for example, the expected goals.
- 42:36There's also one of the things that I've seen in ice hockey.
- 42:39Also, in other sports where you have to score within a goal.
- 42:44And I think it would be cool to find a way to abstract it over all sports.
- 42:49Yeah.
- 42:49Because it is kind of the same idea, probably different data sets, but right.
- 42:54Like scoring in hockey and scoring in soccer is from a structural perspective of the data
- 42:59is kind of the same thing, even though it's really quite different in size of the goal and
- 43:04how easy it is and all that.
- 43:06Yeah.
- 43:06But I think we can still learn from the other sports and see how they did it.
- 43:10Yeah.
- 43:10Train up a model, but on different data, right?
- 43:12But same type of model, potentially.
- 43:14Yeah.
- 43:14Maybe some different features, but yeah.
- 43:17Yeah.
- 43:17So the next category is IO.
- 43:20And that obviously stats bomb is in here, right?
- 43:23Python package to parse, stats bombs, JSON data to CSV, which is cool.
- 43:27Some on soccer, the spattle format, which I have no idea what that is.
- 43:31Yeah.
- 43:31That's also one of the things they built to make like atomic data format.
- 43:37That's also kind of standardized.
- 43:41So there's some overlap between soccer action and cloppy.
- 43:44I think they mostly focused on how to eventually work with the data.
- 43:49So calculate also the expected threat and also like a contribution model.
- 43:55So for every action towards a goal.
- 43:59Right.
- 44:00Right.
- 44:00Okay.
- 44:01So maybe there's a takeaway and then a pass and a pass and then a score.
- 44:04Like all of those people should somehow get credit for that potentially, right?
- 44:08Yeah.
- 44:08Okay.
- 44:08Makes sense.
- 44:09But they also build the way to load the data.
- 44:12And they will currently also working together with them to see if we can make cloppy to load
- 44:20the data and have the cloppy package focus on loading it and standardizing it and then have
- 44:25the soccer action using it.
- 44:27So see how the Nego blocks can work together.
- 44:30Absolutely.
- 44:30We have the NFLDB, a library to manage and update NFL data in a relational database.
- 44:36That's kind of cool.
- 44:37All right.
- 44:37Let's see.
- 44:38The next category is the visualization.
- 44:40I think probably the most important part is probably the actual data acquisition, but
- 44:45the most desired part is probably the visualization, right?
- 44:48The data engineering part is not really, what do you call it, really sexy.
- 44:53I mean, no one sees it.
- 44:54The output is a structured CSV or packet file.
- 44:58So that's not really cool to show.
- 45:00But for example, the NPL soccer, I think it's a really, really nice package used by every
- 45:09person in the soccer community.
- 45:11Yeah.
- 45:12There's a lot of contributors here.
- 45:14Yeah.
- 45:14And the visualizations look really cool.
- 45:17Yeah.
- 45:18They also have a huge list of examples.
- 45:22Okay.
- 45:22So all kinds of, you can just copy and paste to create some pizza charts.
- 45:28I love them.
- 45:28Yeah.
- 45:29Yeah.
- 45:29We'll actually come back to the pizza charts in just a moment, actually.
- 45:32But yeah, these are some good looking visualizations here.
- 45:35Yeah.
- 45:35And I think the interesting thing about this package is that at some point there were two
- 45:40packages that did similar things.
- 45:42And then they decided, well, we should just work together.
- 45:45And they spent quite some time on integrating those packages.
- 45:48And then there was one.
- 45:50And I think that's really cool to see that instead of kind of competing, they decided to
- 45:56work together and make, I think, one of the most awesome.
- 45:59packages for the soccer community.
- 46:01It's really nice.
- 46:02It's really nice.
- 46:03There's a lot of soccer ones in here.
- 46:05Yeah.
- 46:05There's also one for a PT plot for American football, although I don't understand what PT
- 46:10stands for.
- 46:11And then the fast formula one is also in there.
- 46:14We already saw those pictures, but a lot of nice visualizations there.
- 46:17Yeah.
- 46:18And is that it for all the categories?
- 46:20No.
- 46:20Then there's the open data.
- 46:21Yeah.
- 46:21I think maybe when I look at this list, are some missing?
- 46:25Okay.
- 46:25It's still a bit limited on what data is available.
- 46:28That's something that we should work together also with leaks to see if there's a way to make
- 46:35some more data available.
- 46:36Yeah.
- 46:37They have it and they offer it publicly, put it in the list, right?
- 46:40When it's available, I would definitely add it.
- 46:43But there's already some interesting data.
- 46:46There may be a little bit smaller data sets, but you can definitely use it to start playing
- 46:52around with it.
- 46:52All right.
- 46:53So I think that kind of covers the list with the Python filter sort on.
- 47:00You wanted also to give a quick shout out to NFLverse, right?
- 47:04Because while not Python is quite a series of packages that does cool stuff in the NFL for
- 47:10that data, right?
- 47:11Yeah.
- 47:11So it's not Python.
- 47:13It's for our users.
- 47:14But I think what's really interesting there, what they did is they created quite some different
- 47:20packages, one for collecting the data, one for organizing it, one for reading the data,
- 47:26one for doing all kinds of modeling, one for creating the visualizations.
- 47:30And I think that's also an example for all the sports on how to make those packages available,
- 47:37making sure that everything fits together.
- 47:40Yeah, that's cool.
- 47:41It's under the NFL virtual organization, but a bunch of different projects.
- 47:45You know, you talked about having the data and stuff that's not immediately obvious or
- 47:50predictable.
- 47:50You might need a higher level sort of thinking about it.
- 47:53And one of them that stands out here is the NFL fourth, which is studies fourth down decision
- 47:58datas with the NFL version models, which is kind of cool because that's one of the big
- 48:03decisions that a coach makes and it can make the game or it can lose the game.
- 48:07And there's a go, no go decision, right?
- 48:09And there's a lot of, it's not just, well, they went this far, then they didn't make it.
- 48:13It's well, it was the, they had 30 seconds left in the game and they had to do it or, you know,
- 48:18because otherwise they were just going to lose anyway.
- 48:20Right.
- 48:21There's a lot of higher, like sort of inference and higher level things you want to bring into
- 48:25that rather than just 30% of the time they make it fourth down.
- 48:28Right.
- 48:29Yeah.
- 48:29And this, I think also one of the reasons they just built an entire package around it
- 48:33to work with it.
- 48:35Yeah.
- 48:35That's pretty interesting.
- 48:36Now, before all the Python people say, I don't want to learn R, I don't care about R, it is
- 48:40also worth pointing out that you can call R from Python.
- 48:44I don't know how much like the visualization stuff still works super well or anything like
- 48:48that, but you can use, or what is it called?
- 48:51R pi two.
- 48:53Okay.
- 48:54And you can end up, you just pass it in our file and then you start calling functions or
- 48:59whatever, get a, get a function out of it and call that function.
- 49:02So it's worth, you know, if, if you really, really want to use some of these packages, maybe
- 49:07it's worth doing a quick little integration and then turn it into a data frame, a pandas data
- 49:11frame and running with it or something.
- 49:13It looks interesting.
- 49:14It's definitely worth a try.
- 49:16It's nothing I've ever used, but I can see, you know, if you really care about NFL data
- 49:20and you really care about Python, it might be worth, worth giving those, those combos a
- 49:24look there.
- 49:25I think there is one package to work with, with their data from Python.
- 49:30So if you look at the list there, there should be at least one.
- 49:33I think it's not on their website on their GitHub page, but I think there's another one
- 49:39that integrates well with it.
- 49:41Sure.
- 49:41Right.
- 49:42Not under the organization, but maybe somebody else.
- 49:44Yeah.
- 49:44Yeah.
- 49:44Yeah.
- 49:45That does.
- 49:45Yeah.
- 49:46That's cool.
- 49:46Excellent.
- 49:47Maybe they use this, this integration.
- 49:49I don't know.
- 49:50All right.
- 49:51And then the last thing I want to talk about here is interesting on two levels.
- 49:55So you've got a playground.
- 49:57So you've got a playground.pysport.org, which is a hosted notebook to play with some examples,
- 50:03like in particular, Cloppy and MPL soccer, right?
- 50:06I think one of the issues or challenges for a lot of people also working within the bigger
- 50:11clubs is that they don't always have a background in programming.
- 50:15So often they start as a video analyst or working as a performance analyst, and then they think,
- 50:21well, there's data.
- 50:21I want to work with it.
- 50:23And if you need to set up your Python environment for the first time, it can be a bit overwhelming.
- 50:28So that's why I, for, well, there is JupyterLite, which is a very cool project based on Pyrodite.
- 50:37Let's see if, yeah, if you can use it.
- 50:39And it is just a start with the Cloppy and the MPL soccer package.
- 50:44I just fetched the notebook from there, from my gallery, integrated into this one, into the
- 50:51playground, and you can just start playing around with it.
- 50:55Yeah.
- 50:56And so here's a proper Jupyter notebook using all of their libraries and stuff.
- 51:00But what's awesome about this, as you said, based on Pyrodite, I'm not sure it necessarily
- 51:05actually stuck in people's minds.
- 51:08Like, this is running in WebAssembly on our front end, right?
- 51:11Which is pretty epic.
- 51:13It makes it really convenient for people to just start playing around with it without installing
- 51:18Python and working with virtual environments.
- 51:21You know how it works.
- 51:23Yeah.
- 51:23It makes it super easy for you to host it because all you're doing is serving up static files.
- 51:28You're not hosting, you're not running a Kubernetes cluster or anything like that, right?
- 51:32Trying to prevent abuse of it and so on.
- 51:34Yeah.
- 51:34Yeah.
- 51:34So, yeah.
- 51:36Multiple sites make it good for me and for the people using it.
- 51:41For sure.
- 51:41And it even does that wild, what's it called, pizza plot, that kind of style of plot that
- 51:47we're looking at.
- 51:48And it runs fast and great.
- 51:50Yeah.
- 51:50This is really, really nice.
- 51:51Yeah.
- 51:52Are you happy with Pyrodite or JupyterLite?
- 51:54Yeah.
- 51:54Yeah.
- 51:54There was some issues with it, especially around working with fetching data because some
- 52:03of these try to fetch the open data from SlabsBomb or also some fonts and stuff like that.
- 52:09Yeah.
- 52:09So we had to work around it.
- 52:11And it's also what you see on top of here is the patching of the request library to make
- 52:18it work in JupyterLite.
- 52:19Yeah.
- 52:20I think it's better to have a working version than not patching it.
- 52:26I think it's great.
- 52:27And then everything that uses requests can just do its thing.
- 52:30Yeah.
- 52:31This is really cool.
- 52:31When I saw that you had this, I thought, oh, this is clever that it's based on Jupyter
- 52:35Lite.
- 52:35And it's really nice.
- 52:37Yeah.
- 52:37Yeah.
- 52:37So people can check that out.
- 52:39Maybe people out there listening maintain some of these packages and have notebooks.
- 52:43Like if they get them working here, could they submit them to you and have them added
- 52:47in this list?
- 52:48The entire playground is part of the PySupport organization on GitHub.
- 52:53You can just watch, see the repository and make a pull request.
- 52:57And I will just review it and merge it.
- 53:01And then it will be available here.
- 53:03Yeah.
- 53:04That's awesome.
- 53:04So I'm really happy for more packages here.
- 53:06More examples.
- 53:07Yeah.
- 53:09More examples would be very welcome.
- 53:10Excellent.
- 53:10All right.
- 53:11Well, I think we're getting pretty much short on time for talking about sports analytics,
- 53:17but really, really good work there.
- 53:19Now, before you get out of here, I have the final two questions for you.
- 53:22I always ask.
- 53:23Notable PyPI package, something you've come across.
- 53:25You're like, oh, this library is awesome.
- 53:27People should check it out.
- 53:28I mean, it's kind of the whole topic of this show.
- 53:30So we talked about, you know, maybe a hundred.
- 53:32We didn't mention them all, but went through a list of a hundred different Python packages.
- 53:37But something you want to give a shout out to that you think is cool out there?
- 53:39I'm not really sure if the entire Python world already knows it.
- 53:43But on the last PySupport meetup, I made an example using DuckDB.
- 53:48That was something that people didn't know about it, especially with integration with Pandas data frames,
- 53:55that you just build a data frame and run queries directly on top of it.
- 53:59Yeah.
- 54:00Interesting.
- 54:00I heard a DuckDB, but I didn't realize the Pandas kind of direct integration.
- 54:05It also has direct parquet.
- 54:07Interesting.
- 54:08Okay.
- 54:08That makes it quite easy to also play around with SQL queries.
- 54:14And I was very happy that I had a presentation on last PyData Eindhoven conference.
- 54:20Yeah.
- 54:20I think it's a package that, well, not everyone, but it's really worth checking out because it can make your life easier.
- 54:28I think it's just a Swiss army knife for data engineering.
- 54:32And yeah, I think it's a nice one.
- 54:34Yeah.
- 54:35Great recommendation.
- 54:36And if you're going to write some Python code, what editor are you using these days?
- 54:39I'm using PyCharm.
- 54:41So I'm not, yeah, not sure if it's cool.
- 54:44I love PyCharm.
- 54:45PyCharm is awesome.
- 54:45Okay.
- 54:45Excellent one.
- 54:46Yeah.
- 54:46So I guess final call to action.
- 54:48People are interested in open source sports analytics.
- 54:51They're open and maybe interested in PySport, want to contribute back or, you know, be part of it in some way.
- 54:57What do you tell them?
- 54:57Yeah.
- 54:58You can reach out on Twitter or LinkedIn to see where you can contribute.
- 55:05And I think it's also, if you're not working in the support domain and would like to contribute, please reach out because I think the knowledge from outside of sports is really useful within sports.
- 55:15So there are a lot of options to contribute and, yeah, make an even more community and make a more better community.
- 55:22Yeah.
- 55:22Absolutely.
- 55:23All right.
- 55:24Well, thank you so much for being here and sharing all these projects you've collected.
- 55:27Thanks a lot for being on the show.
- 55:29It's really, really nice.
- 55:31Yeah.
- 55:31Thank you.
- 55:32You're welcome.
- 55:32Bye.
- 55:32Bye.
- 55:33Bye.
- 55:34This has been another episode of Talk Python To Me.
- 55:37Thank you to our sponsors.
- 55:38Be sure to check out what they're offering.
- 55:40It really helps support the show.
- 55:41The folks over at JetBrains encourage you to get work done with PyCharm.
- 55:46PyCharm Professional understands complex projects across multiple languages and technologies,
- 55:52so you can stay productive while you're writing Python code and other code like HTML or SQL.
- 55:58Download your free trial at talkpython.fm/donewithpycharm.
- 56:03Influx Data encourages you to try InfluxDB.
- 56:06InfluxDB is a database purpose-built for handling time series data at a massive scale for real-time analytics.
- 56:13Try it for free at talkpython.fm/InfluxDB.
- 56:17Want to level up your Python?
- 56:19We have one of the largest catalogs of Python video courses over at Talk Python.
- 56:23Our content ranges from true beginners to deeply advanced topics like memory and async.
- 56:28And best of all, there's not a subscription in sight.
- 56:32Check it out for yourself at training.talkpython.fm.
- 56:34Be sure to subscribe to the show.
- 56:36Open your favorite podcast app and search for Python.
- 56:39We should be right at the top.
- 56:40You can also find the iTunes feed at /itunes, the Google Play feed at /play,
- 56:45and the direct RSS feed at /rss on talkpython.fm.
- 56:50We're live streaming most of our recordings these days.
- 56:53If you want to be part of the show and have your comments featured on the air,
- 56:56be sure to subscribe to our YouTube channel at talkpython.fm/youtube.
- 57:01This is your host, Michael Kennedy.
- 57:02Thanks so much for listening.
- 57:04I really appreciate it.
- 57:05Now get out there and write some Python code.
- 57:07Thank you.
- 57:07Thank you.
- 57:28Thank you.