WEBVTT

00:00:00.040 --> 00:00:06.240
<v Michael Kennedy>Hello and welcome to Python Bytes, where we deliver news and headlines directly to your earbuds.

00:00:06.370 --> 00:00:12.000
<v Michael Kennedy>This is episode 454, recorded October 20th, 2025. I'm Michael Kennedy.

00:00:12.390 --> 00:00:13.160
<v Brian Okken>And I'm Brian Okken.

00:00:13.500 --> 00:00:18.740
<v Michael Kennedy>And this episode is brought to you by us. We have increasingly more monotonically increasing

00:00:19.180 --> 00:00:23.020
<v Michael Kennedy>number of ways in which you can support us and things that Brian and I both feel like

00:00:23.400 --> 00:00:26.640
<v Michael Kennedy>contribute a lot of value, right? Your pytest book, your pytest courses,

00:00:27.400 --> 00:00:29.180
<v Michael Kennedy>All the courses over at Talk Python,

00:00:29.739 --> 00:00:32.160
<v Michael Kennedy>foreshadowing, some of that's coming later as well.

00:00:33.040 --> 00:00:33.800
<v Michael Kennedy>The Patreon supporters,

00:00:35.440 --> 00:00:36.320
<v Michael Kennedy>pretty much all of these things.

00:00:36.500 --> 00:00:38.800
<v Michael Kennedy>We create them not just so that we have a job,

00:00:39.040 --> 00:00:41.000
<v Michael Kennedy>but also because we think the world needs them.

00:00:41.240 --> 00:00:43.460
<v Michael Kennedy>We appreciate when you all agree with that and support them.

00:00:43.640 --> 00:00:45.620
<v Michael Kennedy>You want to connect with us, connect on social media

00:00:46.180 --> 00:00:47.720
<v Michael Kennedy>or on most of the social media.

00:00:47.820 --> 00:00:49.940
<v Michael Kennedy>There's the links at the top of the show notes.

00:00:50.300 --> 00:00:54.480
<v Michael Kennedy>Join us live right now, Monday, just after 10 o'clock.

00:00:54.720 --> 00:00:56.040
<v Michael Kennedy>Typically, it's when we start live streaming,

00:00:56.520 --> 00:00:57.540
<v Michael Kennedy>although sometimes it varies.

00:00:57.860 --> 00:00:59.580
<v Michael Kennedy>So subscribe to the YouTube channel

00:00:59.880 --> 00:01:03.180
<v Michael Kennedy>and get notified there to make sure you get all the notifications.

00:01:03.380 --> 00:01:05.059
<v Michael Kennedy>But typically we aim for Monday at 10

00:01:05.379 --> 00:01:06.780
<v Michael Kennedy>until further notice at least.

00:01:07.180 --> 00:01:08.520
<v Michael Kennedy>And finally, subscribe to the newsletter.

00:01:09.240 --> 00:01:10.940
<v Michael Kennedy>We're putting a lot of effort into sharing

00:01:11.160 --> 00:01:14.020
<v Michael Kennedy>a really nice, rich, extra bits of information

00:01:14.300 --> 00:01:15.660
<v Michael Kennedy>out to the newsletter there every week.

00:01:15.980 --> 00:01:17.700
<v Michael Kennedy>So appreciate that going out.

00:01:18.120 --> 00:01:18.840
<v Michael Kennedy>And I think it's been,

00:01:19.440 --> 00:01:20.620
<v Michael Kennedy>we put a lot of work into this, Brian.

00:01:20.620 --> 00:01:21.200
<v Michael Kennedy>I mean, a lot.

00:01:21.440 --> 00:01:22.600
<v Michael Kennedy>So I'm ready for a rest.

00:01:22.900 --> 00:01:23.800
<v Michael Kennedy>Take a little rest.

00:01:23.920 --> 00:01:24.200
<v Michael Kennedy>How about you?

00:01:24.520 --> 00:01:25.080
<v Brian Okken>Yeah, yeah.

00:01:25.180 --> 00:01:26.120
<v Brian Okken>We should take a rest.

00:01:26.300 --> 00:01:27.620
<v Brian Okken>maybe with a REST framework.

00:01:27.860 --> 00:01:30.140
<v Michael Kennedy>Oh, because sometimes you need a whole framework to REST.

00:01:30.140 --> 00:01:30.600
<v Michael Kennedy>You're that tired.

00:01:31.300 --> 00:01:33.620
<v Brian Okken>Yeah, so let's pop this up.

00:01:33.810 --> 00:01:35.800
<v Brian Okken>So we've got an article.

00:01:36.320 --> 00:01:37.920
<v Brian Okken>This is sort of going backwards

00:01:38.150 --> 00:01:41.400
<v Brian Okken>because there's a new package out

00:01:41.860 --> 00:01:42.940
<v Brian Okken>that I want to talk about,

00:01:43.030 --> 00:01:46.800
<v Brian Okken>but it's based on this article from Emma Levitt.

00:01:47.180 --> 00:01:51.020
<v Brian Okken>Why in 2025 do we still need a third-party app

00:01:51.130 --> 00:01:53.560
<v Brian Okken>to write a REST API with Django?

00:01:54.100 --> 00:02:01.220
<v Brian Okken>So and third-party apps we're talking about is usually Django REST framework or Django Ninja.

00:02:02.080 --> 00:02:04.100
<v Brian Okken>Increasingly more people are reaching for Django Ninja.

00:02:05.700 --> 00:02:07.140
<v Brian Okken>But, you know, both are great choices.

00:02:07.780 --> 00:02:14.500
<v Brian Okken>And but still, like, why do we have to have an extra REST framework with if you already have Django?

00:02:15.040 --> 00:02:22.020
<v Brian Okken>And the basically the gist of this article is, no, you can you can create and with all the built ins.

00:02:22.220 --> 00:02:30.980
<v Brian Okken>And this is using the class-based views to build a CRUD app, a CRUD API with Django.

00:02:31.160 --> 00:02:33.120
<v Brian Okken>And I actually kind of love this.

00:02:33.900 --> 00:02:36.300
<v Brian Okken>There's comments at the end also.

00:02:37.100 --> 00:02:42.580
<v Brian Okken>I kind of love the article talking about doing everything that's necessary to, it's not that much,

00:02:42.680 --> 00:02:50.220
<v Brian Okken>it's just not that much code to create a JSON REST API through, yeah, through Django without anything extra.

00:02:50.960 --> 00:02:58.220
<v Brian Okken>And down in the comments, some of the folks are like, well, why would you do this if you already have these others?

00:02:58.700 --> 00:03:01.120
<v Brian Okken>And of course, it's that you can.

00:03:03.300 --> 00:03:14.380
<v Brian Okken>That you can, but also that when you understand how you could build it with just the tools here, then it helps you understand how to use the other tools like Django Ninja.

00:03:15.400 --> 00:03:22.580
<v Brian Okken>So the reason why I'm bringing this up now, this is this, I think this article was from like March, April or something like that.

00:03:22.900 --> 00:03:29.140
<v Brian Okken>But she went ahead and DJ Rest 2 is now available.

00:03:29.550 --> 00:03:38.000
<v Brian Okken>And that is, if you scroll down to the bottom of it, it is her, is designed to be a minimal yet powerful Rest framework.

00:03:38.320 --> 00:03:43.640
<v Brian Okken>but it's around this article of why do we need an external app for REST,

00:03:43.880 --> 00:03:47.560
<v Brian Okken>which is kind of funny that she created an external app for REST too,

00:03:47.940 --> 00:03:49.040
<v Brian Okken>to demonstrate that.

00:03:50.300 --> 00:03:52.340
<v Brian Okken>But it's all the code from there.

00:03:52.540 --> 00:03:57.360
<v Brian Okken>And it's really great to be able to learn about REST frameworks

00:03:57.700 --> 00:03:59.660
<v Brian Okken>through trying something smaller scale.

00:04:00.120 --> 00:04:00.920
<v Brian Okken>So I like it.

00:04:01.120 --> 00:04:01.420
<v Brian Okken>Awesome.

00:04:01.900 --> 00:04:04.260
<v Brian Okken>Yeah, I'm with her on this.

00:04:04.600 --> 00:04:06.140
<v Michael Kennedy>You don't necessarily need a framework.

00:04:06.220 --> 00:04:07.100
<v Michael Kennedy>I know there's great frameworks.

00:04:07.180 --> 00:04:11.260
<v Michael Kennedy>like there's FastAPI and others and no shade on those things.

00:04:11.540 --> 00:04:15.980
<v Michael Kennedy>But if you already have a web app, you already have a framework that is serving web stuff.

00:04:16.109 --> 00:04:19.260
<v Michael Kennedy>And do you really want to say, well, now we're going to do a completely different one because

00:04:19.290 --> 00:04:21.079
<v Michael Kennedy>I need the response to be JSON?

00:04:21.900 --> 00:04:22.900
<v Speaker 3>Not necessarily, right?

00:04:23.000 --> 00:04:29.260
<v Michael Kennedy>It's all the APIs that power the talk Python mobile app are written in pyramid.

00:04:29.760 --> 00:04:32.460
<v Michael Kennedy>They're not using FastAPI because the whole app was already pyramid.

00:04:32.530 --> 00:04:35.960
<v Michael Kennedy>The data, everything it needs to know about the users and the data and the course, it's

00:04:36.120 --> 00:04:36.560
<v Michael Kennedy>all in there.

00:04:36.860 --> 00:04:42.100
<v Michael Kennedy>And all I had to do is write a JSON serializer that would take a dictionary and turn into the right kind of JSON.

00:04:42.520 --> 00:04:43.540
<v Michael Kennedy>And literally, I have an API.

00:04:43.780 --> 00:04:46.440
<v Michael Kennedy>You know, a lot of these frameworks, I don't like them.

00:04:46.840 --> 00:04:48.200
<v Michael Kennedy>I'm not knocking on any particular.

00:04:49.220 --> 00:04:55.500
<v Michael Kennedy>But these add rest to your thing so often become what that means is an HTTP view of your database.

00:04:56.040 --> 00:05:01.440
<v Michael Kennedy>Like, here's how you do get, post, put, and delete to rows in this table.

00:05:01.840 --> 00:05:04.700
<v Michael Kennedy>And then, you know, it's like, okay, that's not the way I want to structure my.

00:05:05.220 --> 00:05:07.200
<v Michael Kennedy>I don't want to just give my database to like the world.

00:05:07.290 --> 00:05:09.560
<v Michael Kennedy>I want to have control over actions that you take,

00:05:09.690 --> 00:05:10.660
<v Michael Kennedy>like authenticate.

00:05:10.830 --> 00:05:12.760
<v Michael Kennedy>And that's not like just access to the table,

00:05:12.960 --> 00:05:13.460
<v Michael Kennedy>you know, it's weird.

00:05:13.860 --> 00:05:14.520
<v Michael Kennedy>So I don't know.

00:05:14.520 --> 00:05:16.040
<v Michael Kennedy>I find them not to be,

00:05:16.070 --> 00:05:17.120
<v Michael Kennedy>I know it's like,

00:05:17.200 --> 00:05:19.040
<v Michael Kennedy>well, we absolutely have to reach for a rest thing.

00:05:19.150 --> 00:05:20.440
<v Michael Kennedy>I don't know that that's necessarily true.

00:05:20.720 --> 00:05:24.260
<v Brian Okken>It's also very true that you don't like,

00:05:24.500 --> 00:05:25.740
<v Brian Okken>you don't really need a full framework

00:05:25.920 --> 00:05:27.160
<v Brian Okken>if really you're the client.

00:05:28.120 --> 00:05:29.980
<v Brian Okken>If, I mean, I would say,

00:05:30.300 --> 00:05:33.339
<v Brian Okken>I would probably lean on others to create a better API

00:05:33.360 --> 00:05:37.280
<v Brian Okken>or better experience if that's the product,

00:05:37.480 --> 00:05:38.740
<v Brian Okken>if the API is the product.

00:05:38.860 --> 00:05:40.440
<v Brian Okken>But if the product is your website

00:05:40.620 --> 00:05:43.400
<v Brian Okken>and you've got a framework, you're using Django,

00:05:43.800 --> 00:05:45.240
<v Brian Okken>you've got a database there,

00:05:45.500 --> 00:05:48.380
<v Brian Okken>but you have something else that wants to access that data

00:05:49.200 --> 00:05:52.560
<v Brian Okken>so that you're presenting some extra endpoints.

00:05:52.900 --> 00:05:54.540
<v Brian Okken>If you just have a couple of endpoints

00:05:54.540 --> 00:05:57.840
<v Brian Okken>that you need to create to get some data out

00:05:58.060 --> 00:06:00.040
<v Brian Okken>or push some data in,

00:06:00.100 --> 00:06:03.660
<v Brian Okken>you don't necessarily need the full-blown extra framework.

00:06:03.820 --> 00:06:05.740
<v Brian Okken>I think something simple would work just fine.

00:06:05.960 --> 00:06:06.680
<v Brian Okken>Yeah, for sure.

00:06:07.260 --> 00:06:07.420
<v Brian Okken>Yeah.

00:06:08.460 --> 00:06:10.460
<v Brian Okken>Well, let's get out of the web a little bit

00:06:10.580 --> 00:06:12.480
<v Brian Okken>and maybe go to the command line.

00:06:13.340 --> 00:06:13.860
<v Brian Okken>I'm going to spend a lot.

00:06:14.000 --> 00:06:17.280
<v Michael Kennedy>I basically have a theme running through this,

00:06:17.840 --> 00:06:19.700
<v Michael Kennedy>my picks, my topics for the day.

00:06:20.600 --> 00:06:23.220
<v Michael Kennedy>So use git on the command line, I'm sure, Brian.

00:06:23.600 --> 00:06:23.660
<v Michael Kennedy>Yeah.

00:06:23.660 --> 00:06:27.060
<v Michael Kennedy>A little bit of git add, dot, git push, all those things.

00:06:27.220 --> 00:06:29.020
<v Michael Kennedy>I'm a big fan of using the GUI tools,

00:06:29.240 --> 00:06:31.260
<v Michael Kennedy>especially the tools built into your IDE,

00:06:31.620 --> 00:06:34.300
<v Michael Kennedy>you know, PyCharm and VS Code plus derivatives.

00:06:34.480 --> 00:06:36.600
<v Michael Kennedy>That means like 20 different things these days.

00:06:37.440 --> 00:06:39.180
<v Michael Kennedy>They have really fantastic tools.

00:06:39.740 --> 00:06:41.860
<v Michael Kennedy>And I don't rarely, I rarely feel the need,

00:06:41.940 --> 00:06:44.280
<v Michael Kennedy>like I got to be in the command line to mess with it,

00:06:44.540 --> 00:06:45.400
<v Michael Kennedy>but I still do plenty.

00:06:45.900 --> 00:06:48.660
<v Michael Kennedy>That said, where I haven't been doing a lot of stuff

00:06:49.000 --> 00:06:51.740
<v Michael Kennedy>in the command line is at the GitHub level.

00:06:52.360 --> 00:06:52.940
<v Speaker 3>Oh, right, yeah.

00:06:53.300 --> 00:06:55.300
<v Michael Kennedy>Right, like you're like, okay, I'm going to git push, get pull.

00:06:55.320 --> 00:06:57.520
<v Michael Kennedy>Oh, there's a PR, I need to check that out.

00:06:57.660 --> 00:07:00.020
<v Michael Kennedy>what is the command again to check out that PR?

00:07:01.560 --> 00:07:04.360
<v Michael Kennedy>Or I want to refer to an issue.

00:07:04.750 --> 00:07:05.340
<v Michael Kennedy>How do I do that?

00:07:05.480 --> 00:07:06.660
<v Michael Kennedy>Like, what was the number of it again?

00:07:06.900 --> 00:07:08.600
<v Michael Kennedy>Because there's really cool things in Git.

00:07:08.600 --> 00:07:09.400
<v Michael Kennedy>You can say Git commit.

00:07:09.790 --> 00:07:11.300
<v Michael Kennedy>And for the message, you can say,

00:07:12.820 --> 00:07:15.580
<v Michael Kennedy>fixes or resolves number one, two, three.

00:07:15.750 --> 00:07:17.800
<v Michael Kennedy>And that'll literally associate the commit

00:07:17.830 --> 00:07:19.600
<v Michael Kennedy>with the issue one, two, three, and close it

00:07:19.750 --> 00:07:20.660
<v Brian Okken>when you push it into the server.

00:07:20.910 --> 00:07:22.120
<v Brian Okken>Which sometimes surprises me.

00:07:22.420 --> 00:07:23.520
<v Brian Okken>But yeah, it's good to know.

00:07:23.640 --> 00:07:27.140
<v Michael Kennedy>Yeah, I've accidentally put an issue in a PR,

00:07:27.220 --> 00:07:29.320
<v Michael Kennedy>but then close the PR and it's closed issue.

00:07:29.370 --> 00:07:30.560
<v Michael Kennedy>I'm like, no, no, no, that's actually,

00:07:31.610 --> 00:07:32.520
<v Michael Kennedy>we're not done yet, hold on.

00:07:32.740 --> 00:07:35.140
<v Brian Okken>Look, doesn't quite resolve blah.

00:07:36.060 --> 00:07:36.360
<v Brian Okken>Whoops.

00:07:36.760 --> 00:07:38.520
<v Brian Okken>Yeah, then it actually closes it.

00:07:38.520 --> 00:07:39.220
<v Michael Kennedy>You got to reopen it.

00:07:39.360 --> 00:07:39.600
<v Michael Kennedy>Whoopsie.

00:07:40.080 --> 00:07:42.700
<v Michael Kennedy>Anyway, so what I want to talk about today

00:07:43.020 --> 00:07:45.780
<v Michael Kennedy>is the GitHub CLI.

00:07:46.240 --> 00:07:47.840
<v Michael Kennedy>So I don't know how long this has been around,

00:07:48.640 --> 00:07:50.960
<v Michael Kennedy>well, presumably, but I think it's pretty new.

00:07:51.250 --> 00:07:55.160
<v Michael Kennedy>And so the idea is you can ask for status of PRs

00:07:55.520 --> 00:07:56.740
<v Michael Kennedy>or you can check out,

00:07:56.960 --> 00:07:57.640
<v Michael Kennedy>Like this one's really nice.

00:07:59.219 --> 00:08:00.400
<v Michael Kennedy>GHPR checkout 12.

00:08:00.800 --> 00:08:01.120
<v Michael Kennedy>That's it.

00:08:01.320 --> 00:08:01.920
<v Michael Kennedy>It's all you got to do.

00:08:02.340 --> 00:08:03.440
<v Michael Kennedy>And it's figured out the branches.

00:08:03.840 --> 00:08:04.600
<v Michael Kennedy>It's pulled it.

00:08:04.640 --> 00:08:06.160
<v Michael Kennedy>It's checked out the right one, right?

00:08:06.320 --> 00:08:07.260
<v Michael Kennedy>That's really cool, isn't it?

00:08:07.480 --> 00:08:07.880
<v Michael Kennedy>Oh, yeah.

00:08:08.360 --> 00:08:08.440
<v Michael Kennedy>Yeah.

00:08:08.600 --> 00:08:12.100
<v Michael Kennedy>So to get a sense of what's possible, because when I saw this, I'm like, I think this will

00:08:12.100 --> 00:08:12.980
<v Michael Kennedy>be cool, but why?

00:08:14.020 --> 00:08:14.480
<v Michael Kennedy>Look at the manual.

00:08:14.660 --> 00:08:16.580
<v Michael Kennedy>And the manual has example usages.

00:08:17.060 --> 00:08:18.780
<v Michael Kennedy>That's how I would start to look.

00:08:18.940 --> 00:08:21.460
<v Michael Kennedy>So it says, I could check out a pull request locally.

00:08:21.620 --> 00:08:22.760
<v Michael Kennedy>And it's the one that I just said.

00:08:23.080 --> 00:08:23.220
<v Michael Kennedy>Boom.

00:08:23.580 --> 00:08:23.700
<v Michael Kennedy>Right.

00:08:24.040 --> 00:08:24.380
<v Michael Kennedy>Pretty neat.

00:08:24.640 --> 00:08:25.720
<v Michael Kennedy>You can do it by branch name.

00:08:26.260 --> 00:08:30.420
<v Michael Kennedy>You can clone a repository with just the owner and repo.

00:08:30.680 --> 00:08:33.460
<v Michael Kennedy>So you could say ghrepo clone, you know,

00:08:33.880 --> 00:08:37.479
<v Michael Kennedy>Mike C. Kennedy slash Jinja dash partials or whatever.

00:08:37.680 --> 00:08:38.659
<v Michael Kennedy>You don't have to know the whole URL.

00:08:38.800 --> 00:08:40.340
<v Michael Kennedy>It's not that huge of a thing, but it's kind of nice.

00:08:40.640 --> 00:08:43.080
<v Michael Kennedy>You can also clone it as if you were doing git clone,

00:08:43.200 --> 00:08:46.000
<v Michael Kennedy>but you like to type gh-based repo instead of git.

00:08:46.320 --> 00:08:46.700
<v Michael Kennedy>I don't know.

00:08:47.220 --> 00:08:51.440
<v Michael Kennedy>You can create PRs from a branch, which is pretty cool.

00:08:51.740 --> 00:08:54.800
<v Michael Kennedy>And it just asks you what's the title, what's the body, and so on.

00:08:55.360 --> 00:08:57.820
<v Michael Kennedy>You can open up the browser, like take me to GitHub.

00:08:58.260 --> 00:08:59.340
<v Michael Kennedy>You can mess with forks.

00:09:00.080 --> 00:09:00.820
<v Michael Kennedy>What else can you do?

00:09:01.220 --> 00:09:03.540
<v Michael Kennedy>Yeah, you can see issues like GitHub PR list.

00:09:04.160 --> 00:09:06.840
<v Michael Kennedy>It'll show you whether they're open, who they're associated with.

00:09:07.120 --> 00:09:07.860
<v Michael Kennedy>Same thing for issues.

00:09:08.340 --> 00:09:11.480
<v Michael Kennedy>It even puts the tag in parentheses, parenthetically tags it.

00:09:11.480 --> 00:09:11.840
<v Michael Kennedy>I love it.

00:09:12.060 --> 00:09:13.460
<v Michael Kennedy>Anyway, I think this is kind of handy.

00:09:13.610 --> 00:09:13.980
<v Michael Kennedy>What do you think?

00:09:14.300 --> 00:09:17.060
<v Brian Okken>Yeah, you can do releases too, right?

00:09:17.430 --> 00:09:18.860
<v Brian Okken>Did you already comment on that?

00:09:19.100 --> 00:09:20.040
<v Michael Kennedy>I have not commented on that.

00:09:20.800 --> 00:09:23.120
<v Brian Okken>Because that's often the thing that I need to,

00:09:23.350 --> 00:09:25.080
<v Brian Okken>like I've got everything all automated.

00:09:25.140 --> 00:09:28.860
<v Brian Okken>except for I still go over to GitHub itself

00:09:30.080 --> 00:09:32.180
<v Brian Okken>to create a release item or release.

00:09:32.220 --> 00:09:33.300
<v Michael Kennedy>Yeah, I do too.

00:09:33.660 --> 00:09:35.840
<v Brian Okken>So being able to do that locally, that's pretty cool.

00:09:36.160 --> 00:09:38.820
<v Michael Kennedy>I've got the generation of the release notes automated

00:09:39.120 --> 00:09:41.080
<v Michael Kennedy>and the tagging of the branch automated,

00:09:41.210 --> 00:09:42.980
<v Michael Kennedy>but I still can't release it automatically.

00:09:43.340 --> 00:09:43.640
<v Michael Kennedy>You know what I mean?

00:09:43.920 --> 00:09:46.560
<v Brian Okken>Now you can do it, at least do it on the command line.

00:09:46.680 --> 00:09:47.220
<v Michael Kennedy>A little bit more.

00:09:47.520 --> 00:09:47.780
<v Michael Kennedy>That's awesome.

00:09:48.380 --> 00:09:50.860
<v Michael Kennedy>Anyway, check this out if you're a CLI person,

00:09:51.520 --> 00:09:53.220
<v Michael Kennedy>you know, GH, your new command.

00:09:53.460 --> 00:09:54.720
<v Brian Okken>Yeah, so go figure.

00:09:54.880 --> 00:09:56.760
<v Brian Okken>that you're the command line person today

00:09:56.820 --> 00:09:58.060
<v Brian Okken>and I'm the web person.

00:09:59.480 --> 00:10:01.780
<v Brian Okken>So we're going to hop back over the web

00:10:02.040 --> 00:10:03.580
<v Brian Okken>and talk about web scraping.

00:10:04.060 --> 00:10:07.540
<v Brian Okken>So, and web scraping is, you know, not evil.

00:10:08.360 --> 00:10:11.120
<v Brian Okken>Sometimes it's, especially if there's no API,

00:10:11.920 --> 00:10:13.980
<v Brian Okken>it might be the only way to get some data from something.

00:10:15.200 --> 00:10:18.460
<v Brian Okken>So there's a project that I found out on Reddit

00:10:19.540 --> 00:10:22.940
<v Brian Okken>called Can I Scrape, which is sort of a fun name.

00:10:23.660 --> 00:10:35.860
<v Brian Okken>And it basically analyzes the website's anti-bot protections to let you know whether or not you should even try to build a scraper for it or how many roadblocks you're going to run into.

00:10:36.960 --> 00:10:44.700
<v Brian Okken>And also, I think it's just sort of, I don't know, it seems like kind of a nice thing to do instead of to check all the rules out and stuff.

00:10:44.780 --> 00:10:52.880
<v Brian Okken>So it looks for protections like, I don't know what WAF is, but captures and rate limits, honeypots.

00:10:54.700 --> 00:11:06.680
<v Brian Okken>And then it rates it a difficulty score from zero to 10, easy to hard, and specific recommendations on what tools or proxies you'll need and the estimated complexity to build it.

00:11:07.920 --> 00:11:13.720
<v Brian Okken>that would be a decent thing to use on your own stuff if you are intending somebody,

00:11:13.970 --> 00:11:17.340
<v Brian Okken>if you just tell somebody, oh, I don't have an API for that, but go scrape the data.

00:11:17.760 --> 00:11:20.620
<v Speaker 3>What kind of a job are you asking them to do?

00:11:21.480 --> 00:11:25.400
<v Brian Okken>And I was like, I didn't see right away a comment on the robots,

00:11:26.350 --> 00:11:31.920
<v Brian Okken>but looking down through it, what it analyzes, it does check the robots.txt to make sure that you can.

00:11:32.090 --> 00:11:36.140
<v Brian Okken>And that's one of the things I want to be careful of somebody's,

00:11:36.400 --> 00:11:38.680
<v Brian Okken>what they say you should do and not do with their website.

00:11:39.860 --> 00:11:40.520
<v Brian Okken>So that's cool.

00:11:40.940 --> 00:11:43.100
<v Brian Okken>And anyway, I just thought it was nice.

00:11:43.520 --> 00:11:48.160
<v Brian Okken>There's an interesting discussion on the link to the Reddit discretion as well.

00:11:49.120 --> 00:11:53.540
<v Brian Okken>Just a target audience of hobbyists, but also just like data people.

00:11:53.770 --> 00:11:57.460
<v Brian Okken>Like sometimes there's data that's available on the web that, like I said,

00:11:57.490 --> 00:12:00.540
<v Brian Okken>no, there's no REST API yet for it or there won't be.

00:12:00.880 --> 00:12:01.660
<v Brian Okken>But yeah, anyway.

00:12:01.940 --> 00:12:02.480
<v Michael Kennedy>Yeah, I love it.

00:12:02.770 --> 00:12:03.240
<v Michael Kennedy>Very interesting.

00:12:03.480 --> 00:12:09.380
<v Michael Kennedy>This whole web scraping thing is getting more and more contentious with AI training and all of that.

00:12:09.580 --> 00:12:10.960
<v Michael Kennedy>It's good to be a good citizen of the web.

00:12:11.320 --> 00:12:11.500
<v Brian Okken>Yeah.

00:12:11.640 --> 00:12:15.760
<v Brian Okken>And also, like, maybe I'd possibly use some of these to check your own.

00:12:15.800 --> 00:12:28.480
<v Brian Okken>If you want to lock it down, if you really want to make, if you want to make scraping a real pain in the butt for people looking at your website, you know, you can use this to try to make your score as close to 10 as possible.

00:12:30.220 --> 00:12:30.620
<v Michael Kennedy>Exactly.

00:12:31.060 --> 00:12:31.180
<v Michael Kennedy>Exactly.

00:12:31.560 --> 00:12:31.800
<v Michael Kennedy>All right.

00:12:32.360 --> 00:12:33.580
<v Michael Kennedy>That's not what I want to talk about.

00:12:33.680 --> 00:12:35.140
<v Michael Kennedy>That's what I want to talk about next.

00:12:36.060 --> 00:12:39.680
<v Michael Kennedy>So I want to talk about Git, a totally different tool, though.

00:12:39.780 --> 00:12:41.120
<v Michael Kennedy>This is completely unrelated to the other one.

00:12:41.790 --> 00:12:44.740
<v Michael Kennedy>Okay, so I launched this CLI tool.

00:12:44.940 --> 00:12:51.900
<v Michael Kennedy>It's on PyPI, but primarily is intended to be used as a CLI type of thing,

00:12:51.990 --> 00:12:55.000
<v Michael Kennedy>like rough, not to be built upon, but to be run.

00:12:55.260 --> 00:12:55.560
<v Michael Kennedy>You know what I mean?

00:12:55.690 --> 00:12:57.260
<v Michael Kennedy>So you can uv tool install it.

00:12:57.640 --> 00:13:02.160
<v Speaker 3>And the idea is I called it Giddyup, G-I-T-T-Y.

00:13:02.200 --> 00:13:07.060
<v Michael Kennedy>for updating your, a whole directory tree of GitHub repositories.

00:13:07.550 --> 00:13:07.680
<v Michael Kennedy>Okay.

00:13:08.060 --> 00:13:11.220
<v Michael Kennedy>I may have talked about this before, something I kind of built like in passing.

00:13:11.720 --> 00:13:16.840
<v Michael Kennedy>And then I was, last week I decided I'm creating a new course,

00:13:17.560 --> 00:13:19.100
<v Michael Kennedy>Agentic AI programming in Python.

00:13:19.290 --> 00:13:19.740
<v Michael Kennedy>How about that?

00:13:20.100 --> 00:13:23.940
<v Speaker 3>And I'm like, let me think of something I can try to take that I know is a cool idea

00:13:23.990 --> 00:13:28.120
<v Michael Kennedy>that would seem plausible, but really just make it a super nice app.

00:13:28.290 --> 00:13:30.120
<v Michael Kennedy>Add a bunch of features and so on.

00:13:30.500 --> 00:13:35.680
<v Michael Kennedy>So I took that little utility I had and I spent a lot of time with CloudSonna and Giddyup

00:13:35.860 --> 00:13:36.860
<v Michael Kennedy>is the output.

00:13:37.960 --> 00:13:40.120
<v Michael Kennedy>So it says, never forget to pull again.

00:13:40.380 --> 00:13:42.920
<v Michael Kennedy>Automatically discover and update all your GitHub repositories in one command.

00:13:43.120 --> 00:13:44.160
<v Michael Kennedy>So here's the thing.

00:13:44.260 --> 00:13:48.380
<v Michael Kennedy>I've got three computers, one of them is a laptop, and they all have a bunch of GitHub

00:13:48.640 --> 00:13:50.900
<v Michael Kennedy>repositories, like hundreds of GitHub repositories.

00:13:51.400 --> 00:13:52.200
<v Michael Kennedy>And it drives me crazy.

00:13:52.360 --> 00:13:54.840
<v Michael Kennedy>I'll go to some older one I haven't worked with for a while.

00:13:55.140 --> 00:13:56.560
<v Michael Kennedy>Like, I don't think there's been any change to this.

00:13:56.570 --> 00:13:57.460
<v Michael Kennedy>And I'll start messing with it.

00:13:57.560 --> 00:13:58.580
<v Michael Kennedy>Then I'll try to push it.

00:13:58.580 --> 00:14:00.080
<v Michael Kennedy>It'll go, please pull your changes first.

00:14:00.280 --> 00:14:02.440
<v Michael Kennedy>I'm like, uh-oh, uh-oh, that's not good,

00:14:03.160 --> 00:14:04.780
<v Michael Kennedy>especially if it's something to do with the courses

00:14:05.060 --> 00:14:07.880
<v Michael Kennedy>where it might be a PowerPoint that cannot be merged.

00:14:08.260 --> 00:14:08.680
<v Michael Kennedy>You know what I mean?

00:14:08.840 --> 00:14:10.520
<v Michael Kennedy>You're like, oh, no, this is real bad.

00:14:11.360 --> 00:14:12.380
<v Speaker 3>And it's out of date, right?

00:14:12.900 --> 00:14:14.420
<v Michael Kennedy>And so I created this thing so I can just,

00:14:14.660 --> 00:14:17.420
<v Michael Kennedy>especially before I grab my laptop and head off to the coffee shop,

00:14:17.520 --> 00:14:20.840
<v Michael Kennedy>I can just go into part of my GitHub repos and just say, Giddyup.

00:14:21.040 --> 00:14:22.300
<v Michael Kennedy>And it goes through in parallel,

00:14:22.840 --> 00:14:24.660
<v Michael Kennedy>and it just looks at all the repositories.

00:14:25.140 --> 00:14:27.820
<v Michael Kennedy>Does it get pull on all the ones that don't have anything checked out?

00:14:27.860 --> 00:14:29.500
<v Michael Kennedy>And the ones that are not committed yet,

00:14:29.660 --> 00:14:30.900
<v Michael Kennedy>It says, hey, I don't want to mess with this one.

00:14:30.990 --> 00:14:33.360
<v Michael Kennedy>It has these three files unchanged and so on.

00:14:33.530 --> 00:14:37.560
<v Michael Kennedy>So it's just like a nice little utility people can run to update all their code.

00:14:37.590 --> 00:14:39.460
<v Michael Kennedy>I'll see if I can find a little output down here.

00:14:39.980 --> 00:14:40.900
<v Michael Kennedy>It's got a ton of features.

00:14:41.010 --> 00:14:43.480
<v Michael Kennedy>But yeah, I'd say update this thing,

00:14:43.530 --> 00:14:47.560
<v Michael Kennedy>and it traverses hierarchically through all the GitHub repositories.

00:14:47.610 --> 00:14:48.580
<v Michael Kennedy>It says these are up to date.

00:14:48.760 --> 00:14:50.620
<v Michael Kennedy>I actually pulled a couple commits for this one.

00:14:50.900 --> 00:14:52.400
<v Michael Kennedy>This one had an error, and it just gives you,

00:14:52.800 --> 00:14:56.339
<v Michael Kennedy>basically gets all of your GitHub repositories as much in sync

00:14:56.560 --> 00:14:58.560
<v Michael Kennedy>across all the branches as much as possible

00:14:58.860 --> 00:14:59.560
<v Michael Kennedy>without breaking anything.

00:14:59.840 --> 00:15:00.160
<v Michael Kennedy>Oh, cool.

00:15:00.440 --> 00:15:02.260
<v Michael Kennedy>Yeah, so anyway, I put that out there for you.

00:15:02.260 --> 00:15:04.000
<v Michael Kennedy>I think people might like it.

00:15:04.120 --> 00:15:06.860
<v Michael Kennedy>I didn't, I just put it out there two days or three days ago

00:15:07.120 --> 00:15:09.580
<v Michael Kennedy>and it's already got some stars and forks

00:15:09.580 --> 00:15:11.340
<v Michael Kennedy>and I haven't announced it at all whatsoever,

00:15:11.720 --> 00:15:12.560
<v Michael Kennedy>not even on social media.

00:15:12.980 --> 00:15:14.760
<v Michael Kennedy>So people found it and started, that's cool.

00:15:15.060 --> 00:15:15.640
<v Michael Kennedy>Yeah, nice.

00:15:16.140 --> 00:15:17.160
<v Michael Kennedy>All right, so GittyUp.

00:15:18.000 --> 00:15:21.400
<v Brian Okken>I have a feeling that maybe people watch your repo

00:15:21.640 --> 00:15:22.160
<v Brian Okken>a little bit.

00:15:22.480 --> 00:15:24.360
<v Michael Kennedy>I think that's what it is, like the GitHub.

00:15:24.820 --> 00:15:32.160
<v Michael Kennedy>And to be honest, I am a super fan of just clicking on the GitHub logo and going and just looking at what's flowing by.

00:15:32.400 --> 00:15:33.980
<v Michael Kennedy>I'm starting to follow more and more people.

00:15:34.170 --> 00:15:35.300
<v Michael Kennedy>I appreciate people following me.

00:15:35.960 --> 00:15:38.800
<v Michael Kennedy>That's a really nice source of just, hey, what's interesting?

00:15:39.220 --> 00:15:42.200
<v Michael Kennedy>Because if people you follow star something, that shows up.

00:15:42.300 --> 00:15:45.720
<v Michael Kennedy>You're like, oh, this person found that interesting enough to star it.

00:15:46.010 --> 00:15:47.960
<v Michael Kennedy>And I definitely respect what that person is doing.

00:15:48.360 --> 00:15:49.160
<v Michael Kennedy>Let me go check this out.

00:15:49.210 --> 00:15:50.120
<v Michael Kennedy>That does look interesting.

00:15:50.820 --> 00:15:52.080
<v Brian Okken>I'm sure that's how people found it.

00:15:52.300 --> 00:15:53.020
<v Brian Okken>Okay, cool.

00:15:53.080 --> 00:15:53.540
<v Brian Okken>Yeah, cool.

00:15:54.420 --> 00:16:00.040
<v Brian Okken>Well, I want to bring up something that I've apparently spent a lot of time thinking about.

00:16:00.690 --> 00:16:02.840
<v Brian Okken>So we're done with our normal stuff, right?

00:16:03.140 --> 00:16:03.640
<v Brian Okken>We are.

00:16:04.100 --> 00:16:05.340
<v Brian Okken>Moving on to extras.

00:16:06.110 --> 00:16:07.320
<v Brian Okken>Do you want to do your extras first?

00:16:08.160 --> 00:16:08.400
<v Michael Kennedy>Sure.

00:16:08.650 --> 00:16:09.720
<v Michael Kennedy>I'll be quick about mine.

00:16:09.790 --> 00:16:09.880
<v Michael Kennedy>Okay.

00:16:10.520 --> 00:16:11.140
<v Michael Kennedy>Yeah, let's do yours.

00:16:11.750 --> 00:16:12.700
<v Michael Kennedy>Let me close this off.

00:16:12.770 --> 00:16:14.620
<v Michael Kennedy>Yeah, check out that Agentic AI programming course.

00:16:14.760 --> 00:16:15.600
<v Michael Kennedy>It's coming out this week.

00:16:16.640 --> 00:16:17.880
<v Michael Kennedy>But people listened.

00:16:18.240 --> 00:16:19.260
<v Michael Kennedy>And I don't know if they actually listened to us.

00:16:19.260 --> 00:16:21.280
<v Michael Kennedy>I think they listened to other people with the same complaint.

00:16:21.560 --> 00:16:28.480
<v Michael Kennedy>But remember how last week on PyDay, I said, great, but uv loop doesn't work with Python 3.14.

00:16:28.960 --> 00:16:32.860
<v Michael Kennedy>Well, I'm so happy to tell you as of four days ago, uv loop is back, baby.

00:16:33.400 --> 00:16:38.740
<v Michael Kennedy>And we can use it again, which mostly is awesome because I don't want to go change a bunch of projects that were just fine.

00:16:39.140 --> 00:16:44.000
<v Michael Kennedy>But if I were to swap out the foundation running them like to 3.14, they wouldn't run anymore.

00:16:44.150 --> 00:16:44.980
<v Michael Kennedy>So now it's back.

00:16:44.980 --> 00:16:46.800
<v Michael Kennedy>So there's a release for that.

00:16:47.180 --> 00:16:51.360
<v Michael Kennedy>So uv loop, while it was gone from us for a little bit, it's back.

00:16:51.840 --> 00:16:56.380
<v Michael Kennedy>And remember how I said, I wish I knew who created PyPI plus and how neat it was, because

00:16:56.440 --> 00:16:59.680
<v Speaker 3>it has just these few little gotchas that I would love to like polish it.

00:17:00.100 --> 00:17:04.459
<v Michael Kennedy>Well, they sent over a message and said, thank you so much for a feature in PyPI plus, and

00:17:04.500 --> 00:17:05.699
<v Michael Kennedy>I'm working on the bugs that you found.

00:17:06.589 --> 00:17:09.900
<v Michael Kennedy>I don't know how they heard that we were maybe their show listener or someone they know is

00:17:09.900 --> 00:17:10.699
<v Michael Kennedy>a listener of the show.

00:17:11.020 --> 00:17:11.579
<v Michael Kennedy>But yeah, look at this.

00:17:11.699 --> 00:17:15.079
<v Michael Kennedy>I can search for something with a dash and I get the lowercase and vice versa.

00:17:15.480 --> 00:17:15.780
<v Brian Okken>Oh, cool.

00:17:16.839 --> 00:17:23.280
<v Brian Okken>But also, there's some people that maybe don't have a Python podcast to complain about things.

00:17:24.740 --> 00:17:28.760
<v Brian Okken>Is there like a about us or who are we?

00:17:28.880 --> 00:17:29.320
<v Brian Okken>There is.

00:17:29.320 --> 00:17:34.360
<v Michael Kennedy>I believe I put it in, you know, the best way would be a Reddit, I believe.

00:17:34.540 --> 00:17:40.140
<v Michael Kennedy>So Royal Wizard is the one who they initially announced it on Reddit and so on.

00:17:40.140 --> 00:17:45.279
<v Michael Kennedy>So you could, and they seem to be talking about the changes and the features over on

00:17:45.320 --> 00:17:51.680
<v Michael Kennedy>slash r you know r slash python so that's probably the best way okay yeah cool and then finally i you

00:17:51.680 --> 00:17:57.660
<v Michael Kennedy>know i told you about my host show me your ls which looked like show me your is because of the fonts

00:17:58.030 --> 00:18:03.000
<v Michael Kennedy>well people uh sent some feedback and i just wanted to share one because this is a common theme over

00:18:03.120 --> 00:18:08.920
<v Michael Kennedy>and over thomas spenson uh said hey i'm currently using new shell which for some reason i read as a

00:18:08.920 --> 00:18:12.839
<v Michael Kennedy>nutshell and went about talking about it that stuff that was the thing but said hey i'm currently using

00:18:13.080 --> 00:18:17.160
<v Michael Kennedy>and exploring New Shell, and its LS is something else clever.

00:18:18.780 --> 00:18:23.800
<v Michael Kennedy>So you can just kind of do almost query syntax against things like LS,

00:18:24.200 --> 00:18:26.680
<v Michael Kennedy>structured data, PS, JSON, et cetera.

00:18:27.060 --> 00:18:27.740
<v Michael Kennedy>So like, look at this.

00:18:28.040 --> 00:18:28.860
<v Michael Kennedy>This is crazy, right?

00:18:29.220 --> 00:18:29.460
<v Brian Okken>Yeah.

00:18:29.740 --> 00:18:33.540
<v Michael Kennedy>And following on, found out today that New Shell is using Polars

00:18:33.540 --> 00:18:35.800
<v Michael Kennedy>and that plugins can be written in Python.

00:18:36.420 --> 00:18:37.340
<v Michael Kennedy>So even cooler.

00:18:37.740 --> 00:18:39.040
<v Michael Kennedy>I'm not doing anything with New Shell.

00:18:39.350 --> 00:18:40.680
<v Michael Kennedy>I literally had never heard of it.

00:18:40.920 --> 00:18:41.620
<v Michael Kennedy>It's that new.

00:18:42.100 --> 00:18:42.600
<v Michael Kennedy>No, I don't know.

00:18:42.660 --> 00:18:44.580
<v Michael Kennedy>I hadn't heard of it before I wrote that article,

00:18:45.060 --> 00:18:46.720
<v Michael Kennedy>but it does seem pretty interesting.

00:18:46.850 --> 00:18:49.300
<v Michael Kennedy>I am not here necessarily to switch to it,

00:18:49.300 --> 00:18:50.020
<v Michael Kennedy>but look at this.

00:18:50.220 --> 00:18:52.420
<v Michael Kennedy>LS pipe, where size greater than 10 megabytes,

00:18:52.820 --> 00:18:54.340
<v Michael Kennedy>pipe sorted by, modified.

00:18:54.530 --> 00:18:54.640
<v Michael Kennedy>Boom.

00:18:55.360 --> 00:18:56.300
<v Michael Kennedy>I can see that as powerful.

00:18:56.620 --> 00:18:57.820
<v Brian Okken>Yeah, that's pretty cool.

00:18:58.720 --> 00:18:59.760
<v Brian Okken>All right, that's it for my extras.

00:19:00.160 --> 00:19:03.500
<v Brian Okken>Yeah, and I really would like to try new stuff.

00:19:04.900 --> 00:19:08.760
<v Brian Okken>For me, well, I'm using Mac, Windows, Linux,

00:19:09.890 --> 00:19:10.700
<v Brian Okken>all sorts of stuff,

00:19:11.100 --> 00:19:16.020
<v Brian Okken>And trying to get, so to be fair, I just sort of use,

00:19:16.980 --> 00:19:20.400
<v Brian Okken>obviously I use Z shell on Mac because that's what it comes with.

00:19:20.630 --> 00:19:25.840
<v Brian Okken>But I kind of just use the bash version of stuff because it's common denominator

00:19:26.070 --> 00:19:29.960
<v Brian Okken>over everything. Anyway. But that's, you know, just me griping.

00:19:31.380 --> 00:19:36.080
<v Brian Okken>I want to talk about something old or new or not yet. Lazy imports.

00:19:36.340 --> 00:19:40.840
<v Brian Okken>So two episodes ago, we talked about a PEP 8, 10 explicit lazy imports.

00:19:40.920 --> 00:19:46.780
<v Brian Okken>And I was super excited about it coming in 3.15, but it's still in draft mode, so we don't know if we'll get it.

00:19:47.320 --> 00:20:01.120
<v Brian Okken>And then last week, I talked about if you want to use lazy imports right now, how you can do it just with Python, of just throwing the import in the first function before you start using it.

00:20:02.120 --> 00:20:07.520
<v Brian Okken>And then, but there's some other people thinking about lazy imports and how cool they would be also.

00:20:07.600 --> 00:20:12.560
<v Brian Okken>So Hugo wrote an article called Three Times Faster with Lazy Imports.

00:20:12.840 --> 00:20:17.660
<v Brian Okken>This is, and actually, wow, this is something I don't have the capacity to do.

00:20:17.790 --> 00:20:22.440
<v Brian Okken>I probably would maybe, but anyway, of just implementing it.

00:20:22.640 --> 00:20:26.380
<v Brian Okken>So there's a, he did a, he fetched the CPython.

00:20:26.640 --> 00:20:31.400
<v Brian Okken>There's apparently a lazy import reference implementation included in the PEP.

00:20:31.680 --> 00:20:41.780
<v Brian Okken>So he built Python with the patch and then also released it as if it was 314 so that he could get away with not building a whole bunch of other stuff.

00:20:43.060 --> 00:20:49.820
<v Brian Okken>And then went ahead and did some, Hugo does the PyPI stat stuff, which I love that tool.

00:20:50.840 --> 00:20:56.180
<v Brian Okken>And he did a pip dep tree and did some lazy import stuff on it to see if it would speed it up.

00:20:56.330 --> 00:20:58.620
<v Brian Okken>And his benchmarks look very promising.

00:21:00.420 --> 00:21:02.200
<v Brian Okken>speeds it up quite a bit.

00:21:03.710 --> 00:21:08.440
<v Brian Okken>1.31 times faster for one implementation.

00:21:09.010 --> 00:21:11.040
<v Brian Okken>And then kept going.

00:21:11.500 --> 00:21:13.040
<v Brian Okken>And let's see.

00:21:13.110 --> 00:21:14.720
<v Brian Okken>I can't remember what this last one is.

00:21:15.900 --> 00:21:18.160
<v Brian Okken>We no longer need inline imports trick.

00:21:18.500 --> 00:21:21.620
<v Brian Okken>Anyway, a couple of different things he tested.

00:21:22.820 --> 00:21:24.480
<v Brian Okken>Either way, it's faster to use it.

00:21:24.740 --> 00:21:27.260
<v Brian Okken>So I'd be excited to get that in.

00:21:27.940 --> 00:21:29.200
<v Brian Okken>However, somebody else.

00:21:30.200 --> 00:21:32.640
<v Brian Okken>So there's a great thread also, we'll link to it,

00:21:32.860 --> 00:21:35.900
<v Brian Okken>a great thread on Mastodon, which I clicked on accidentally,

00:21:36.820 --> 00:21:41.680
<v Brian Okken>to talk about between Graham and him and others about his implementation.

00:21:42.320 --> 00:21:46.640
<v Brian Okken>Okay, so top imports 105, the normal imports 105 milliseconds.

00:21:47.160 --> 00:21:51.960
<v Brian Okken>Inlining, which is essentially what I'm teaching people to do in my post,

00:21:52.720 --> 00:21:55.780
<v Brian Okken>46 milliseconds, so that drops it down quite a bit.

00:21:56.040 --> 00:21:58.380
<v Brian Okken>Then there's the wrapped lazy import version,

00:21:58.600 --> 00:21:59.860
<v Brian Okken>which I'm going to talk about in a second.

00:22:00.140 --> 00:22:01.820
<v Brian Okken>that drops it down to 41.

00:22:02.880 --> 00:22:06.180
<v Brian Okken>And then using 810 drops down to 35.

00:22:06.520 --> 00:22:08.000
<v Brian Okken>So there's, I guess that's it.

00:22:08.180 --> 00:22:09.880
<v Brian Okken>So he timed a whole bunch of stuff

00:22:10.680 --> 00:22:12.380
<v Brian Okken>and talks about it in the article.

00:22:13.760 --> 00:22:15.980
<v Brian Okken>Like 3x speed up with the,

00:22:16.320 --> 00:22:18.640
<v Brian Okken>if we put it in 315, that's awesome.

00:22:19.640 --> 00:22:19.740
<v Brian Okken>Yeah.

00:22:20.040 --> 00:22:23.620
<v Brian Okken>And he's timing PyPI stats with help.

00:22:24.020 --> 00:22:25.620
<v Brian Okken>So the help is supposed to be really fast

00:22:25.820 --> 00:22:26.940
<v Brian Okken>and not actually do anything.

00:22:27.280 --> 00:22:29.159
<v Brian Okken>So, and that's kind of a cool way

00:22:29.180 --> 00:22:32.640
<v Brian Okken>to test it is you're running your application

00:22:33.040 --> 00:22:34.240
<v Brian Okken>or your command line application,

00:22:34.440 --> 00:22:36.240
<v Brian Okken>but not actually doing work.

00:22:36.460 --> 00:22:38.420
<v Brian Okken>It shouldn't import the world then, right?

00:22:39.200 --> 00:22:39.320
<v Brian Okken>So.

00:22:39.660 --> 00:22:39.800
<v Brian Okken>Yeah.

00:22:40.120 --> 00:22:41.340
<v Michael Kennedy>Even if it does a decent amount of work,

00:22:41.340 --> 00:22:42.960
<v Michael Kennedy>it probably doesn't need all the imports.

00:22:43.360 --> 00:22:43.600
<v Brian Okken>Yeah.

00:22:44.140 --> 00:22:44.300
<v Brian Okken>Right.

00:22:44.560 --> 00:22:45.880
<v Brian Okken>And if you're doing some work,

00:22:45.900 --> 00:22:47.260
<v Brian Okken>you might not need other imports,

00:22:47.360 --> 00:22:48.080
<v Brian Okken>those sort of things.

00:22:48.280 --> 00:22:50.100
<v Brian Okken>Those are good things to do.

00:22:50.300 --> 00:22:51.880
<v Speaker 3>So, and going back again,

00:22:52.080 --> 00:22:55.040
<v Brian Okken>reminding people the idea around this explicitly imports

00:22:55.340 --> 00:22:57.740
<v Brian Okken>is to mark some imports to say,

00:22:57.920 --> 00:23:02.480
<v Brian Okken>Don't actually import this until the first instance of somebody trying to use it.

00:23:03.200 --> 00:23:03.960
<v Brian Okken>That gets imported.

00:23:04.500 --> 00:23:04.860
<v Michael Kennedy>Graham.

00:23:05.040 --> 00:23:06.080
<v Brian Okken>I just, go ahead.

00:23:06.480 --> 00:23:06.540
<v Brian Okken>No.

00:23:06.760 --> 00:23:12.700
<v Michael Kennedy>I just timed GittyUp-help, which I installed via uv tool install.

00:23:13.240 --> 00:23:13.940
<v Michael Kennedy>60 milliseconds.

00:23:14.320 --> 00:23:15.140
<v Michael Kennedy>I'm pretty impressed with that.

00:23:15.300 --> 00:23:16.280
<v Michael Kennedy>That's really fast.

00:23:16.660 --> 00:23:16.880
<v Michael Kennedy>Yeah.

00:23:17.140 --> 00:23:17.220
<v Michael Kennedy>Yeah.

00:23:17.480 --> 00:23:17.900
<v Michael Kennedy>But you know what?

00:23:18.020 --> 00:23:21.840
<v Michael Kennedy>The help in the CLI arg parsing type stuff is built with arg pars.

00:23:22.260 --> 00:23:25.160
<v Brian Okken>So there's not a bunch of external stuff to pull in.

00:23:25.980 --> 00:23:27.520
<v Brian Okken>Yeah, I'm using arg pars more and more now.

00:23:27.600 --> 00:23:36.340
<v Brian Okken>Okay, so Graham was in the discussion thread and Graham Doubleton, and he also wrote a blog post called, wow, it just came out today.

00:23:36.590 --> 00:23:36.760
<v Brian Okken>Cool.

00:23:37.540 --> 00:23:39.060
<v Brian Okken>Use or updated today.

00:23:39.620 --> 00:23:41.060
<v Speaker 4>Beat the music just off the wire.

00:23:42.880 --> 00:23:46.300
<v Brian Okken>Use lazy module imports now.

00:23:46.470 --> 00:23:49.020
<v Brian Okken>And then this case is not the inline one.

00:23:49.120 --> 00:23:51.660
<v Brian Okken>And he's using the wrapped.

00:23:52.440 --> 00:23:58.060
<v Brian Okken>There's a wrapped package that is for decorators, wrappers, and monkey patching.

00:23:58.980 --> 00:23:59.880
<v Brian Okken>It's one of his packages.

00:24:00.220 --> 00:24:04.200
<v Brian Okken>And it can be used to kind of simulate lazy imports also.

00:24:05.160 --> 00:24:07.580
<v Brian Okken>Which, it's the syntax.

00:24:07.720 --> 00:24:09.040
<v Brian Okken>So it's kind of a cool article.

00:24:09.220 --> 00:24:11.020
<v Brian Okken>And the syntax is different.

00:24:11.100 --> 00:24:15.640
<v Brian Okken>So again, the lazy imports, if we get it in 3.15, it'll look like that.

00:24:15.960 --> 00:24:25.160
<v Brian Okken>lazy import json or lazy from json import something um the wrapped version is uh import wrapped and

00:24:25.640 --> 00:24:32.280
<v Brian Okken>wrapped dot lazy import so apparently wrapped has a lazy import feature which is cool um and uh but

00:24:32.420 --> 00:24:38.160
<v Brian Okken>the syntax is a lot different so i'm i'm not sure what i was what i think about that and then also

00:24:38.270 --> 00:24:44.379
<v Brian Okken>down at the bottom adam johnson reached out to him and said uh type checking kind of breaks when

00:24:44.400 --> 00:24:48.840
<v Michael Kennedy>you're using yeah so you know what i think you might be able to actually fix it i wonder if you

00:24:49.020 --> 00:24:54.960
<v Michael Kennedy>could could you know probably i was saying that you could say json colon type is json but important

00:24:55.240 --> 00:24:59.340
<v Brian Okken>but then it's it's not going to know what that is yeah you're right it that was my thought when i

00:24:59.420 --> 00:25:03.020
<v Michael Kennedy>saw this as like oh it'd be fun to play with lazy imports i'm like oh but that's going to destroy

00:25:03.300 --> 00:25:09.700
<v Brian Okken>type information in the editors right so that's where um adam's suggestion of saying if

00:25:09.800 --> 00:25:14.360
<v Brian Okken>type yet checking import json so just go ahead and actually import all the stuff if you're type

00:25:14.380 --> 00:25:16.260
<v Brian Okken>And that'll probably help the editors, I imagine.

00:25:16.700 --> 00:25:16.760
<v Brian Okken>So.

00:25:17.640 --> 00:25:17.780
<v Michael Kennedy>Wow.

00:25:18.160 --> 00:25:21.140
<v Michael Kennedy>Here's the one for the 315, because I love this idea as well.

00:25:21.360 --> 00:25:23.740
<v Michael Kennedy>And I appreciate Hugo writing up all the research.

00:25:24.300 --> 00:25:24.460
<v Brian Okken>Yeah.

00:25:25.320 --> 00:25:29.860
<v Brian Okken>So, and also Graham for talking about how to get around it with rap to that school.

00:25:30.000 --> 00:25:31.720
<v Brian Okken>So, and a little faster than my man.

00:25:32.260 --> 00:25:32.500
<v Brian Okken>All right.

00:25:33.820 --> 00:25:36.120
<v Brian Okken>I'm feeling lazy still, but how about funny?

00:25:36.320 --> 00:25:37.040
<v Brian Okken>Do we got something funny?

00:25:37.380 --> 00:25:37.780
<v Brian Okken>Oh, yeah.

00:25:38.080 --> 00:25:38.620
<v Michael Kennedy>I got something.

00:25:38.720 --> 00:25:43.040
<v Michael Kennedy>Actually, really, really quick real-time follow-up, because, I mean, we're covering stuff that

00:25:43.160 --> 00:25:43.720
<v Michael Kennedy>came out today.

00:25:44.540 --> 00:25:51.500
<v Michael Kennedy>And who doesn't love to hear that AWS US East 1 in Virginia went down?

00:25:52.960 --> 00:25:55.100
<v Michael Kennedy>So right here on CNN, by the way,

00:25:55.390 --> 00:25:59.420
<v Michael Kennedy>AWS services are recovering again after a global internet outage.

00:26:00.480 --> 00:26:01.360
<v Michael Kennedy>Scroll down a little bit.

00:26:02.559 --> 00:26:04.380
<v Michael Kennedy>Somewhere about East.

00:26:04.750 --> 00:26:05.260
<v Michael Kennedy>There we are.

00:26:05.860 --> 00:26:08.680
<v Michael Kennedy>It seems like a third of the world is hosted in US East 1.

00:26:09.680 --> 00:26:10.040
<v Michael Kennedy>But you know what?

00:26:10.080 --> 00:26:13.460
<v Michael Kennedy>Our stuff is clipping along smoothly just as it should.

00:26:13.720 --> 00:26:28.880
<v Michael Kennedy>All right. So good luck to everyone who's running over there. So here's the thing, Brian, for the joke. Are you more of a fantasy person? Are you more of a science fiction? Or what's your genre of big epic storytelling?

00:26:29.420 --> 00:26:30.540
<v Brian Okken>Well, sci-fi usually.

00:26:31.320 --> 00:26:33.540
<v Brian Okken>I listen to a lot of science books right now.

00:26:33.780 --> 00:26:34.180
<v Michael Kennedy>But yeah.

00:26:34.320 --> 00:26:36.520
<v Brian Okken>Yeah, I'm personally a science fiction person.

00:26:36.860 --> 00:26:46.140
<v Michael Kennedy>I definitely take a science, a giant space sort of thing, interstellar type of thing over, say, dragons and witches.

00:26:46.480 --> 00:26:49.640
<v Michael Kennedy>But I think you might appreciate this.

00:26:49.760 --> 00:26:50.740
<v Michael Kennedy>So Lord of the Rings, okay?

00:26:51.100 --> 00:26:52.460
<v Michael Kennedy>There's Gandalf and there's Frodo.

00:26:52.900 --> 00:26:56.160
<v Michael Kennedy>And it says, Gandalf, they've discovered something together.

00:26:56.200 --> 00:26:59.140
<v Michael Kennedy>And Gandalf looks over at Frodo and says, what can you see?

00:26:59.840 --> 00:27:06.000
<v Michael Kennedy>it's it's some form of elvish i i can't read it and he's holding a regular expression

00:27:09.240 --> 00:27:13.920
<v Speaker 4>slash carrot for the z question mark equals dot percent backslash d is like

00:27:14.370 --> 00:27:21.100
<v Brian Okken>some form of elvish can't read it yeah nobody can pretty good right yeah that is good i've seen the

00:27:21.200 --> 00:27:28.520
<v Michael Kennedy>same meme but with uh if double underscore name or dunder name equal equal dunder main it's like

00:27:28.420 --> 00:27:29.260
<v Michael Kennedy>It's some form of Lfish.

00:27:29.330 --> 00:27:29.960
<v Michael Kennedy>I can't read it.

00:27:29.970 --> 00:27:30.360
<v Speaker 4>It's great.

00:27:30.600 --> 00:27:31.160
<v Speaker 4>It doesn't make sense.

00:27:31.700 --> 00:27:32.980
<v Speaker 4>How can you not read that?

00:27:33.200 --> 00:27:39.460
<v Brian Okken>But also, it seems odd still that that's the way we can tell if you're running an application

00:27:40.180 --> 00:27:41.420
<v Brian Okken>directly or it's getting imported.

00:27:41.700 --> 00:27:42.040
<v Michael Kennedy>I know.

00:27:42.270 --> 00:27:45.420
<v Michael Kennedy>It works, but it's just a weird convention.

00:27:47.640 --> 00:27:54.240
<v Michael Kennedy>I'm totally here for just the main function, static main void or the variations across so

00:27:54.360 --> 00:27:55.080
<v Michael Kennedy>many different applications.

00:27:56.140 --> 00:28:02.740
<v Michael Kennedy>I mean, that's actually what I end up writing in my code is I always have a def main something or async def whatever main.

00:28:03.120 --> 00:28:06.800
<v Michael Kennedy>And then in the Dunder name equal Dunder main, I just call main.

00:28:07.180 --> 00:28:08.820
<v Michael Kennedy>And that's just like, this is my convention.

00:28:09.060 --> 00:28:10.060
<v Michael Kennedy>The main thing goes at the top.

00:28:10.160 --> 00:28:10.660
<v Michael Kennedy>It's called main.

00:28:11.020 --> 00:28:11.800
<v Michael Kennedy>That's how the app starts.

00:28:12.220 --> 00:28:15.060
<v Michael Kennedy>But I still got to go to that little wire together deal at the end.

00:28:15.180 --> 00:28:15.500
<v Brian Okken>Yeah.

00:28:15.740 --> 00:28:21.440
<v Brian Okken>It seems like we should have like a if like if not imported or something, because that's essentially what we're saying.

00:28:22.280 --> 00:28:22.860
<v Brian Okken>But anyway.

00:28:25.160 --> 00:28:38.640
<v Brian Okken>One of the things I noticed, I really enjoy sci-fi, but I realized that a lot of the sci-fi books that I love still have, like, talk about, like, in the future, we'll have new technology and it's going to suck because of XYZ.

00:28:38.830 --> 00:28:41.280
<v Brian Okken>It's like, there's not a lot of optimistic sci-fi.

00:28:41.880 --> 00:28:43.040
<v Brian Okken>It's a lot of dystopian, yeah.

00:28:43.740 --> 00:28:43.860
<v Michael Kennedy>Yeah.

00:28:44.300 --> 00:28:44.400
<v Brian Okken>Anyway.

00:28:44.700 --> 00:28:48.980
<v Michael Kennedy>Sure, we have cool spaceships, but we've destroyed the world, so we have to use them to go find a new world to destroy.

00:28:49.260 --> 00:28:49.920
<v Brian Okken>Yeah, yeah.

00:28:50.200 --> 00:28:51.840
<v Brian Okken>And we still have politics in space.

00:28:53.220 --> 00:28:53.940
<v Brian Okken>But anyway.

00:28:54.740 --> 00:28:56.020
<v Brian Okken>But no politics on this episode.

00:28:56.300 --> 00:29:00.140
<v Michael Kennedy>No, unless you don't feel like we're bashing elvish writing, but that's okay.

00:29:01.680 --> 00:29:01.840
<v Brian Okken>Yeah.

00:29:02.160 --> 00:29:02.380
<v Michael Kennedy>All right.

00:29:02.800 --> 00:29:03.060
<v Michael Kennedy>All right.

00:29:03.200 --> 00:29:03.660
<v Michael Kennedy>Thanks for being here.

00:29:03.980 --> 00:29:04.700
<v Michael Kennedy>Thanks to everyone for listening.

00:29:04.860 --> 00:29:05.320
<v Michael Kennedy>We appreciate it.

00:29:05.540 --> 00:29:05.840
<v Michael Kennedy>Bye, y'all.

00:29:06.060 --> 00:29:06.200
<v Brian Okken>Bye.

