Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.
This is episode 397, recorded August 20th.
And I am Brian Okken.
And I am Michael Kennedy.
This show, this episode is sponsored by us, so check out our stuff, our courses and training and everything.
Links in the show notes, of course.
You can connect with us on Mastodon or Fosstodon.
We're at mkennedy, at brianaukin, at Python Bytes, but you can find all of those in the show notes as well.
Also, you can go to pythonbytes.fm/live if you want to join us in the studio audience.
And finally, we have some exciting news about the handcrafted artisanal show notes in email form.
Our email friends of the show list has reached a milestone and we've already sent out prizes, which is awesome.
Yes, check your mail.
You may be a lucky winner.
I know two folks have already redeemed some courses over at Talk Python and over on your platform, right?
Yep.
You may already be a wiener.
So check your email.
What do you got for us, Michael?
I've been waiting and waiting to talk about this.
So let's talk about Pi Awaitable.
It was bad, but it had to be done.
You know what I mean?
So Pi Awaitable.
This is something I feel like probably not a ton of people are going to be using, but the concurrency
models in Python are only increasing.
The use of async and await is only increasing.
And people writing code, people writing code in B and Rust and other languages to basically create lower, lower level faster bits is increasing.
And so I put this out there to help those of you who are saying, maybe I want to rewrite the section in C or integrate with this other bit of code in C.
So this is a project called Pi Awaitable, which is really for people writing code in C, C extensions for Python.
Okay.
And interestingly, it comes from Peter.
Last name is Birma.
Peter Birma.
And if you check out his website, it's pretty interesting, actually.
Hey, I'm Peter, software engineer from the United States.
I'm 16 years old.
Oh, wow.
I've been writing.
I've been coding since I was nine.
And this is just one of my many projects.
So there's a bunch of projects you can see that, like the pointers.py joke that was going around a while ago.
He did that and stuff.
Anyway, so that's kind of interesting and impressive.
And so this is a library that lets you create code in C that can accept an async Python function.
So if you write async def in Python, right, and create some function that uses async and await, and you pass it off to the C layer, well, that used to be kind of tricky.
This used to be, this was suggested 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 the whole PEP write up of what is the value of this?
Why does it exist?
How do you use it?
How should it be added?
And from what I gather, what I understand is that since this thing only uses the public ABI, the public interface of the C API, it doesn't necessarily have to be part of CPython.
It could just be a third party library.
So here it is.
And here's how you, here it goes, Brian.
This will, this will connect with you, I think.
Hash include pyawaitable.h.
Here we go.
Here's a function that takes a Python coroutine function or an async def type of function, uses this library to create something that can be awaited on it.
And then it returns it.
So then that basically turns the C function into an async, something that can be awaited from Python.
Okay.
So the C function is the thing that you're waiting for completion of?
Yes.
So here's a C extension written with this library that itself is effectively an async def function that you just await as if it was a native Python one.
Okay.
In the event loop and all that kind of stuff.
And it can coordinate with other async things like your own ones or the built-in, you know, async io.sleep or whatever.
That's pretty cool.
Yeah.
Pretty cool?
Yeah.
So I'm pretty short and sweet and pretty focused, so I'm not going to say much more about it, but check it out.
It's pretty new, but, you know, it seems not super advanced in terms of what it does.
So you can, if you're doing a lot of C and async programming, you can check it out and see what you think of it and use it and contribute.
Nice.
All right.
Well, I want to show you something pretty.
So look at this plot.
This is amazing.
So this is just a coal production since 1900.
So why am I showing this?
Because it looks like it came out of a magazine or something.
You've got like these call outs with, it's a stacked plot, but it's got like the colors are all, instead of doing like a key,
there's, they're, they're listed as colored names in, in one of the descriptions.
This is great.
So anyway, I like this plot.
I want to do something like this.
And luckily there's an article called annotated area charts with plot line.
Plot line is an open source Python library.
And, and this is just a good walks.
There's a tutorial that walks you through doing this, this wonderful, very professional looking plot.
And, and it's not something that doesn't even look that complicated.
Anyway, so going through this looks, looks pretty fun to, to try to do some, some fancy plots like this.
Maybe make, make my job, make me look more professional at my job.
You know, one of the, so it uses, it uses plot line, which I hadn't heard of.
And plot line is, it's based on GG plot two.
And it says plot line is an implementation of a grammar of graphics.
I did not know the GG and GG plot was grammar of graphics.
That's cool.
I learned that today.
So that's cool.
Anyway, I'm like, well, wait a second.
Is this, is this open source?
Yeah, it's all, it's all on, on GitHub.
So, and MIT licensed.
So I feel safe with, with this talk about licenses a lot lately and it, and I am paying more attention
to the licenses that I use.
So, anyway, just a fairly quick shout out to this wonderful, oh, who wrote it?
It was Nicola Renni.
And great looking blog too.
But anyway, just had to make really beautiful plots with plot line.
That's a nice looking blog and very nice looking presentation.
So plot, plot nine is new to me.
So good to know.
Right on to the next one.
We have Delta base.
So Brian, I'm sure you've heard of SQLite, the embedded database that you can just point at
a file and run.
So Delta base is kind of like that, but broader, I guess.
It's a lightweight comprehensive solution for managing data, Delta tables built on Polars
and Delta Lake.
All right.
So some, some definitions for this makes sense.
So Polars is a data frame framework, very much like pandas.
I actually had a guy who created it on talk Python quite a while ago when it came out.
And the idea is one, it's super fast, but two, the way that you work with it is a so-called
fluent API.
Scrolling for an example, not finding one, a fluent API that has deferred execution.
So when you work with Panda, you might say, do this filter and then transform this and
then multiply that thing by something.
It just does every one of those steps and then processes it together with Polars.
It says, okay, I see what you're doing.
And first you told me to multiply.
And then you told me to filter.
But if I filter and then multiply, I'll be multiplying way fewer things potentially.
Right.
So that's kind of the big difference.
Anyway, super cool.
Built on Rust.
So obviously it's got some pizzazz behind it.
So are you saying that you can write it in a fluent way that makes sense to you, but it'll
rearrange it if it makes sense to Polar?
Yeah.
It has like a query optimizer type of deal.
It's not quite a query because you're not writing a query, but it has a deferred execution and
it takes into consideration.
If I remember this correctly, it takes into account all the different steps because it doesn't
actually execute until you give it like the command.
And so it's built up all these steps that it can do.
And so it can make decisions about that.
Oh, that's cool.
Okay.
Yeah.
Which is really cool.
But in other ways, it's very similar to pandas.
Not trying to be a copy of it, but that's, you know, it's kind of plays the same space.
All right.
So that's one thing.
The other is Delta Lake.
This is an implementation of Delta Lake, I guess.
And with a space, rather than with a space, without a space.
Oh, that clears it up.
Totally.
Oh, yeah.
So absolutely.
So this is a format, actually, that allows you to talk with computational engines such
as Spark, Hive, Snowflake, but also things like DuckDB and others.
And you can just point it at a local file.
You don't even have to have a server.
Okay.
So this is a pretty cool looking library that lets you basically, you know, it's optimized
for doing upserts and all sorts of things like that.
efficient versioning and so on.
So you just pointed at some path if you want, sort of the SQLite experience.
And then you say, here's a table.
It has a primary key with its name.
And here is a bunch of data I want you to put into it.
And notice that there is no, here's my SQL create statement and my table schema and all
of those things.
Right?
Like, where is that?
Doesn't exist, does it?
So you just say, I'm going to commit this thing.
Also, if you go, you can do select statements against it, right?
Query statement, SQL statements against it.
You go and look at the docs, which I did.
Here we go.
Which are a bit of a work in progress here.
However, if you go and check out the docs, it shows you, for example, under connecting that
you can connect to just a path, but you could also connect to an S3 bucket.
You can connect to some kind of Azure data lake container or Google cloud storage, or as
you saw, a big query.
So this is pretty interesting, right?
Just change your connection string and you get these different data tables.
Neat.
Data lakes rather.
Yeah.
So that's what I have for people.
If they're doing this kind of stuff, you know, this is something kind of a wrapper around
those things.
Also not super popular, but I don't know, this week I kind of felt like shining a light on
things that were new and could maybe catch on with folks.
Yeah.
It looks fun.
Yes.
Also fun videos, I think.
So I wanted to highlight a blog post on the PyCon blog at blog spot, which still just cracks
me up.
But anyway, it's PyCon US 2024 recap and recording release, which I was confused by.
I would have thought a recording release was something you had to sign to make sure that
your video was releasable.
But it's no, we just wanted to say that the videos from PyCon are out and I'll take a look
at those in a second.
One of the highlights that they noticed was that there were a lot of people showing up.
There was a total attendance of 2,991.
That's 2,551 in person and 440 online.
So that's pretty cool.
I was just curious.
I looked.
Michael reminded me that if you go to look at PyCon on Wikipedia, it has a list of years of
attendees.
I think it was like a hotel or something.
Yeah.
And then I started going in Portland and we were at over 3,000 in Portland.
And then Cleveland was over 3,000 as well.
And then the pandemic hit and it went down quite a ways.
But we're back to better numbers.
2022 was 1,700.
2023 now is over, was 2,100.
And now we're up to 2,500-ish in person.
Let's say it's going better.
I think I'm not.
If I'd be totally up for going possibly next year, but I'm totally going to hit Long Beach
in 2026.
That sounds great.
Oh, yeah.
I'm definitely going to Long Beach.
Yeah.
Bring on some SoCal.
Let's do it.
Okay.
So they also announced in this announcement that there's a, where is it?
Somewhere in there.
It has a link to the YouTube thing.
So you can find the link there, but you can also see it in our show notes.
So if you go to PyCon US at YouTube, all the videos are now up.
And my favorite way to get them is to just hop over to the playlist.
You can go to the, there's a 2024 thing, but underneath it, you can see the full playlist.
And I like that one because I can see all of the names of the, of the videos.
So you don't just hit play on the playlist and just binge.
No, no way.
But so if you, if you just hit the playlist though, if you start it, you can pause it.
But then all the little, all the, the playlist is over on the side, but you can't see the
titles.
Yeah.
So I agree with you.
This is the same way as I do the same way.
Anyway, I've already got queued up and you can search, you can search easier with this,
this way as well.
I'll go away.
And so I already queued up a search for test stuff, of course.
And I've got queued up pipe, pipe test for unit testers by Paul Gansel.
And then this one looks pretty good.
Testing data pipelines with the Emotish Swain.
So yeah, it does look cool.
Anyway, lots of stuff to check out.
Awesome.
That's all we got for that.
That's all we got.
Those are all of our main items.
Yeah.
Got any extras?
I do.
I have, I have multiple.
I have a couple of things I want to talk about actually.
One, I just impromptu added here.
So I've been, one of the things, one of the things I've been working on, Brian, is trying
to do like a little bit less being not distracted by my phone, but just pulled in by my phone
and other digital things.
Right.
You go, you're like, oh, I got a notification for a text from someone or my music stopped.
Why the heck did it stop?
Happy AirPods.
I got to go back and like, find it and make it go again.
Because I paused it for three minutes.
So it must have killed the app.
Like that makes sense.
You know what?
Super computer in your pocket.
So you go and open it up and you're like, oh wait, that has a little dot or that has a
little like badge of three on red.
What is that?
And then you start scrolling and then you're over there.
And then, you know, it just, there's just this like pressure or this sort of gravity
of, of that thing being around.
So I am taking an attempt and I would love to hear your thoughts on this.
So making an attempt to make my home screen feel less, more, less like a black hole
that sucks me in and more like a, I've come here for a purpose.
Let me do the thing and then go on.
I would, I looked at maybe getting an Android phone, like a really option to have like a
real dumb interface, like the nothing phone would be really cool or something like that.
But with my Apple watch and all my other things, basically I have to just throw that thing
in the trash if I switched to Android, which is really unfortunate, but I'm like, all right,
well, I'll stick with my iPhone.
So I'm, I started using this thing called dumb phone.
Have you heard of this?
No.
So what it does is it uses some weird tricks to take over your home screen on iPhone.
And it just has a really, really simple display.
Like the phone, instead of being an icon, it's just the word phone, your messages, instead
of being the green thing with the, like the three in red is just the word messages and so on.
Okay.
And so for example, here's a, I'll link to it.
I'll link to it.
It's a screenshot of my iPhone 13 mini.
It just says web bone messages, maps, weather, and photos on a gray white text on a gray background.
And you can swipe it over.
Like the next one I think is videos, podcast news, something like that.
You know, and the ones like productivity, like mail and calendar.
Okay.
If you still want, you still wrote where you're at Mac, you can, you can pull down, you can
search, or you can even keep swiping until you get past this.
Anyway, this, I'm trying this and people, if they want to try to go down this path so far,
I'm liking it.
I've been messing with my phone.
It's been effective.
I've been like stuck in my phone less.
I'm not a person like, oh, I can't have my phone with me.
I have it with me all the time.
But when I go and like check my messages, I don't end up somewhere else as often, let's say.
So I did, I just like took, I've just got a handful of things like those sorts of things
on my home screen, but I just have a few on my, on the first screen and everything else
is on some other page.
Yeah, that makes sense.
So that I can just see my, and then I have a background picture of my lovely wife there
so I can see.
Yeah, I did have to give it my background.
I guess I could put a background, but it wouldn't look right because the way this thing works.
Also, I took off all of the badges.
The, the, the, the only thing that I, the only thing that gets a little number that
I still left was the phone messages because I, I actually don't check that very much.
So I'd like to see if there's a message.
Not, not actual.
Oh yeah.
Actual messages and, you know, phone, like somebody left a voicemail.
Like who does that anymore anyway?
But, but at the same time, I don't answer my phone.
So if, if I don't recognize it, so the doctor might leave it messages anyway.
Yeah, exactly.
But I'll be curious to see how long you can deal with that.
You could also just get a cheap phone, but you know, maybe you can, but that's hard to
do now.
It's super.
Well, it's like, okay, well, I also want to have, you know, a nice GPS if I'm somewhere
and I want to have CarPlay in my car because I have like a big display that's like a beautiful
screen while I'm driving.
And yeah, it's like.
And occasionally you're stuck somewhere and you want to read something or whatever.
Yeah.
I'm not trying to not use.
I'm just trying to like, when I open and I look at it, I don't want it to be a black hole.
And right now, oddly, it's like a very dark gray, not black, but.
It's a gray hole.
That has no interest to me.
Okay.
I will see.
I'll report back.
Either I give up or I do that.
And then one more thing.
We're coming up on the last time for the Code in a Castle.
So if you want to come to Italy with me and talk about Python and databases and APIs and
all sorts of fun stuff, got a couple of weeks to sign up.
So codeinacastle.com and I hope to see you there.
Nice.
Cool.
The extra I've got is I want to say, hey, I finally got the new course done.
So Hello pytest is available.
I got to figure out how to take this away.
It says 16 lessons, but it's not.
It's 12 lessons.
Some of the things, it's like counting the intro and the source code as lessons.
Those aren't really lessons.
Anyway.
So 16 lessons under 90 minutes, I think.
Slightly under 90 minutes, including the intro and outro.
So there are only a few minutes of video there.
But check it out.
You can have full, the full content, table of contents is there at courses.pythontest.com.
And yeah, loved it.
Loved to hear what people think.
And I'm going to just stick it with 10 bucks for a while.
I've had a lot of great feedback that said that's about, that's a cool price point.
So I'm going to leave it for a while.
Awesome.
Anyway.
And congratulations.
That's a big deal.
Thanks.
And I'm kind of, we talked about this a little bit.
I used Camtasia to record this.
And I'm going to, I think I'm going to try to try working with OBS Studio a little bit.
Yeah, you definitely should.
There's some stuff I love about Camtasia though that OBS doesn't seem like it does.
Let's talk after.
Yeah.
Let's talk after.
There's some really neat stuff.
I know you have a little mini stream deck as well.
And that's really awesome for like swapping up the views while you're doing recording and stuff.
So.
Yeah.
Cool.
Well, do you have anything funny for us?
I will let you be the judge.
I have philosophy for us.
Okay.
So previously we've talked about the Tau of programming and I want to come back to the Tau of programming.
And this is like a parody, ancient philosophy, sort of Eastern philosophy, sort of thing here.
So this one is 4.3 from the Tau.
Okay.
A master was explaining the nature of Tau to one of his novices.
The Tau is embodied in all software, regardless of how insignificant, said the master.
Is the Tau in a handheld calculator?
Asked the novice.
It is, came the reply.
Is the Tau in a video game?
Continued the novice.
It is even in a video game, said the master.
Is the Tau in the DOS or a personal computer?
The master coughed and shifted position slightly.
The lesson is over for today, he said.
Yeah.
Pretty good.
Yeah.
That's good.
And you can be okay with like joking about DOS.
Because it doesn't even exist anymore.
Yeah, exactly.
Exactly.
It's not going to hurt anybody.
Nobody's.
Except for those three people who are still on their 386 and won't give it up.
Word perfect is perfect for me.
I love it.
Come on.
I remember getting my 386.
I'm like, gosh, I don't think I can.
I don't think I'll need another computer for a really long time.
I know.
I got a 486 DX33.
Not the SX25 megahertz.
The DX33.
And it had a turbo button.
And it was amazing.
A turbo button.
Like, why would you turn it off?
Because if you wanted to play the games written for the 286, they went really fast and you couldn't play them at all.
It was out of control.
So if you hit, if you disable turbo, it was more of a slow it down button, but they didn't want to call it that.
So you could play the ones that just use the frame rate instead of real time or frame.
Like MechWarrior and stuff, I think was out of control.
It was like those old record players that you had that speed controls on them.
Yes, exactly.
For the small ones or the big ones.
Yeah.
45s and whatever.
Okay.
Nice.
Okay.
Well, thanks again for our wonderful Python bytes.
And we'll see everybody next week.
See you later.