Brought to you by Michael and Brian - take a Talk Python course or get Brian's pytest book


Transcript #283: The sports episode

Return to episode page view on github
Recorded on Tuesday, May 10, 2022.

00:00 Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.

00:05 This is episode 283, recorded May 10th. And I am Brian Okken.

00:09 I'm Michael Kennedy.

00:10 And I am Tanya Sentence.

00:12 Well, welcome, Tanya. Since we're just meeting also, and some of our people might not know who you are, tell us a little bit about yourself.

00:18 Sure. Well, thank you so much for having me today. I'm very excited to be here. So my name is Tanya, and I'm currently a Python developer advocate at a company called DeepGram.

00:28 And so at DeepGram we do speech-to-text, speech recognition technology.

00:33 I would say that my path to technology is a little bit unconventional.

00:36 I come from an athletics background.

00:39 I started playing basketball when I was five years old.

00:41 I won't tell you how old I am now, but.

00:43 (laughing)

00:46 So yeah, so I played basketball in college, I played professionally in Europe, and a little bit in the WNBA, and then I got into sales, and then from sales I got into tech.

00:54 So yes, it's been very unconventional.

00:56 - That's pretty awesome.

00:57 I wish we could jump in deeper, but yeah.

01:00 - Yeah, that is super awesome.

01:01 And you know, as you're telling us that, I'm listening and you think about all the stats and statistics and graphs and visualizations and optimizations of sports, right?

01:11 Like these Python and programming skills are actually pretty relevant.

01:15 Although maybe you were just deep down in the sport side and then got into programming afterwards.

01:20 - Yeah, so yeah, I think you're totally right.

01:22 I think Python is like the perfect language for doing a lot of stuff with like stats, like sports, such as the six and things like that, and like the visualization of it.

01:30 But yeah, I started getting into coding when I was a kid actually, but then I stopped for a long time because, who would have thought list things about coding or computers would have taken off and be where it is today.

01:42 >> Yeah, absolutely.

01:43 >> Yeah.

01:43 >> Fascinating as that is, let's take a different path, Michael.

01:47 >> Yes, a different path and indeed a fine transition there, Brian.

01:50 This one was sent over, recommended to us by one of our listeners, Spencer.

01:55 So thank you, Spencer, for sending this in.

01:58 And we talked about things like FS spec and other ways in which you could sort of abstract away, just like I'm talking to a file, but oh, hey, that happens to live on Azure Blob Storage or AWS or Google Cloud Storage or something like that.

02:11 So this one is called Pathy, a path interface for local and cloud bucket storage.

02:17 So if you've got data that's stored in, at the moment, AWS or Google Cloud Storage, And that AWS one, that's S3.

02:25 So I suspect that means like Linode and any other S3 compatible storage.

02:32 You know, there's many of these places that have object storage for their cloud services that are basically wrapping up the AWS story.

02:39 So this might be much broader than actually just those two clouds.

02:42 Anyway, the idea is that this is a Python package with type annotations they like to call out, which is great for working with cloud bucket storage using Pathlib.

02:52 So Pathlib is great, right?

02:53 we can create a pathlib and give it a path and it has things like make directory or the parent of the parent of this thing or does it exist and so on.

03:03 So if you like working with path, the path class from pathlib, how about turning that loose against cloud storage?

03:10 That's cool, huh?

03:11 - Very, yeah.

03:12 - Yeah, it's very awesome.

03:13 - Yeah, so what's nice about it is you basically give it a URL with some type of scheme, you know, traditional schemes are like HTTP, HTTPS, but like GS for Google Cloud Storage or something in here that I'm not seeing for Azure, not Azure, AWS, but you give it just the prefix or you just give it a local file path and it will determine which that is and just start talking to that platform, which I think is actually pretty neat here.

03:40 So yeah, basically if you wanna work with cloud storage using Pathlib, well then here you go.

03:48 It also supports caching locally, which is neat because that's one way in which you could get all of your cloud files sort of downloaded and replicated locally as well.

03:58 And then Spencer had a quick comment saying, "The really cool function is fluid." So down here, with fluid, you can take any type of local Google Cloud Storage or S3 path string, and it'll just give you a path object that lets you interact with it agnostic of the platform.

04:14 So basically, like I was saying, you say S3 colon or GS colon or just a local path, and it'll just give you back a Pathlib and you don't care where it is.

04:23 Is it in the cloud?

04:23 Is it local?

04:24 Who cares?

04:25 Because it's just, you know, it's abstracted that away using Pathlib.

04:29 And I don't know about you too, but I had been a bit of a holdout on Pathlib.

04:33 It was all import, you know, system.io or import.io, whatever it was, and just use the IO way of working with it.

04:41 But I've really come to like Path and Pathlib last year or two.

04:45 - Yeah, I really, I love the interface.

04:47 It's easier to program into me.

04:51 Just feels easier, it feels more obvious.

04:54 >> Yeah, this is great.

04:56 I've been wanting to do more with Cloud technologies.

04:59 I think this would be a really good place to start.

05:01 >> Yeah, and so much of that possibility is just working with static files on S3 or static files in Blob Storage and other places.

05:10 >> Yeah, sure.

05:10 >> I'd love to not have to care about that.

05:13 >> Yes. If I could just not do Boto3, That would be fantastic because that thing drives me crazy so much.

05:20 Don't give me another rant.

05:21 Ryan, talk about your topic.

05:23 Save me from ranting about Boto3.

05:25 >> Okay. Well, let's talk about Robin.

05:27 Robin, for one, is just an awesome logo.

05:30 >> It's a bird being hugged by a snake. I love it.

05:32 >> That's pretty clever. What is Robin?

05:36 There's a Robin is a async web server in runtime written in Rust.

05:43 That's pretty cool and actually, it's kind of been taking off in popularity and stuff.

05:48 But the, so there's, we're going to link to a bunch of stuff.

05:51 One of them is the Hello Robin blog post written by the author.

05:56 And so Robin is a fast, high-performance Python web framework with Rust runtime.

06:02 So what does that mean?

06:03 It means that it's kind of like Flask.

06:06 It looks a lot like, in one of the examples, it looks a lot like just a little Flask thing.

06:13 You can do app gets and app puts and different things.

06:16 It's decorators. It's very new.

06:18 There's a lot of work to be done, so there's not a lot of ecosystem around it yet, but it's pretty cool.

06:27 I just like this idea of, well, let's make the code you write look like Python.

06:33 It is Python, but the back-end stuff, maybe you don't care what that's running on and maybe Rust is fine.

06:41 So one of the things it doesn't have an ASCII or ASGI or WSGI underlying, because that's a Python thing.

06:49 It is async.

06:50 It's very Flask-like.

06:52 And the numbers kind of look impressive.

06:55 And I know that benchmarks, you have to read those with a grain of salt. But still, requests per second getting--

07:03 so we've got this document showing Flask with gunicorn at 1800 requests per second, but Robin going at 6400 requests per second.

07:15 And this is this kind of insane.

07:17 So definitely worth checking out and trying, I think, or maybe not trying, but just watching to see what this does, though, since it's very new, though.

07:26 One of the things I have to say is there's there needs to be some it's not really newbie friendly then, I guess, because there's not a lot of docs yet.

07:35 There is a there is a doc site started, but But there's a lot of work to do, but still getting started with it.

07:41 If you have a really fast thing, it's pretty good.

07:44 So, oh, go ahead.

07:47 >> Yeah, well, a couple of notable things that stand out to me.

07:50 One, it supports async and await, and it supports multi-threading at the rust layer.

07:57 So combine those two things and you might end up in a really interesting situation which is probably where it's getting a lot of its high numbers in that benchmark from.

08:05 >> Yeah.

08:05 >> So that's great. It looks really simple.

08:08 You know, it's very Flask or fast API like, so that's cool.

08:13 One thing that's notably missing that I haven't seen is like, how do I render an HTML page from it?

08:19 It shows how to serve static files, which can be an HTML page, but I'm thinking, you know, Jinja templates, Chameleon templates, equivalent of Django templates, like that's sort of the missing bit of a dynamic interactive website.

08:31 - Yeah.

08:32 - That also has an API.

08:33 You could just import Jinja and configure it yourself import chameleon and configure itself.

08:39 And I've done that in some of my like, decorator API or a wrapper things for adding that onto API calls.

08:47 But you know, that's just a layer of a thing you've got to learn to use it instead of just saying, here's a template or render this template or whatever, right?

08:54 So I would love to see some sort of template support come built in.

08:58 >> Yeah. And I think that's something that definitely could be put in place.

09:03 >> Sure. No, it's actually not very hard at all.

09:05 It's just, it just doesn't, I just didn't.

09:07 - Doesn't have it yet.

09:08 So target market, maybe just APIs?

09:13 - Yeah, it's got a lot of examples of JSON type of exchange, right?

09:19 - Yeah. - Tanya, what do you think?

09:20 - Yeah, I was gonna ask, what does that come with?

09:21 Like when you pip install it, what other packages does that come with?

09:25 It doesn't, does it indicate?

09:27 I'm just curious.

09:28 - Well, it's, we could look.

09:31 I don't think there's much else there.

09:33 We've got the--

09:34 - There's very little here.

09:36 - Okay.

09:36 (laughing)

09:37 - Yeah.

09:38 - Yeah, if you look at, Brian, open up the just the requirements.txt file there and you'll get, see it's like, - I was--

09:48 - Yeah, the last file there.

09:49 - Okay.

09:50 - Like that's the super small list.

09:52 - Oh wow, okay.

09:53 Yeah, I mean, you have to start somewhere, right?

09:54 So I think it is definitely a good start.

09:56 It does seem like a lot of the, not a lot, maybe the last few frameworks, web frameworks that have come out in Python here, - Yeah, they do kind of model apps for Flask.

10:04 - Yeah, yeah, yeah.

10:05 - Yeah, I've been doing quite a bit in FastAPI and Flask as well, 2.0.

10:09 - Yeah, cool, yeah.

10:10 I think Flask has become very popular in its own right, but it also, its idea of how web apps should look in Python has spread to all the other frameworks that are kind of new, right?

10:20 Like FastAPI is a variation on that.

10:22 - Yeah.

10:23 - And I can't remember where I read it, but there was a part of this Robin documentation that talked about just, is like almost started out as a, I think a college project or something of like, what if I built Flask, but async in it or in the target, it ends up being sort of like fast API.

10:41 So fast API, yes, you can render websites with it, but the original focus wasn't websites, it was APIs.

10:48 And I think this is, it's even an earlier stage thing than fast API.

10:55 So I think it's definitely worth watching.

10:59 There is a talk from last fall that's linked to, on I think the main page.

11:04 And then Henry Schreiner in the audience says, "Robin had a lightning talk at PyCon." So check that out too. - Nice.

11:13 Oh, nice.

11:14 Yeah, I shouldn't, I didn't hear about that, but nice.

11:17 - Yeah, absolutely.

11:18 Brian, scroll down to just where it says Y and other framework real quick.

11:22 Just a bit more.

11:23 Yeah, so one of the interests, this is pretty interesting to me And it could be a sign of things to come, or it could be just really great for Robin.

11:31 It says one of the things they're trying to get around is the execution.

11:36 Traditionally, a lot of these frameworks has been with Python.

11:40 So Python has the gill, which is rough on parallelization and so on.

11:45 It says this is using the Rust runtime and server, which attempts to work around the gill in order to improve performance.

11:52 So if you could set yourself free from the gill, well, I don't know, maybe it hosts like multiple little pythons per thread or something.

12:00 That's pretty cool.

12:01 - That's one of the things I'm wondering is if the runtime's in Rust, how is it launching your code for the callbacks?

12:08 But I don't know.

12:09 There is a, the documentation does have architecture docs.

12:13 So if you're, actually it's very well documented architecture wise, it's not well documented for how to use it wise, but.

12:19 - Yeah, yeah, indeed.

12:20 All right, well, good find that one's great.

12:22 All right, Tanya, off to your item next.

12:25 - All right, this is, oh wait, this is Sports-a-Pie.

12:30 So, somebody told, I mean, okay, so for those of you who don't know, I'm really big into sports, right?

12:35 I'm a huge NBA, NFL, baseball, hockey, football fan.

12:40 So I'm doing a lot now with, you know, writing some app, web application, sports web application.

12:49 So this is a library that somebody sent me called SportsApi.

12:53 It's a free sports API written for Python.

12:56 And what it does, it actually pulls stats from sportsreference.com.

13:02 I believe it's sports-reference.com.

13:05 And that site, it's a great website.

13:07 That site is for getting sports statistics for like professional sports, like the NBA, NFL, NHL, Major League Baseball, and college basketball and football.

13:17 And it's funny because yeah, it is really cool.

13:19 And that site, it looks like a sports reference that Tom looks, kind of looks like a, you know, like an HTML site from like the nineties.

13:25 It does look like the dream of the nineties.

13:27 It's alive.

13:28 Doesn't it?

13:29 Oh my goodness.

13:30 It really does.

13:32 So I think it's also great for, you know, if you want to like learn or do some like web scraping, but of course, you know, email this site or a source.

13:37 I believe that is allowed on that site.

13:39 But anyway, so back to the API of sports, a pie you can get like a lot of API queries for all the, mainly the North American sports, I was saying the NBA, NFL, National Hockey League, Major League Baseball.

13:53 You can get the list of teams for that sport, the date and time of games, the total number of wins for a team during the season, and much more.

14:03 You can also get stats from players and from box scores.

14:07 So you can build some cool stuff around sports and how teams or players perform during a game or during a season, or do something even better with it.

14:16 - This is super cool.

14:18 - Yeah.

14:19 - It's got a kind of a nice object oriented model.

14:22 So like, you know, from sports supply.nfl.teams, import teams, and then you can create a, like a Detroit team or whatever.

14:31 And then, or Purdue and get their schedule, even has integration with pandas.

14:36 So you get like a data frame out.

14:38 This is neat.

14:39 - Yeah, I haven't used this one yet.

14:40 I just had another one that we'll talk about later this afternoon.

14:44 Yeah, I want to try this out as well.

14:46 Because like I was saying, I'm always on sports, warfare dot com.

14:50 Just check out the stats from the games.

14:52 People ask me a lot of times for API so they can build interesting examples or play around and stuff.

14:58 And it's so much of this tied into either college or professional sports.

15:04 That information is really wrapped up and hard to get.

15:06 Right. It is.

15:07 Yes. Yeah.

15:08 It has been for a long time.

15:10 I think it's becoming a little a little easier, but it's For some reason, I remember like five, seven years ago, like I wanted to do stuff with sports, like build applications with sports, but I couldn't find an API that had sports data.

15:24 Everything was kind of locked down.

15:25 - Yeah, yeah.

15:26 Well, I can start with this five-year-old CSV file.

15:29 I guess that's what I'm gonna build.

15:30 It's not so inspiring, but this looks really good.

15:32 - Yeah, cool.

15:33 - Great news.

15:34 - Cool.

15:35 - Great.

15:36 All right, now, before we move on, Brian, let me tell you about our sponsor for this week, okay?

15:42 - Okay.

15:43 So this episode is brought to you by Compiler, from a podcast from Red Hat.

15:48 So just like you all out there listening, Brian and I are fans of podcasts.

15:52 I'm happy to share a new one from Red Hat, Compiler, an open, an original podcast from Red Hat.

16:01 So with more and more of us working from home, it's important to keep human connections and not just be stuck in our work from home setup.

16:08 And Compiler unravels industry topics and trends and things you always want to know through interviews with people who know it best and telling the stories of technology, not just the howls of it.

16:19 So on Compiler, you can hear a chorus of perspectives from diverse communities behind the code.

16:24 These conversations include answering big questions like what is technical debt?

16:28 What are tech hiring managers actually looking for?

16:31 And do you have to know how to code to get started in open source?

16:35 I actually was a guest on Red Hat's previous podcast, Command Line Heroes for their Python episode and it was super well done, really polished, and compiler follows along in that excellent tradition.

16:47 So I checked out episode 12 of compiler, how we should handle failure, really creating a space for people to grow technically and not get fired just for one mistake, but how do you create an environment where people are willing to grow and try things like, well, let's try out Robin and try that, and if it doesn't work, well, we gave it a good try.

17:05 You've learned something.

17:06 So learn more about them at pythonbytes.fm/compiler.

17:10 The link is in your podcast player show notes.

17:13 I know you all out there listening, you can just go to your podcast app and type compiler, but please visit pythonbytes.fm/compiler and just click the link for your podcast player.

17:20 There's like tons of them here.

17:23 That way they know it came from us.

17:24 So thank you Red Hat and Compiler for supporting our show.

17:28 All right, Brian, you ready for the next one?

17:29 - I am.

17:30 Give us a shot of terminals.

17:33 - A shot of terminals.

17:33 I seem to have messed up my tabs though.

17:35 So let me just open that back up here.

17:38 Here we go.

17:39 So this one comes to me, I believe from Jay Miller.

17:41 I'm pretty sure he's the one who told me about it.

17:43 So thank you, Jay.

17:44 And the idea is really simple.

17:46 I want to create a screenshot of something I'm doing for a demo code.

17:51 You know, I create a lot of courses and presentations, so it's super helpful for that.

17:55 Tanya's doing DevRel, and she's, I'm sure, doing lots of presentations where there's like, I need a screenshot of this thing and brand me for books and so on.

18:03 - Yeah, I could totally use this.

18:03 - So this might, yeah, This thing might turn out to be super useful.

18:06 So what it is, is it's a thing, you brew install it, and then, or there's different ways in which you can install it.

18:15 It's a little bit like carbon.now.sh, or if people have seen that, and you can capture some kind of output in your terminal exactly like it looks directly to an image.

18:25 And you can even specify, I would like to pipe that directly to whatever app you edit screenshots in.

18:32 So for example, I use Pixelmator Pro.

18:35 So I might just say, take this, run this command, take the screenshot and then open it in Pixelmator Pro, go and stuff like that.

18:42 So really, really nice.

18:43 The way you run it, it's a little bit like time or watch or perf.

18:46 So you just say term shot and then like Python, some file or whatever it is you're trying to do.

18:53 Here's an example of one that I did on, this is a program using Colorama to make interesting colors on the screen, doing async and await examples of like doing a bunch of requests against DocPython and then pulling back the titles using beautiful soup.

19:09 And I just said, term shot, Python program, boom.

19:13 And out it comes with this really nice looking picture, exactly the right size.

19:17 So however long the scroll back is like, like that's the size of the screenshot.

19:21 You don't have to like, you know, take a picture, zoom, scroll down, some take another picture, try to fit it back together, all that kind of a weirdness.

19:28 So yeah, really neat.

19:30 Yeah.

19:31 And then the final thing is, if for some reason it's more complicated than one line of just Python this, but you're like, I want to run three commands.

19:40 So maybe what I wanna do is I wanna show that I'm SSHing into a server, then I'm running this command and then I'm open, you know, I'm seeing the result of that or something like that through like LS.

19:50 So if all else fails, you just type term shot and you give it some shell, like you could say, slash bin slash Z shell ZSH or slash bin slash bash.

20:01 you do your work and once you exit the shell, it'll just take a screenshot of whatever you did while you were in there.

20:07 That's also pretty good.

20:09 >> That takes less thinking. I like that.

20:11 >> Yeah, it does.

20:12 >> Exactly.

20:14 >> Yeah, it's so interesting. You're mentioning Coloramo.

20:17 Michael, I learned about Coloramo from you.

20:19 Actually, I took your asynchronous programming course.

20:24 >> Oh, you did? Oh, how amazing.

20:25 >> Yeah.

20:26 >> Thank you.

20:27 >> Yeah, of course.

20:28 >> Yeah, that example was from that course for sure.

20:30 - Okay, yeah, yeah, I look familiar.

20:32 - Nice. - Cool.

20:33 - Yeah, what I thought was neat about it is it, like, even with just non-standard print output and stuff, it still captures it, you know, reliably, which is nice.

20:40 - So when you run that command, it takes a screenshot and it saves it to, I don't know, your desktop or, so now like with Carve a new pen, you know, you can like click a button and it'll save it, you know, or just save it and then you can just paste it into wherever you want to.

20:54 - Yeah, exactly.

20:55 I don't think it goes to your, I think it goes to whatever working directory you happen to be in.

20:59 - Okay.

21:00 - Just wherever you ran the command in that directory, there's an out.png.

21:04 - Okay.

21:05 - There's probably ways to specify it or whatever, but by default, it just drops that png file there.

21:09 Yeah, it's super handy for presentations, I think.

21:12 - Yeah.

21:13 - All right, over to you, Brian.

21:14 - Well, I want to talk about the GIL.

21:17 We talked about it a little bit earlier, but so Itamar Turner-Troring wrote an article called, "When Python Can't Thread, a deep dive into the GILs impact.

21:30 And what I really like about this article is just that the focus of it is to try to build, not the specifics of everything around the GIL, but as a user of Python, what's the mental model that you need to be able to utilize threading and multiprocessing and different extensions correctly to try to figure this out so that you just have a gut feel for how things work so that you can work through it and everything.

21:59 There's a little bit, it's kind of in the middle of the article, there's a mental model that he presents.

22:05 And I'd like to talk about a little bit some of the other cool aspects of the article, but first the mental model he's going for is a thread must hold the gill to call a CPython API.

22:17 And so anything that any Python code that's using API like built-in Python calls is gonna block because it's gonna grab the gill.

22:30 Other threads can't run if the gill is there, but if you're doing pure Python stuff, your stuff gets interrupted every five milliseconds automatically.

22:40 I didn't know this, but that's kind of cool.

22:43 Long running things, so if you have a sleep or some other extra process that takes a long time, not Python code going through, but like a sleep or something, or you probably don't have a long sleep, but maybe you're reading a file or something.

22:59 Something that--

22:59 - Talking to a database, something like that.

23:01 - Yeah, it doesn't automatically interrupt every five milliseconds.

23:05 So the five milliseconds isn't guaranteed.

23:06 So there's blocking possibilities.

23:09 And then Python extensions written in C or Rust or something can explicitly release the GIL to allow, so you can get around this with extensions and stuff.

23:22 So that's the mental model, but to really sync at home, he's got a whole bunch of these profiling graphs that are great.

23:31 So here's an example of a little program that starts, there's like two functions, it's really a main and a go, and essentially you end up with two threads, like the thread starts this go thing, and then you run go within the main thread also.

23:46 So what this is, it's just doing like some summing of a whole bunch of numbers, but the examples just to keep busy for a while and and and then look at what happens and what happens is you get you get these meant these shifts of like one of them is spinning around, but the other one's just you know this toggling back and forth that happens kind of cool.

24:09 There's the all the different models that can happen and like here's one where you're Let's see, what are we doing here?

24:19 It's sleeping for a while, so it's completely blocked.

24:22 You've got one thread that's just completely blocked for a long time.

24:26 The visuals of the profile are great to visualize what's going on.

24:31 Anyway, at the end of the article, he talks about how to get around it and when and where and how to use different models like Async and extensions and things like that.

24:42 Anybody that's really caring about this stuff, I think this is a great article.

24:46 the visualizations are quite neat.

24:49 You know, instead of just saying you're spending this much time in a particular function, it says and you're waiting or you're doing CPU work, right?

24:58 And you can actually see those side by side and see like the CPU's here.

25:02 Because normal profilers will just tell you, well, you're spending time, you know, here, what are you doing?

25:08 Yeah, exactly right.

25:09 Yeah.

25:09 It's really helpful.

25:11 I learned visually, I'm like very, you know, large visual learner.

25:16 Yeah, like the GIL is something that's always kind of like, I don't know, just, it was really confusing to me.

25:21 You know, when I was first starting out and getting into more intermediate stuff. But I took this, it was like a Python deep dive course where the instructor really kind of like, talked about things behind the language.

25:33 You know, so it really kind of helped me grasp and wrap my head around it more.

25:37 But yeah, this is great. I love this.

25:39 Yeah. Nice work, Itamar.

25:41 This is definitely a good one. I like the pictures as well.

25:44 All right.

25:45 How do you want to take us out?

25:47 And I apologize.

25:48 I believe I switched the order of your two topics.

25:50 That's okay.

25:51 No worries.

25:52 I hope I didn't throw you off there.

25:54 That's okay.

25:55 So this is the NBA.

25:56 Okay.

25:57 So this one is the NBA API.

25:58 So this one is just strictly for the NBA, National Basketball Association.

26:03 This is really close to home for you, right?

26:04 This is like your world.

26:05 Yes, very close to home.

26:06 Yes.

26:07 It brings back memories.

26:08 So, and right now with, you know, NBA playoffs happening, I think this is pretty exciting.

26:13 So this package is maintained by a gentleman named Swarup Patel.

26:17 He does a very great job of maintaining it, it's very up to date.

26:21 This API pulls data from the NBA.com, right, that's the official website of the National Basketball Association.

26:30 With this package you get more accessible endpoints.

26:35 The documentation is really good, I think it's a really well documented API.

26:42 Let me see what else here.

26:44 The NBA.com API isn't as well documented because a lot of things change frequently.

26:53 Players are traded, players get injured, players retire, you have to take into account all the stats as well, points per game, rebounds per game, and that type of thing.

27:01 So this package, the NBA API package, has a ton of features.

27:05 You can get information on players, teams, more static data, as well as data that changes as well, like, you know, their stats.

27:15 I think their stats per game per season, like their player game, while there's tons and tons of endpoints.

27:21 So I would if you want to work with this API, I recommend looking up the API endpoints.

27:26 There's probably like over 40 of them.

27:29 Wow.

27:29 Or maybe around 40, actually.

27:31 Yeah, it's just really cool.

27:33 I'm actually working with this right now.

27:34 And I'm writing a, building a sports NBA ranking website right now.

27:40 I'm using this package.

27:42 Fun.

27:43 One of the things that's cool is it has a lot of search functionalities and not just direct by, you know, find me the team from this city or this name, but like, find teams by state or something.

27:55 Yeah.

27:56 Yeah.

27:57 Yeah.

27:58 It's definitely very clever.

27:59 And it, I would say between like the first one we looked at is sports reference.com.

28:03 I don't know where they're pulling.

28:04 I think I'm not sure where they're pulling their data.

28:07 reference maybe from each individual site of the, you know, the sports associations, I'm guessing.

28:13 Right.

28:13 Okay.

28:14 But.

28:15 Well, I mean, like, for example, the data from NBA's got to be more centralized than like all of the college ball stuff, right?

28:24 Yeah.

28:25 Yeah.

28:25 This is cool.

28:26 Even as support for live data here, like NBA dot live and points for scoreboard and all kinds of stuff that looks, that looks pretty neat.

28:35 Wow.

28:35 This is some, there's a lot of data here.

28:37 Yeah, you check out the notebooks.

28:39 Yeah, there's tons of data.

28:40 Right? The notebooks seem to have some cool examples.

28:42 Yeah, I still have the notebooks and the Jupyter notebooks I have.

28:44 Yeah, there's a lot of data. It's very good.

28:46 Yeah, it's pretty awesome. There's a lot that you can do.

28:48 A lot of fun stuff.

28:49 Cool. I know so many people want to build examples with sports.

28:54 And I think having some live data would be really, really neat.

28:58 So, you know, like during, like you say, like right now during the playoffs or something, you could do some fun things. Indeed.

29:04 >> Indeed.

29:05 >> Yeah.

29:05 >> All right. Brian, is that our six items?

29:08 >> It is. Do you have anything extra to share with us?

29:13 >> I have, I think just a real quick one here for us.

29:17 From Pablo, we have Python 3.11, Beta 1 is here.

29:22 Hurrah. This marks feature freeze, which means there'll be no new features or APIs, only bug fixes.

29:30 So please, they say, if you maintain a Python package, help us test that everything works as expected.

29:37 But this is pretty neat.

29:38 - Nice.

29:39 - Yeah, that's it for me.

29:40 - On that, I'm gonna grab this just a second.

29:45 We'll link to this as well.

29:47 Simon Willison has a little blurb on, like if you're using GitHub actions to test your packages, Simon has a code snippet for exactly how to do that.

30:00 Essentially the Python thing you want is Python 3.11-dev and make sure it's in quotes and just add that to your Python versions matrix.

30:11 - All right, fantastic.

30:13 - So how about you, Tanya?

30:15 Do you have any extras?

30:17 - That's pretty much it.

30:17 Oh, I do see some people in the chat that I've met at PyCon last week.

30:21 Mario, hey Mario.

30:22 I'm not sure if you're still here, but hello.

30:24 - Cool, fantastic.

30:25 Yeah, you just came back from PyCon and Brian and I were not there.

30:28 Do you want to give us a quick report from being on scene?

30:33 - Yeah, it was amazing.

30:34 It was my first Python.

30:36 And actually one of my first tech conferences, actually.

30:40 It was great.

30:41 I spent most of the time working on booths for DeepM 'cause we were helping to sponsor the event.

30:45 I did catch a few talks and met so many amazing people and also just connected with people that I have been communicating with over the last several years, via internet and chat and stuff like that.

31:01 So it was just really fun.

31:02 It was a good time.

31:03 - I love PyCon.

31:04 I consider it my geek holiday.

31:06 (laughing)

31:07 I love to go there and meet so many of the people.

31:09 Everyone's so accessible and I spend most of my time just walking around looking to say hi to folks and whatnot.

31:16 - So I have an idea, Michael.

31:18 Maybe next year we should go.

31:19 - Yeah.

31:20 Yeah, maybe next year we should go.

31:22 Yeah, definitely.

31:23 I'm looking forward to getting back there.

31:25 - Well, do you have anything funny for us?

31:26 - Are you looking forward to a joke?

31:27 - Yeah.

31:28 Well, I have something for you.

31:29 I'll let you be the judge of it's funny.

31:32 All right, so here's what I got.

31:33 Brian, just maybe give us a quick description of what this picture is about here.

31:37 - I don't know, there's a guy, like looks like really stressed out, holding his hand in front of his face.

31:44 - I think he's crying.

31:45 - Crying, yeah.

31:46 - He's pretty sad.

31:47 I mean, red eyes almost, just crying.

31:50 And so, you know, we all come to these websites and it's, you know, prove you're human and all these recapture things.

31:55 And sometimes you're lucky I'm going to get a slide the puzzle over until like the dog fits in its house or something rather than find all, you know, highlight all the stoplights or anyways.

32:05 So the joke is when a with a very sad guy here asking, I says, when a computer asks, are you a robot?

32:12 Maybe it's just wanting to find its family.

32:15 Poor thing.

32:18 Maybe it does.

32:19 Maybe we're not.

32:20 We should just be helping more and you know, every time I prove a recapture, it's just like, no, that's not my family.

32:26 It's so funny.

32:28 - One of the funniest find this memes that I saw recently was just like a picture of space.

32:34 And it said, click all the squares that have a Klingon bird of prey inside.

32:39 'Cause cloaked, you can't see it.

32:42 - 'Cause they're cloaked, they're invisible.

32:43 That's right, yes.

32:44 Of course.

32:45 - Anyway.

32:46 - Very good, very good.

32:48 - Thanks again for having a great podcast.

32:50 Thanks, Tanya, for showing up and doing this with us.

32:53 - Yeah, thanks for having me.

32:54 It was fun.

32:55 >> Yeah.

32:56 Great to have you on here, Tanya.

Back to show page