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


Transcript #397: So many PyCon videos

Return to episode page view on github
Recorded on Tuesday, Aug 20, 2024.

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

00:05 This is episode 397, recorded August 20th. And I am Brian Okken.

00:10 And I'm Michael Kennedy.

00:11 This show, this episode is sponsored by us. So check out our stuff, our courses and training

00:16 and everything. Links in the show notes, of course. You can connect with us on Mastodon

00:22 or Fosstodon. We're @mkennedy, @brianocken, @pythonbytes, but you can find all of those

00:28 in the show notes as well. Also, you can go to pythonbytes.fm/live if you want to join us

00:34 in the studio audience. And finally, we have some exciting news about the handcrafted artisanal

00:44 show notes in email form. Our email friends of the show list has reached a milestone and we've

00:50 already sent out prizes, which is awesome. Yes. Check your mail. You may be a lucky winner. I

00:56 know two folks have already redeemed some courses over at Talk Python and over on your platform,

01:02 right? Yep. You may already be a wiener. So check your email. What do you got for us, Michael?

01:07 I've been waiting and waiting to talk about this. So let's talk about PyAwaitable.

01:13 Was bad, but it had to be done. You know what I mean? So PyAwaitable, this is something I feel

01:21 like probably not a ton of people are going to be using, but the concurrency models in Python

01:27 are only increasing. The use of async and await is only increasing and people writing code,

01:33 people writing code in C and Rust and other languages to basically create lower level,

01:40 faster bits is increasing. And so I put this out there to help those of you who are saying,

01:46 maybe I want to rewrite the section in C or integrate with this other bit of code in C.

01:52 So this is a project called PyAwaitable, which is really for people writing code in C,

01:58 C extensions for Python. Okay. Okay. And interestingly, it comes from Peter, last name

02:06 is Birma, Peter Birma. And if you check out his website, it's pretty interesting, actually. Hey,

02:12 I'm Peter, software engineer from the United States. I'm 16 years old. I've been writing,

02:16 I've been coding since I was nine. And this is just one of my many projects. So there's a bunch

02:21 of projects you can see that like the pointers.py joke that was going around a while ago. He did

02:27 that and stuff. Anyway, so that's kind of interesting and impressive. And so this is

02:31 a library that lets you create code in C that can accept an async Python function. So if you write

02:40 async def in Python, right, and create some function that uses async in a wait, and you

02:46 pass it off to the C layer, well, that used to be kind of tricky. This used to be, this was suggested

02:53 as a pep, if you check it out. I don't know if it got far enough to have a number, but there's like

02:59 the whole PEP write up of what is the value of this? Why does it exist? How do you use it? How

03:03 should it be added? And from what I gather, the understand, what I understand is that since this

03:10 thing only uses the public ABI, the public interface of the C API, it doesn't necessarily

03:17 have to be part of CPython. It could just be a third party library. So here it is. And here's

03:22 how you, here it goes, Brian, this will, this will connect with you. I think. #include pyawaitable.h.

03:29 Here we go. Here's a function that takes a Python coroutine function or an async def type of

03:37 function, uses this library to create something that can be awaited on it, and then it returns

03:43 it. So then that basically turns the C function into an async, something that can be awaited

03:49 from Python. Okay. So the C function is the thing that you're waiting for completion of?

03:55 Yes. So here's a, here's a C extension written with this library that itself is effectively

04:01 an async def function that you just await as if it was a native Python, event loop and all that

04:07 kind of stuff. And it can coordinate with other async things like your own ones or the built-in,

04:12 you know, async.io.sleep or whatever. That's pretty cool. Pretty cool. So I, it's pretty

04:18 short and sweet and pretty focused, so I'm not going to say much more about it, but check it

04:22 out. It's pretty new, but you know, it seems not super advanced in terms of what it does. So you

04:28 can, if you're doing a lot of C and async programming, you can check it out and see what

04:32 you think of it and use it and contribute. Nice. All right. Well, I want to show you something

04:38 pretty. So look at this plot. This is amazing. So this, this is just a coal production since

04:45 1900. So why am I showing this? Because it looks like it came out of a magazine or something.

04:50 You've got like these call-outs with it's a, it's a stacked plot, but it's got like the colors are

04:57 all instead of doing a, like a key there's they're, they're listed as colored names in,

05:04 in one of the descriptions. This is great. So anyway, I like this plot. I want to do something

05:10 like this. And luckily there's an article called annotated area charts with plotline.

05:16 Plotline is an open source Python library. And, and this is just a good walks. There's a tutorial

05:23 that walks you through doing this, this wonderful very professional looking plot. And, and it's not

05:29 something that doesn't even look that complicated. Anyway. So going through this looks, looks pretty

05:34 fun to, to try to do some, some fancy plots like this. Maybe, maybe make, make my job, make me look

05:41 more professional at my job. One of the, so it uses, it uses plotline, which I hadn't heard of.

05:48 And plotline is it's based on GG plot too. And it says plotline is an implementation of a grammar

05:56 of graphics. I did not know the GG and GG plot was grammar of graphics. That's cool. I learned

06:04 that today. So that's cool. Anyway, I'm like, well, wait a second. Is this open source? Yeah.

06:10 It's all, it's all on, on GitHub. So, and MIT licensed. So I feel safe with, with just talking

06:17 about licenses a lot lately and it, and I am paying more attention to the licenses that I use.

06:22 So anyway, just a fairly quick shout out to this wonderful, Oh, who wrote it? It was a Nicola

06:29 Rennie and a great looking blog too. But anyway just how to make really beautiful plots with

06:36 plotline. That's a nice looking blog and very nice looking presentation. So plot, plot nine is new to

06:42 me. So good to know. Right on to the next one. We have DeltaBase. So Brian, I'm sure you've heard

06:50 of SQLite, the embedded database that you can just point out a file and run. So DeltaBase is kind of

06:57 like that, but broader, I guess it's a lightweight comprehensive solution for managing data, Delta

07:03 tables built on Polars and Delta Lake. All right. So some, some definitions for this makes sense.

07:09 So Polars is a data frame framework, very much like Pandas. I actually had a guy who created

07:17 on Python quite a while ago when it came out. And the idea is one, it's super fast, but two,

07:24 the way that you work with it is a so-called fluent API. Scrolling for an example, not finding one,

07:30 a fluent API that has deferred execution. So when you work with Panda, you might say,

07:35 do this filter and then transform this and then multiply that thing by something.

07:39 It just does every one of those steps and then processes it together with Polars. It says,

07:44 okay, I see what you're doing. And first you told me to multiply, and then you told me to filter.

07:49 But if I filter and then multiply, I'll be multiplying way fewer things potentially. Right.

07:54 So that's kind of the big difference. Anyway, super cool. Built on Rust. So obviously it's got

07:59 some pizazz behind it. Wait, so are you saying that you can write it in a fluent way that makes

08:04 sense to you, but it'll rearrange it if it makes sense to Polar? Yeah, it has like a query optimizer

08:09 type of deal. It's not quite a query because you're not writing a query, but it has a deferred

08:14 execution and it takes into consider... if I remember this correctly, it takes into account

08:20 all the different steps because it doesn't actually execute until you give it the command.

08:24 And so it's built up all these steps that it can do. And so it can make decisions about that.

08:29 Oh, that's cool. Okay. Yeah, which is really cool. But in other ways, it's very similar to Pandas.

08:33 Not trying to be a copy of it, but it's kind of plays the same space. All right. So that's one

08:38 thing. The other is Delta Lake. This is an implementation of Delta Lake, I guess. And

08:46 with a space, rather than with a space, without a space. Oh, that clears it up. Totally. Oh,

08:52 yeah. So absolutely. So this is a format actually that allows you to talk with computational

09:00 engines such as Spark, Hive, Snowflake, but also things like DuckDB and others. And you

09:07 can just point it at a local file. You don't even have to have a server. Okay. So this is a pretty

09:12 cool looking library that lets you basically, you know, it's optimized for doing upsearch and all

09:19 sorts of things like that. Efficient versioning and so on. So you just point it at some path,

09:27 if you want, sort of the SQLite experience. And then you say, here's a table. It has a primary

09:33 key with this name. And here's a bunch of data I want you to put into it. And notice that there is

09:38 no, here's my SQL create statement and my table schema and all of those things, right? Like,

09:45 where is that? Doesn't exist, does it? So you just say, I'm going to commit this, this thing.

09:51 Also, if you go, you can do select statements against it, right? Query statement, SQL statements

09:56 against it. You go and look at the docs, which I did. Here we go. Which are a bit of a work in

10:02 progress here. However, if you go and check out the docs, it shows you, for example, under

10:07 connecting that you can connect to just a path, but you could also connect to an S3 bucket.

10:14 You can connect to some kind of Azure data lake container or Google cloud storage, or as you saw,

10:21 BigQuery. So this is pretty interesting, right? Just change your connection string and you get

10:26 these different data tables, data lakes rather. Yeah. So that's what I have for people if they're

10:32 doing this kind of stuff. You know, this is something, kind of a wrapper around those things.

10:36 Also not super popular, but I don't know, this week I kind of felt like shining a light on

10:41 things that were new and could maybe catch on with folks. Yeah. It looks fun. Yes. Also fun

10:48 videos, I think. So I wanted to highlight a blog post on the PyCon blog, blog spot,

10:58 which still just cracks me up. But anyway, it's PyCon US 2024 recap and recording release,

11:06 which I was confused by. I would have thought a recording release was something you had to sign

11:10 to make sure that your video was releasable, but it's no, we just wanted to say that the videos

11:16 from PyCon are out. And I'll take a look at those in a second. One of the highlights that they

11:22 noticed was that there were a lot of people showing up. There was a total attendance of 2,991.

11:31 That's 2,551 in person and 440 online. So that's pretty cool. I was just curious. I went and looked.

11:40 Michael reminded me that if you go to look at PyCon on Wikipedia, it has a list of years

11:49 of attendees. 2003, there were 200 people in Washington, DC. It's awesome.

11:55 I think it was like in a hotel or something.

11:59 And then I started going in Portland and we were at over 3,000 in Portland. And then Cleveland was

12:07 over 3,000 as well. And then the pandemic hit and it went down quite a ways. But we're back to

12:14 better numbers. 2022 was 1,700. 2023 now is over, was 2,100. And now we're up to 2,500-ish in person.

12:24 Let's say it's going better. I'd be totally up for going possibly next year, but I'm totally

12:33 going to hit Long Beach in 2026. That sounds great. Oh, yeah. I'm definitely going to Long

12:38 Beach. Yeah. Bring on some SoCal. Let's do it. Okay. So they also announced in this

12:43 announcement that there's a... Where is it? Somewhere in there. It has a link to the YouTube

12:49 thing. So you can find the link there, but you can also see it in our show notes.

12:52 So if you go to PyCon US at YouTube, all the videos are now up. And my favorite way to get

12:57 them is to just hop over to the playlist. You can go to the... There's a 2024 thing,

13:03 but underneath it, you can see the full playlist. And I like that one because I can see all of the

13:09 names of the videos. You don't just hit play on the playlist and just binge?

13:15 No. No way. But so if you just hit the playlist, though, if you start it, you can pause it.

13:23 But then all the little... All the playlist is over on the side, but you can't see the titles.

13:29 Yeah. I agree with you the same way as... I do the same way.

13:34 Anyway, I've already got queued up and you can search easier with this way as well. Oh, go away.

13:42 And so I already queued up a search for test stuff, of course, and I've got queued up pytest

13:48 for unit testers by Paul Gansel. And then this one looks pretty good. Testing data pipelines with

13:52 Amotish Swain. So yeah, it does look cool. Anyway, lots of stuff to check out.

13:58 Awesome. Awesome.

13:59 That's all we got for that.

14:00 That's all we got. Those are all of our main items.

14:03 Yeah. Got any extras?

14:05 I do. I have multiple. I have a couple of things I want to talk about, actually.

14:12 One, I just impromptu added here. So I've been... One of the things I've been working on, Brian,

14:18 is trying to do like a little bit less being not distracted by my phone, but just pulled in by my

14:25 phone and other digital things, right? You go, you're like, "Oh, I got a notification for a text

14:30 from someone," or "My music stopped. Why the heck did it stop? Crappy AirPods. I got to go back and

14:36 find it and make it go again because I paused it for three minutes, so it must have killed the app."

14:40 Like, that makes sense. You know, what's a supercomputer in your pocket? So you go and

14:44 open it up and you're like, "Oh, wait, that has a little dot or that has a little badge of three

14:48 on red. What is that?" And then you start scrolling and then you're over there. And then, you know,

14:52 there's just this pressure or this sort of gravity of that thing being around.

14:59 So I am taking an attempt, and I would love to hear your thoughts on this, making an attempt

15:04 to make my home screen feel less like a black hole that sucks me in and more like a, "I've come here

15:10 for a purpose. Let me do the thing and then go on." I looked at maybe getting an Android phone,

15:17 like a really option to have like a real dumb interface, like the nothing phone would be really

15:22 cool or something like that. But with my Apple Watch and all my other things, basically I have

15:27 to just throw that thing in the trash if I switch to Android, which is really unfortunate. But I'm

15:31 like, "All right, well, I'm sticking with my iPhone." So I started using this thing called

15:35 dumb phone. Have you heard of this? No. So what it does is it uses some weird tricks to take over

15:42 your home screen on iPhone. And it just has a really, really simple display. Like the phone,

15:49 instead of being an icon, is just the word phone. Your messages, instead of being the green thing

15:53 with the three in red, is just the word messages and so on. And so, for example, here's a link to

16:00 it, a screenshot of my iPhone 13 mini. It just says, "Web bone messages, maps, weather, and

16:06 photos," on a gray, white text on a gray background. And you can swipe it over. The next one, I think,

16:10 is videos, podcast news, something like that. And the ones like productivity, like mail and calendar.

16:18 You still wrote where you're at, Mac? You can pull down, you can search, or you can even keep

16:22 swiping until you get past this. Anyway, I'm trying this. And people, if they want to try

16:27 to go down this path, so far, I'm liking it. I've been messing with my phone. It's been effective.

16:33 I've been stuck in my phone less. I'm not a person like, "Oh, I can't have my phone with me." I have

16:37 it with me all the time. But when I go and check my messages, I don't end up somewhere else as

16:42 often, let's say. I've just got a handful of things like those sorts of things on my home screen.

16:50 But I just have a few on the first screen, and everything else is on some other page.

16:55 Yeah, that makes sense.

16:56 So that I can just see my... And then I have a background picture of my lovely wife there,

17:00 so I can see. Yeah, I didn't have to give it my background. I guess I could put a background,

17:04 but it wouldn't look right because the way this thing works. Also, I took off all of the badges.

17:11 The only thing that gets a little number that I still left was the phone messages, because I

17:18 actually don't check that very much. So I'd like to see if there's a message.

17:22 Not actual. Oh, yeah, actual messages and phone. Somebody left a voicemail. Who does that anymore?

17:31 Anyway, but at the same time, I don't answer my phone. So if I don't recognize it, so the doctor

17:37 might leave a message or something. Anyway. Yeah, exactly. But I'll be curious to see how long you

17:41 can deal with that. You could also just get a cheap phone, but maybe. But that's hard to do now.

17:48 Well, it's like, okay, well, I also want to have a nice GPS if I'm somewhere. And I want to have

17:55 CarPlay in my car, because I have a big display that's like a beautiful screen while I'm driving.

18:00 And occasionally you're stuck somewhere and you want to read something or whatever.

18:05 Yeah, I'm not trying to not you. I'm just trying to like when I open and I look at it,

18:09 I don't want it to be a black hole. And right now, oddly, it's like a very dark gray, not black, but.

18:14 It's a gray hole.

18:16 It's a gray hole that has no interest to me.

18:17 Okay.

18:18 I will see. I'll report back. I'll report back. Either I give up or I do. And then one more thing.

18:24 We're coming up on the last time for the code in a castle. So if you want to come to Italy with me

18:32 and talk about Python and databases and APIs and all sorts of fun stuff, got a couple of weeks

18:38 to sign up. So code in a castle dot com and hope to see you there.

18:43 Nice. Cool. The extra I've got is I want to say, hey, I finally got the new course done. So

18:50 hello, pytest is available. I gotta figure out how to take this away. It says 16 lessons,

18:56 but it's not. It's 12 lessons. Some of the some of the things it's like counting the intro

19:01 and the the source code as lessons. Those aren't really lessons. Anyway. So 16 lessons

19:08 under 90 minutes, I think slightly under 90 minutes, including the intro and outro.

19:13 So there are only a few minutes of video there. But but check it out. You can you can have full,

19:19 full the full content table of contents is there at courses dot Python test dot com.

19:26 And yeah, loved it. Loved to hear what people think. And I'm going to just stick it with 10

19:31 bucks for a while. Had a lot of great feedback that said that's about that's a cool price point.

19:35 So we'll leave it. Yeah. Awesome. Anyway. And congratulations. That's a big deal.

19:40 Thanks. And I'm kind of if we talked about this a little bit, I used Camtasia to record this

19:46 and I'm going to I think I'm going to try to try working with OBS Studio a little bit.

19:54 Yeah, you definitely should. There's there's some stuff I love about Camtasia,

19:58 though, that OBS doesn't seem like it does. But let's let's talk after. Yeah, let's talk after

20:04 there's some really neat stuff. I know you have a little mini stream deck as well. And that's really

20:08 awesome for like swapping up the views while you're doing recording and stuff. So yeah, cool.

20:13 Well, do you have anything funny for us? I will let you be the judge. I have philosophy for us.

20:19 OK, so previously we've talked about the Tau of programming and I want to come back to the Tau of

20:23 programming. And this is like a parody of ancient philosophy, sort of Eastern philosophy sort of

20:30 thing here. So this one is four point three from the Tau. OK. OK. A master was explaining the

20:37 nature of Tau to one of his novices. The Tau is embodied in all software, regardless of how

20:42 insignificant, said the master. Is the Tau in a handheld calculator? Asked the novice. It is,

20:49 came the reply. Is the Tau in a video game? Continued the novice. It is even in a video

20:54 game, said the master. Is the Tau in the DOS or a personal computer? The master coughed and

20:59 shifted position slightly. The lesson is over for today, he said. Yeah. Pretty good. Yeah. Yeah.

21:08 That's good. And you can be OK with like joking about DOS because it doesn't even exist anymore.

21:16 Exactly. Exactly. It's not going to hurt anybody. Nobody's except for those three people who are

21:21 still on their 386 and won't give it up. WordPerfect is perfect for me. I love it. Come on.

21:28 I remember getting my 386. I'm like, gosh, I don't think I can. I don't think I'll need

21:32 another computer for a really long time. I know I got a 46 DX 33, not the SX 25 megahertz,

21:39 the DX 33. And it had a turbo button and it was amazing. A turbo button. Like,

21:44 why would you turn it off? Because if you wanted to play the games written for the 286,

21:49 they were really fast and you couldn't play them at all. It was out of control. So if you hit,

21:52 if you disable turbo, it was more of a slow it down button, but they didn't want to call it that.

21:56 So you could play the ones that just use the frame rate instead of real time or frame,

22:01 like MechWarrior and stuff, I think was out of control. It was like those old record players

22:05 that you had that speed controls on them. Like, yes, exactly. For the small ones or the big ones.

22:10 Yeah. 45s and whatever. Okay. Well, thanks again for a wonderful Python Bytes and

22:18 we'll see everybody next week. See you later. Thanks everyone.

Back to show page