WEBVTT
00:00:00.001 -->
00:00:05.100Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.
00:00:05.100 -->
00:00:09.000This is episode 387, recorded June 12th.
00:00:09.000 -->
00:00:10.540And I'm Brian Hawken.
00:00:10.540 -->
00:00:11.780And I'm Michael Kennedy.
00:00:11.780 -->
00:00:14.300This episode is sponsored by Scout APM.
00:00:14.300 -->
00:00:16.160Listen to their segment later in the show.
00:00:16.160 -->
00:00:24.020Connect with your hosts, as always, through Fosstodon, at Adam Kennedy, at Brian Hawken, and at Python Bytes.
00:00:24.020 -->
00:00:25.420We'd love to hear from you.
00:00:25.420 -->
00:00:28.360Send in those topics, too.
00:00:28.660 -->
00:00:33.820You can also, there's a contact list on pythonbytes.fm.
00:00:33.820 -->
00:00:35.000You can send things that way, too.
00:00:35.000 -->
00:00:40.760And if you'd like to join the show while we're recording, like some of the people right now,
00:00:40.760 -->
00:00:47.160you can join us on YouTube at pythonbytes.fm/live to be part of the audience.
00:00:47.160 -->
00:00:50.460It's usually Tuesdays at 10 a.m. Pacific time.
00:00:50.460 -->
00:00:55.880And you can also use that to find the link to catch older episodes as well.
00:00:56.160 -->
00:01:04.300And finally, before we get started, if you'd like to have all these topics and the links to everything we talk about sent directly to your inbox,
00:01:04.300 -->
00:01:12.120you can go to pythonbytes.fm and become one of our friends of the show and join that list.
00:01:12.120 -->
00:01:14.420And we'll send those emails to you every week.
00:01:14.420 -->
00:01:15.080Super useful.
00:01:15.080 -->
00:01:16.320A lot of people are signing up to them.
00:01:16.320 -->
00:01:20.580Brian, really quickly, before we jump into the topics, you mentioned Fosstodon.
00:01:20.580 -->
00:01:25.860I got a comment on YouTube, I suppose, is the right place to, where it came from.
00:01:25.860 -->
00:01:31.280Somebody said, this guy, me, has gone completely crazy because he joined Mastodon.
00:01:31.280 -->
00:01:36.020Then he joined invite-only Mastodon because Fosstodon went to invite-only.
00:01:36.460 -->
00:01:41.820I'm like, but you can join any, there's thousands of servers, join any one you want.
00:01:41.820 -->
00:01:45.740So you don't have to be on Fosstodon directly to talk with us.
00:01:45.740 -->
00:01:48.780It's just the same, you know, most people I talk to are not on Fosstodon.
00:01:48.780 -->
00:01:57.500If you want an invite to that private server or invite-only server, which I think that's just trying to limit the scope for the admins and the cost of it and stuff,
00:01:57.500 -->
00:02:01.060happy to send you on, but yeah, just any old Mastodon will do.
00:02:01.060 -->
00:02:03.540It doesn't have to be Fosstodon in particular.
00:02:03.540 -->
00:02:04.940Nope, doesn't have to be.
00:02:04.940 -->
00:02:05.340Yeah.
00:02:05.340 -->
00:02:07.760It's not Slack, it's not Discord, it's something else.
00:02:07.760 -->
00:02:08.900It's the Fediverse.
00:02:08.900 -->
00:02:16.820But if you really want to get into Fosstodon, go into the contact form on our site and send us an email and one of us will send you an invite.
00:02:16.820 -->
00:02:17.800Exactly.
00:02:17.800 -->
00:02:20.920Well, how should we start the show, Michael?
00:02:20.920 -->
00:02:25.000Let's herald in a new era of SQL interactions, shall we?
00:02:25.000 -->
00:02:26.100With the data herald.
00:02:26.100 -->
00:02:30.360So this comes just under the organization data herald.
00:02:30.360 -->
00:02:42.580And the idea is you have a SQL database like Postgres or Microsoft SQL Server or whatever, but you are not, either you don't have SQL skills or you don't want to bother your SQL skills.
00:02:42.580 -->
00:02:45.420This is kind of like for me with regular expressions, right?
00:02:45.420 -->
00:02:51.540Like I can do regular expressions, but I will take a lot of steps to not actually do regular expressions.
00:02:51.540 -->
00:02:53.200You know what I mean?
00:02:53.200 -->
00:02:55.440So this is like that for SQL.
00:02:55.440 -->
00:03:04.700It's a natural language to SQL engine built for enterprise level question and answering on top of relational data.
00:03:04.960 -->
00:03:13.100So maybe you've got a database with a bunch of analytics, a bunch of customers, whatever, contacts for like a CRM type thing.
00:03:13.100 -->
00:03:22.400And you want to let your somewhat technical people just talk to the thing instead of making them learn SQL or use some kind of BI tool.
00:03:22.400 -->
00:03:23.660So you just put this thing on top of you.
00:03:23.660 -->
00:03:29.580You're like, tell me all, you know, how much sales did we get from the Philippines last month?
00:03:29.580 -->
00:03:30.580Something like that.
00:03:30.580 -->
00:03:30.760Right.
00:03:30.760 -->
00:03:34.280Which you could write that as a SQL expression, but you don't have to.
00:03:35.280 -->
00:03:35.700Yeah.
00:03:35.700 -->
00:03:43.480So some of the features are you can allow business users to get insights into data warehouses without bothering the data analyst.
00:03:43.480 -->
00:03:49.140You can enable Q&A chat on top of production databases inside your SaaS application.
00:03:49.140 -->
00:03:53.620That one sounds a little risky, but, you know, maybe internally it's fine.
00:03:53.620 -->
00:03:55.920You got like a self-hosted one or something like that.
00:03:55.920 -->
00:03:59.940Or you could create a chat GPD plugin for your proprietary data even.
00:03:59.940 -->
00:04:02.640Pretty interesting stuff, right?
00:04:02.640 -->
00:04:04.080This is super cool.
00:04:04.080 -->
00:04:04.560Yeah.
00:04:04.560 -->
00:04:05.000Yeah.
00:04:05.000 -->
00:04:05.520Yeah.
00:04:05.520 -->
00:04:06.520I haven't tried it yet.
00:04:06.520 -->
00:04:10.400It's half Python, half JavaScript, 0.3% Docker.
00:04:10.400 -->
00:04:18.480But the 0.3% Docker comes from the fact that if you want to just run it locally, you can just Docker compose up basically.
00:04:18.480 -->
00:04:23.320So they actually have that all put together in a script, but you just Docker run off it goes.
00:04:23.320 -->
00:04:24.040Yeah.
00:04:24.340 -->
00:04:30.000So it's made up of a bunch of different things, an engine, some enterprise rules like permissions and stuff, an admin console.
00:04:30.000 -->
00:04:35.040And interestingly, one final thing to throw out here before we move on is a Slack bot.
00:04:35.040 -->
00:04:42.280So you can add the data herald for your database to your Slack channel and then talk to it as part of your Slack conversation.
00:04:42.280 -->
00:04:44.140What's the deal with this?
00:04:44.140 -->
00:04:44.700It's like, I don't know.
00:04:44.700 -->
00:04:48.520Let's just ask the data herald, you know, and go and send it a message.
00:04:48.520 -->
00:04:50.420And I think that's actually pretty interesting.
00:04:50.420 -->
00:04:53.280I think it's, yeah, it's funny.
00:04:53.460 -->
00:04:55.080It's interesting and kind of funny.
00:04:55.080 -->
00:04:57.820I kind of forgot that a lot of people are still using Slack.
00:04:57.820 -->
00:04:59.300Are you slacking off?
00:04:59.300 -->
00:05:00.500You're not paying attention anymore, right?
00:05:00.500 -->
00:05:01.860I'm slacking off.
00:05:01.860 -->
00:05:02.320Yes.
00:05:02.320 -->
00:05:05.040I still have a Slack.
00:05:05.040 -->
00:05:05.360No.
00:05:05.360 -->
00:05:05.680Yeah.
00:05:06.340 -->
00:05:11.400I have a Slack channel for the course and the book, but it doesn't give a lot of activity.
00:05:11.400 -->
00:05:11.760So.
00:05:11.760 -->
00:05:13.120Yeah.
00:05:13.120 -->
00:05:14.300I'm always torn about these things.
00:05:14.300 -->
00:05:15.920I want to set up something like that.
00:05:15.920 -->
00:05:20.380But Discord seems to have a little more traction for public places like that.
00:05:20.380 -->
00:05:22.680The Slack pricing has gotten really weird.
00:05:23.120 -->
00:05:23.400Yeah.
00:05:23.400 -->
00:05:26.780It's for free on open source stuff and big projects.
00:05:26.780 -->
00:05:31.780It's like, it's got a 90 day limit on it and it throws stuff away, which is a problem.
00:05:31.780 -->
00:05:32.080So.
00:05:32.080 -->
00:05:32.760Yeah, exactly.
00:05:32.760 -->
00:05:36.020I want to set up rocket.chat, which is pretty awesome.
00:05:36.020 -->
00:05:42.520It's like a self hosted or you can buy their hosting, but it's like open source, a lot nicer,
00:05:42.520 -->
00:05:44.580white label, et cetera, et cetera, et cetera.
00:05:45.020 -->
00:05:49.360The only thing is like, if you want to get people to come in and use it and they do,
00:05:49.360 -->
00:05:53.240do they want to have like another app open and remember to go to another place.
00:05:53.240 -->
00:05:55.340I think that's the challenge with Discord and Slack.
00:05:55.340 -->
00:05:56.760It's like, well, I already have that open.
00:05:56.760 -->
00:06:00.460So now I get notifications for that versus here's one more thing to run.
00:06:00.460 -->
00:06:03.300But yeah, this is something I'm thinking about.
00:06:03.300 -->
00:06:04.180It could be fun.
00:06:04.180 -->
00:06:12.120I switched the pytest course recently from Teachable to Podia and Podia has a community
00:06:12.120 -->
00:06:15.060aspect where you can ask questions and answers and stuff like that.
00:06:15.060 -->
00:06:19.540I haven't turned it on yet, but I'm planning on doing that soon just because it solves that
00:06:19.540 -->
00:06:20.820extra login problem.
00:06:20.820 -->
00:06:22.580They already have a login to get to the course.
00:06:22.580 -->
00:06:23.600Right, exactly.
00:06:23.600 -->
00:06:25.280And I can put it right in there.
00:06:25.280 -->
00:06:26.440So anyway.
00:06:26.440 -->
00:06:27.200Cool.
00:06:27.200 -->
00:06:27.920Maybe someday.
00:06:27.920 -->
00:06:28.800All right.
00:06:28.800 -->
00:06:30.220Well, Data Herald, check it out, people.
00:06:30.220 -->
00:06:32.120If you want to talk to your SQL.
00:06:32.120 -->
00:06:33.520Talk to your SQL.
00:06:33.520 -->
00:06:34.220Talk to your database.
00:06:34.220 -->
00:06:35.360All right.
00:06:35.360 -->
00:06:39.880If you'd like to talk to just random stuff in Python.
00:06:40.880 -->
00:06:42.460I don't know how to transition to this.
00:06:42.460 -->
00:06:48.840The topic I want to talk about is an article by Trey Hunter called Python's Mini Command Line
00:06:48.840 -->
00:06:49.320Utilities.
00:06:49.320 -->
00:06:53.240And I knew a lot of this stuff was around, but I always forget about it.
00:06:53.240 -->
00:06:55.180So I love it when people bring this up.
00:06:55.180 -->
00:07:02.080So the thing is, in Python, all the built-in stuff, there's standard library stuff.
00:07:02.080 -->
00:07:07.380And usually you get at it from your Python code by saying import something, like import data
00:07:07.380 -->
00:07:09.200classes or something like that.
00:07:09.620 -->
00:07:17.900But some of this stuff has activities built into the dunder main of it in the subproject.
00:07:17.900 -->
00:07:24.420So that if you write Python-m and then the built-in module, something happens.
00:07:24.420 -->
00:07:25.840And there's a bunch of them.
00:07:25.840 -->
00:07:27.480So this is what this article is about.
00:07:27.480 -->
00:07:39.140And the famous one that is Python-m anti-gravity, which pops open in the KCD comic, which is kind
00:07:39.140 -->
00:07:40.800of awesome that we have that in the language.
00:07:42.240 -->
00:07:43.680I never get tired of that one.
00:07:43.680 -->
00:07:44.240Yeah.
00:07:44.240 -->
00:07:47.620But it does the import this thing.
00:07:47.620 -->
00:07:53.380But so there's a whole bunch of cool tools that I was looking at.
00:07:53.380 -->
00:07:56.820There's general purpose tools that I didn't even know was there.
00:07:56.820 -->
00:07:59.980Calendar is one of them that is actually really handy.
00:07:59.980 -->
00:08:05.320So if you just type Python-m calendar, it prints out the current year's calendar, which
00:08:05.320 -->
00:08:08.900actually, I used to have a desk calendar.
00:08:08.900 -->
00:08:10.180I don't have a desk calendar anymore.
00:08:10.600 -->
00:08:13.940So having something like that pop up really easily, really helpful.
00:08:13.940 -->
00:08:17.060And you can also give it a specific date.
00:08:17.060 -->
00:08:20.960So if you're like, well, what's my anniversary going to fall on in a couple years?
00:08:20.960 -->
00:08:22.940You can look that up.
00:08:22.940 -->
00:08:25.100So really handy to have that around.
00:08:25.100 -->
00:08:30.060There's the HTTP server, which is built in, which is fun.
00:08:30.060 -->
00:08:31.980JSON tool is pretty awesome, actually.
00:08:31.980 -->
00:08:35.340JSON tool lets you nicely format some JSON data.
00:08:35.340 -->
00:08:38.620Some great stuff there, general purpose.
00:08:39.840 -->
00:08:43.020There's categories that Trey has put these into.
00:08:43.020 -->
00:08:47.300And I love the especially handy on a Windows machine category.
00:08:47.300 -->
00:08:54.860These are Unix-y utilities that I often miss when I'm on a random Windows setup.
00:08:55.440 -->
00:08:58.860And I never really remember how to get them safely.
00:08:58.860 -->
00:09:01.940And so having them built into Python, I didn't even know these were here.
00:09:01.940 -->
00:09:04.540Like gzip and tar.
00:09:04.540 -->
00:09:10.200I didn't know that I could use gzip and tar easily on Windows with just Python, built in Python.
00:09:10.200 -->
00:09:11.280How cool is that?
00:09:12.280 -->
00:09:15.460There's a FTP lib has a built-in FTP utility.
00:09:15.460 -->
00:09:18.020You can, it's kind of a quick FTP client.
00:09:18.020 -->
00:09:19.160Nice.
00:09:19.740 -->
00:09:22.120I don't really need Telnet very much.
00:09:22.120 -->
00:09:24.160But some of these are pretty nice.
00:09:24.160 -->
00:09:25.000IMAP lib.
00:09:25.000 -->
00:09:27.740I didn't know that you could curl to read email through Python.
00:09:27.740 -->
00:09:28.300Cool.
00:09:28.300 -->
00:09:31.680Going down, analyzing.
00:09:31.680 -->
00:09:34.580These are analyzing Python code.
00:09:34.580 -->
00:09:35.040Huh.
00:09:35.040 -->
00:09:36.120Tokenize looks fun.
00:09:36.240 -->
00:09:39.000AST, actually, I did know that.
00:09:39.000 -->
00:09:44.520Using AST to get an abstract syntax tree for some code from the command line.
00:09:44.520 -->
00:09:48.440A couple of the ones, what did I want to highlight?
00:09:48.440 -->
00:09:50.940There's working with code.
00:09:50.940 -->
00:09:52.640I don't know.
00:09:52.640 -->
00:09:55.980There's just a whole bunch of fun stuff in here.
00:09:55.980 -->
00:10:00.340You can get Hello World as a command line argument, or the command line tool.
00:10:00.340 -->
00:10:02.180It prints Hello World.
00:10:02.180 -->
00:10:03.620That's funny.
00:10:03.620 -->
00:10:05.380Sure, why not?
00:10:05.900 -->
00:10:07.080Python-M this.
00:10:07.080 -->
00:10:08.580We'll do the Zen of Python.
00:10:08.580 -->
00:10:10.080But an internal demo.
00:10:10.080 -->
00:10:11.140Yeah.
00:10:11.140 -->
00:10:14.500Anyway, fun to check out.
00:10:14.500 -->
00:10:17.180And these are pretty good stuff.
00:10:17.180 -->
00:10:17.920Good stuff here.
00:10:17.920 -->
00:10:21.860Yeah, there's a lot more there than I imagine most people know.
00:10:21.860 -->
00:10:22.520That's pretty awesome.
00:10:22.520 -->
00:10:23.620Pretty awesome.
00:10:23.620 -->
00:10:30.880And there's even a little demo of using cprofile and pstats for getting some profiling of your code.
00:10:30.880 -->
00:10:31.840Very cool.
00:10:31.840 -->
00:10:33.040All right.
00:10:33.040 -->
00:10:34.740What else is cool?
00:10:35.560 -->
00:10:36.660I would say our sponsor.
00:10:36.660 -->
00:10:40.640Let me tell you real quick about Scout APM.
00:10:40.640 -->
00:10:44.420They're big supporters of Python Bytes, so we appreciate that very much.
00:10:45.000 -->
00:10:53.860So if you are tired of spending hours trying to find the root cause of issues impacting your performance, then you owe it to yourself to check out Scout APM.
00:10:54.080 -->
00:10:55.080They're a leading Python application.
00:10:55.080 -->
00:11:01.080They're a leading Python application performance monitoring tool.
00:11:01.080 -->
00:11:02.080It's an important tool.
00:11:02.080 -->
00:11:02.080It's an easy way to find the root cause of the Python application.
00:11:02.080 -->
00:11:02.080It's an easy way to find the root cause of the Python application.
00:11:02.080 -->
00:11:02.080It's an easy way to find the root cause of the Python application.
00:11:02.080 -->
00:11:02.080It's an easy way to find the root cause of the Python application.
00:11:02.080 -->
00:11:02.080It's an easy way to find the root cause of the Python application.
00:11:02.080 -->
00:11:02.080It's an easy way to find the root cause of the Python application.
00:11:02.080 -->
00:11:03.080It's an easy way to find the root cause of the Python application.
00:11:03.080 -->
00:11:04.080It's an easy way to find the root cause of the Python application.
00:11:04.080 -->
00:11:05.080It's an easy way to find the root cause of the Python application.
00:11:05.080 -->
00:11:06.080It's an easy way to find the root cause of the Python application.
00:11:06.080 -->
00:11:07.080It's an easy way to find the root cause of the Python application.
00:11:07.080 -->
00:11:12.740queries, background jobs, and the dreaded N plus one queries that you can end up if you do lazy
00:11:12.740 -->
00:11:18.060loading in your ORM. And then you say, oh no, why is it so slow? Why are you doing 200 database queries
00:11:18.060 -->
00:11:22.560for what should be one? So you can find out things like that. And it links it back directly to source
00:11:22.560 -->
00:11:28.060code so you can spend less time in the debugger and healing logs and just finding the problems and
00:11:28.060 -->
00:11:32.820moving on. And you'll love it because it's built for developers by developers. It makes it easy to
00:11:32.820 -->
00:11:37.640get set up. Seriously, you can do it in less than four minutes. So that's awesome. And the best part
00:11:37.640 -->
00:11:44.080is the pricing is straightforward. You only pay for the data that you use with no hidden overage fees
00:11:44.080 -->
00:11:51.620or per seat pricing. And I just learned this, Brian. They also have, they provide the pro version for free
00:11:51.620 -->
00:11:57.040to all open source projects. So if you're an open source maintainer and you want to have Scout APM for
00:11:57.040 -->
00:12:01.760that project, just shoot them a message or something on their pricing page about that. So you can start
00:12:01.760 -->
00:12:08.100your free trial and get instant insights today. Visit pythonbytes.fm/scout. The link is in
00:12:08.100 -->
00:12:12.720your podcast player show notes as well. And please use that link. Don't just search for them because
00:12:12.720 -->
00:12:16.920otherwise they don't think you came from us. And then they'd stop supporting the show. So please
00:12:16.920 -->
00:12:21.920use our link pythonbytes.fm/scout. Check them out. It really supports the show.
00:12:21.920 -->
00:12:24.240Definitely. Definitely. Thank you, Scout.
00:12:24.240 -->
00:12:27.340Okay. How about we talk about Wolfie?
00:12:27.340 -->
00:12:28.180Oh, neat.
00:12:28.180 -->
00:12:29.620Do you know Wolfie?
00:12:30.000 -->
00:12:31.220No, but I like the name.
00:12:31.220 -->
00:12:39.860The name is good. So Wolfie, this comes to us from Patrick Smith. And this is a project from
00:12:39.860 -->
00:12:48.300Chain Guard, which is a company that makes specialized Docker images. So the idea is,
00:12:48.300 -->
00:12:55.240it's based on this idea of distro-less images. Have you heard of distro-less images? I never had.
00:12:55.340 -->
00:13:02.520I'm like, what is this? So normally a Docker image, it shares the Linux runtime kernel,
00:13:02.520 -->
00:13:08.900but then you layer on whatever else you want to add. So, you know, you get the Ubuntu image,
00:13:08.900 -->
00:13:15.160it comes with apt and bash and all those kinds of things. Systemd, which you're very unlikely to be
00:13:15.160 -->
00:13:21.420using in Docker and so on. So those are helpful to have if you might want to run across them,
00:13:21.480 -->
00:13:29.000but they're also, they have a couple of problems. One is they just make the images larger. So you might have a gigabyte image instead of 50 megabyte image,
00:13:29.000 -->
00:13:34.140if you're going to push it to Docker Hub or something like that, or other people are going to download it. And you'd rather have that smaller, right?
00:13:34.140 -->
00:13:34.660Yeah.
00:13:34.820 -->
00:13:53.280And the other one is those things all open up security vulnerabilities and bugs and other issues, right? If there's a bug in something that you weren't using, but it's there, you know, possibly somebody could use that to level up and hack your system, right? That would be less than good.
00:13:53.280 -->
00:14:08.440So these often, these distro-less images often, or containers often come with, without even a package manager like apt or a shell at all, which makes them very small and very constrained in what people can do with them, right?
00:14:08.440 -->
00:14:20.440So you can't like open up a shell and do something if literally the shell doesn't exist. However, debugging them is a challenge because, you know, one thing you can do with a running container that is misbehaving,
00:14:20.440 -->
00:14:33.120as you can say, Docker exec container name, bash or sh, and then get in there and sort of do exploratory stuff, right? So that is a drawback, but they are way more secure, which is pretty cool.
00:14:33.120 -->
00:14:49.140So this Wolfie thing, they make specialized distro-less containers, now that we know what those are, and they're just super stripped down, but so much so that in general, the distro-less images are so stripped down that you can't run Python, right?
00:14:49.920 -->
00:15:05.680For example, or other things. So these come with, where is it down here somewhere? Anyway, it comes with, it's basically distro-less images that are built specifically with just enough to run Python.
00:15:05.680 -->
00:15:27.360So that you can go in and get it working just right. And then once you're sure it's good, you just push it out to production and, you know, count on your logging, I guess. What do you think? Interesting?
00:15:27.360 -->
00:15:28.360Yeah, I think so.
00:15:28.360 -->
00:15:36.020Yeah, much smaller, much more secure because it can't do anything.
00:15:36.360 -->
00:15:42.760And I found the answer, my thought was, why Wolfie? And it's inspired by the world's smallest octopus.
00:15:42.760 -->
00:15:50.180Yes, of course. The wolf octopus, no, Wolfie. It's very cool. Octopuses are cool as well.
00:15:50.180 -->
00:16:00.420And, you know, more and more projects and even projects within companies are caring about software build materials or S-BOMs.
00:16:00.420 -->
00:16:08.100And so minimizing the things that go in your distribution and helps to make that smaller, your S-BOMs smaller.
00:16:08.100 -->
00:16:17.200So having that be part of Wolfie, including high quality build time S-BOMs is a good addition there. That's cool.
00:16:17.200 -->
00:16:28.840Yeah, it's cool you caught on to that. That's another nice thing is they specifically call out all the software build materials and having so much less, well, it makes it easier to do so, I suppose.
00:16:28.840 -->
00:16:30.340Yeah, yeah, definitely.
00:16:30.340 -->
00:16:30.980Neat.
00:16:30.980 -->
00:16:32.100Yeah, indeed.
00:16:33.100 -->
00:16:48.180I ran across recently some, I really like caching. So things like the idea of a memoization or caching of a function.
00:16:48.180 -->
00:16:58.300So it's where if you run a function once, it does it, does the work. But if you run it again with the same input, it just remembers the answer.
00:16:58.300 -->
00:17:03.140But there's different ways to do that. And I'm going to highlight a few that I thought were interesting.
00:17:03.140 -->
00:17:15.080Funktools cache, of course, and I really like that Funktools cache has the cache shortcut because you can just say at cache for a function.
00:17:15.320 -->
00:17:19.840And for a lot of stuff that doesn't have a lot of different input, it works great.
00:17:19.840 -->
00:17:31.580So I've got some projects where it'll be a lot of work, but I call it several times and I could cache that externally, but just throwing cache over the top makes it work great.
00:17:31.860 -->
00:17:36.060So for a lot of cases, just the built-in Funktools cache works awesome.
00:17:36.060 -->
00:17:45.160If you need more detail, cache is actually just a shortcut into LRU cache with the defaults filled in.
00:17:45.160 -->
00:17:50.880But you can set the max size or set type also with LRU cache.
00:17:50.880 -->
00:17:56.220However, you might need more control. And that's where some of these other things come in.
00:17:56.460 -->
00:18:00.440So there's an extension or a third-party library called CacheTools.
00:18:00.440 -->
00:18:06.380And CacheTools has just more, you've got more control over it.
00:18:06.380 -->
00:18:10.340You've got, you can use an LRU cache or a TTL cache.
00:18:10.340 -->
00:18:15.120TTL caches are interesting because they have time to live built into it.
00:18:15.120 -->
00:18:23.580So the cache can disappear after minutes or seconds or whatever makes sense for your application to remember things for a while, but then let them go.
00:18:23.580 -->
00:18:24.740That's super handy.
00:18:25.180 -->
00:18:26.080Yeah, really handy.
00:18:26.080 -->
00:18:36.680Not just because it alleviates the cache management from it being too much, but one of the big problems in computer science is cache invalidation, right?
00:18:36.680 -->
00:18:44.840Like, if it's doing something, I'd say like calling an API, which is the example right on this page, is you don't want to just hit that.
00:18:44.840 -->
00:18:47.340For example, there's a weather API at a location.
00:18:47.340 -->
00:18:50.620Like, given the location, the weather doesn't change that fast.
00:18:50.900 -->
00:18:52.800So let's only refresh every 10 minutes.
00:18:52.800 -->
00:18:55.580You put that on there and boom, and it's completely managed it, right?
00:18:55.580 -->
00:18:56.100Yeah.
00:18:56.100 -->
00:19:04.080And I like the example of weather because we know weather doesn't, the weather forecast isn't going to change that much in the next, you know, I don't know what the 600 is.
00:19:04.340 -->
00:19:05.640I think it's seconds, 10 minutes.
00:19:05.640 -->
00:19:06.120Okay.
00:19:06.120 -->
00:19:09.480So yeah, it's not going to change in 10, you know, refresh it every 10 minutes.
00:19:09.620 -->
00:19:16.060But for various other APIs, you might know about the API, how often it's updated.
00:19:16.060 -->
00:19:23.180And if it's only updated once an hour, you don't need to hit it every time your code hits it.
00:19:23.180 -->
00:19:24.000You can cache that.
00:19:24.000 -->
00:19:25.620That's pretty neat for TTL.
00:19:25.620 -->
00:19:26.080I love that.
00:19:26.080 -->
00:19:30.700So building on top of this is another tool called CacheBox.
00:19:30.700 -->
00:19:33.780So the other one, first one we talked about was CacheTools.
00:19:33.780 -->
00:19:36.700Now CacheBox is a similar kind of thing.
00:19:36.700 -->
00:19:44.960We've got lots of APIs that we can use for it, like LRU Cache and TTL Cache.
00:19:44.960 -->
00:19:47.840It's a similar API as this other one.
00:19:47.840 -->
00:19:53.080But there's also like an LFU Cache, least frequently used.
00:19:53.080 -->
00:19:54.340Least frequently used, I bet.
00:19:54.340 -->
00:20:01.720And so some other things, but one of the fun things about this is it's written in Rust.
00:20:01.720 -->
00:20:04.340So for a couple of reasons.
00:20:04.340 -->
00:20:06.440It's to speed it up a little bit.
00:20:06.440 -->
00:20:13.660And I mean, but there's also, you could probably do larger objects in there because it's a low memory usage.
00:20:13.660 -->
00:20:17.640It says it's a third of the size of a dictionary.
00:20:17.640 -->
00:20:22.640So you're going to use less memory than you would storing it as Python objects.
00:20:23.440 -->
00:20:31.040So that's pretty cool, especially if you're caching like the output of an API that's a big JSON blob or something.
00:20:31.040 -->
00:20:38.840So really cool projects if you're trying to speed things up or save memory with the caching.
00:20:38.840 -->
00:20:40.180So nice.
00:20:40.180 -->
00:20:41.940Yeah, that's very cool.
00:20:41.940 -->
00:20:43.480I did not know about it.
00:20:43.480 -->
00:20:44.140I'm excited.
00:20:44.140 -->
00:20:45.080Yeah, that's very neat.
00:20:45.380 -->
00:20:49.360Cachebox just showed up a few days ago that I was aware of.
00:20:49.360 -->
00:20:51.000I thought, oh, this is interesting.
00:20:51.000 -->
00:20:53.640And yeah, it looks like it's only a couple weeks old.
00:20:53.640 -->
00:20:54.840Two weeks old for the repo.
00:20:54.840 -->
00:20:55.100Yeah.
00:20:55.100 -->
00:20:55.660Very new.
00:20:55.660 -->
00:20:56.560Excellent.
00:20:56.560 -->
00:20:57.920I will definitely give that a look.
00:20:57.920 -->
00:20:59.220All right.
00:20:59.220 -->
00:21:00.960Any extras?
00:21:01.840 -->
00:21:07.040I have had one extra, but then our conversation made me have two extras.
00:21:07.040 -->
00:21:08.960So I'll just throw it out there.
00:21:08.960 -->
00:21:12.380I'll just throw into the show notes, the rocket.chat.
00:21:12.380 -->
00:21:13.000So people have that.
00:21:13.000 -->
00:21:13.820We already talked about that.
00:21:13.820 -->
00:21:20.840So Brian, I've been for many, many years a fan of bartender, not the drinking, but the Mac app.
00:21:20.840 -->
00:21:21.280Yeah.
00:21:21.280 -->
00:21:24.300You know, in Mac, you have this bar across the top.
00:21:24.300 -->
00:21:28.900It's sort of equivalent to the task notification area on Windows.
00:21:29.680 -->
00:21:33.360For some reason, putting stuff up there on Mac is super popular.
00:21:33.360 -->
00:21:34.560I just counted.
00:21:34.560 -->
00:21:37.940I have 28 icons in that thing, and it's ridiculous.
00:21:37.940 -->
00:21:39.580Yeah.
00:21:39.580 -->
00:21:42.120Being able to control that, it's not a little nice.
00:21:42.120 -->
00:21:42.560Yeah.
00:21:42.560 -->
00:21:48.960It's super nice, especially if you're doing presentations like at a conference or for courses or live streams.
00:21:48.960 -->
00:21:55.040You can just hide more stuff away, and you don't have to have it there, you know, showing weird notifications and stuff.
00:21:55.040 -->
00:21:58.520But it turns out, like, this bartender app is pretty cool.
00:21:58.940 -->
00:22:03.900There's some uncertainty about its current status, though.
00:22:04.400 -->
00:22:10.820So bartender was recently sold to another company, but no one announced that it was sold.
00:22:10.820 -->
00:22:19.600And they were trying to kind of like, there's nothing to see here until app monitoring service said, you know, that this is, this is looking a little suspicious.
00:22:19.600 -->
00:22:24.520It's just like, maybe people are buying this to do more deeper tracking.
00:22:24.520 -->
00:22:25.940Maybe they were doing this to do more.
00:22:25.940 -->
00:22:31.400Not illegally, but just sort of digging deeper into seeing what you're doing.
00:22:31.400 -->
00:22:36.980This is bad because it has full screen recording access, access to hotkeys, all sorts.
00:22:36.980 -->
00:22:39.140So it's got a lot of permissions, this app.
00:22:39.140 -->
00:22:39.500Yeah.
00:22:39.560 -->
00:22:43.100So on Mac rumors, let's see.
00:22:43.100 -->
00:22:44.020What's the CEO?
00:22:44.520 -->
00:22:50.980So the original article was PSA bartender Mac app under new ownership, but lack of transparency raises concerns.
00:22:50.980 -->
00:22:56.860Like the guy who sold it didn't even, wasn't willing to acknowledge it until months later.
00:22:56.860 -->
00:22:59.560And the company that bought it still doesn't, won't talk about it.
00:22:59.560 -->
00:23:01.520So it's like, a little sus.
00:23:01.520 -->
00:23:02.220Anyway.
00:23:02.340 -->
00:23:04.560So I want to link to a thing on Mac rumors.
00:23:04.560 -->
00:23:06.000Sorry, windows people.
00:23:06.000 -->
00:23:12.860I know this is not that interesting, but for you, but six bartender alternatives to manage your Mac's menu bar.
00:23:12.860 -->
00:23:15.280And a lot of them are open source.
00:23:15.280 -->
00:23:24.020So for example, I'm using ice, which is available on GitHub with like 8,000 stars, you know, pretty nice.
00:23:24.020 -->
00:23:24.860And guess what?
00:23:24.860 -->
00:23:27.720It works almost exactly the same.
00:23:27.720 -->
00:23:28.560It's free.
00:23:28.560 -->
00:23:29.420It's open source.
00:23:29.420 -->
00:23:31.560You know, why didn't I just use this earlier?
00:23:31.880 -->
00:23:36.320There's a few features coming that it doesn't quite have, but for the most part, I think it's really good already.
00:23:36.320 -->
00:23:37.120That's pretty cool.
00:23:37.120 -->
00:23:38.100I should check that out.
00:23:38.100 -->
00:23:38.480Yeah.
00:23:38.480 -->
00:23:43.480So I've, I've banished bartender just out of a abundance of caution sort of thing.
00:23:43.480 -->
00:23:43.900All right.
00:23:43.900 -->
00:23:44.820That's it for my extras.
00:23:44.820 -->
00:23:45.520How about you?
00:23:45.520 -->
00:23:47.060just a couple.
00:23:47.060 -->
00:23:47.680Let's see.
00:23:47.680 -->
00:23:53.860I just wanted to let people know, the Python 3.12.4 is out.
00:23:53.860 -->
00:23:55.400So, decent.
00:23:55.400 -->
00:23:59.460I haven't checked to see what is new in dot four, probably book fixes.
00:23:59.460 -->
00:24:00.560So don't know.
00:24:01.200 -->
00:24:02.860but, it's there.
00:24:02.860 -->
00:24:08.340and then, another, another recent release is, I don't usually keep up on these
00:24:08.340 -->
00:24:14.200two tightly, but VS Code, the June is Python for Visual Studio Code.
00:24:14.200 -->
00:24:19.160and then, the June release, includes, a pytest improvement.
00:24:19.160 -->
00:24:23.140So, there is, there's an ongoing, it's been going on for a while.
00:24:23.140 -->
00:24:28.220They're, they're rewriting some of the Python testing, functionality.
00:24:28.720 -->
00:24:33.580And there's a link in this, in the release note to, to how to, how to change that so that
00:24:33.580 -->
00:24:34.140you can see it.
00:24:34.140 -->
00:24:39.460But if you're using the updated, testing rewrite, there's some changes that should,
00:24:39.460 -->
00:24:43.520should help, just help, help things work a little better.
00:24:43.520 -->
00:24:45.440So, very cool.
00:24:45.800 -->
00:24:47.120nice, nice additions.
00:24:47.120 -->
00:24:48.300That's all my extras.
00:24:48.300 -->
00:24:49.320Yeah.
00:24:49.320 -->
00:24:54.960I, want to say that when I saw you put into the show notes about an hour ago, or when I
00:24:54.960 -->
00:24:58.900saw that they were in the show notes, oh, that three, three 12.4 is out.
00:24:58.980 -->
00:25:02.120I just quick updated a number in the Docker setup.
00:25:02.120 -->
00:25:02.760Boom.
00:25:02.760 -->
00:25:08.600All the apps are upgraded to three, four, 13.4, which is, three, 13.4, which are 12.4,
00:25:08.600 -->
00:25:10.220which is pretty awesome.
00:25:10.220 -->
00:25:11.540No way that all works, right?
00:25:11.540 -->
00:25:12.460All right.
00:25:12.460 -->
00:25:13.780how about a joke?
00:25:13.780 -->
00:25:14.900That sounds great.
00:25:14.900 -->
00:25:20.300So before I show this, you know, in CSS, we've got different, different settings.
00:25:20.300 -->
00:25:24.120You've got visibility, importance, opacity.
00:25:24.620 -->
00:25:29.720What if you made a series of superheroes or villains or cartoons out of CSS?
00:25:29.720 -->
00:25:31.200Well, that's the joke.
00:25:31.200 -->
00:25:33.380So I'll link to this and we won't go through all of them.
00:25:33.380 -->
00:25:39.500You guys can check it out, but it's called CSS cartoons by Alvaro Montoro.
00:25:39.500 -->
00:25:43.160And we've got the cloud developer and the cloud developer.
00:25:43.160 -->
00:25:46.220this is a CSS class dot cloud developer.
00:25:46.220 -->
00:25:47.820Background is Azure.
00:25:47.820 -->
00:25:50.660The color isolation is isolate.
00:25:50.660 -->
00:25:51.780Rest is none.
00:25:51.780 -->
00:25:54.420Stress is a 100 and content is none.
00:25:54.420 -->
00:25:57.940They have like cool little pictures of, of like graphics of each.
00:25:57.940 -->
00:25:58.880So check them out.
00:25:58.880 -->
00:25:59.800We have a King.
00:25:59.800 -->
00:26:01.640The position is absolute.
00:26:01.640 -->
00:26:02.980The richness is 100.
00:26:02.980 -->
00:26:04.940The color is Royal blue.
00:26:04.940 -->
00:26:07.380And it says, you got to know your CSS.
00:26:07.380 -->
00:26:10.480It says ampersand greater than colon first child.
00:26:10.480 -->
00:26:14.940So stuff can, you know, the first child of all the things contained directly within it.
00:26:14.940 -->
00:26:17.160All, all colon inherit.
00:26:17.160 -->
00:26:17.880Isn't that awesome?
00:26:17.880 -->
00:26:21.440let's see.
00:26:21.440 -->
00:26:21.920That's great.
00:26:22.260 -->
00:26:23.900We've got phantom of the opera, Brian.
00:26:23.900 -->
00:26:25.820This is a, there can only be one of these.
00:26:25.820 -->
00:26:26.900So it's not a class.
00:26:26.900 -->
00:26:28.140It's a, ID.
00:26:28.140 -->
00:26:32.820So hash phantom of the opera mask URL hash face.
00:26:32.820 -->
00:26:38.560Backface visibility, hidden visibility, hidden pitch is low.
00:26:38.560 -->
00:26:39.700Volume is soft.
00:26:39.700 -->
00:26:41.820Phantom of the opera.
00:26:42.320 -->
00:26:42.900All right.
00:26:42.900 -->
00:26:43.820We have a winner.
00:26:43.820 -->
00:26:46.980Order is one running first color gold.
00:26:46.980 -->
00:26:53.880And then after, you know, colon colon after content is, the, like the first place trophy.
00:26:53.880 -->
00:26:55.620We have a dictator.
00:26:55.620 -->
00:26:57.500See the dictator down here in the bottom, Brian.
00:26:57.500 -->
00:26:58.120See how he looks.
00:26:58.120 -->
00:26:58.880He's so forbidding.
00:26:58.880 -->
00:27:02.440a dictator is a class because there can be more than one.
00:27:02.440 -->
00:27:04.720Of course, position fixed exclamation mark.
00:27:04.720 -->
00:27:05.200Important.
00:27:05.200 -->
00:27:06.140Cannot be overridden.
00:27:06.140 -->
00:27:07.380Will change.
00:27:07.380 -->
00:27:08.020Order.
00:27:08.460 -->
00:27:08.900Important.
00:27:08.900 -->
00:27:09.960Opacity.
00:27:09.960 -->
00:27:10.380Zero.
00:27:10.380 -->
00:27:10.940Important.
00:27:10.940 -->
00:27:13.700Everything's important because of the dictator.
00:27:13.700 -->
00:27:15.060You can't overwrite it or change it.
00:27:15.060 -->
00:27:15.820Border.
00:27:15.820 -->
00:27:17.120Double solid.
00:27:17.120 -->
00:27:19.140And then dot country has.
00:27:19.140 -->
00:27:20.800Not dot supporter.
00:27:20.800 -->
00:27:22.120Will change.
00:27:22.120 -->
00:27:22.680Orphans.
00:27:22.680 -->
00:27:23.160Widows.
00:27:23.160 -->
00:27:23.700Important.
00:27:23.700 -->
00:27:25.320And translate.
00:27:25.320 -->
00:27:27.540100 V max to zero.
00:27:27.540 -->
00:27:29.480Anyway, it just goes on and on.
00:27:29.480 -->
00:27:30.660Like the scroll bar goes forever.
00:27:30.660 -->
00:27:31.720We've got a basketball player.
00:27:31.720 -->
00:27:33.680I encourage people to check this out.
00:27:33.680 -->
00:27:34.980It's pretty awesome.
00:27:34.980 -->
00:27:35.380That's pretty good.
00:27:35.380 -->
00:27:35.860Yeah.
00:27:35.860 -->
00:27:36.160Yeah.
00:27:36.500 -->
00:27:38.620CSS jokes or cartoons.
00:27:38.620 -->
00:27:39.380Very good.
00:27:39.380 -->
00:27:41.060All right.
00:27:41.060 -->
00:27:43.780Another awesome episode.
00:27:43.780 -->
00:27:47.780Thank you, Michael, for meeting me today to talk about Python.
00:27:47.780 -->
00:27:50.200As always, thank you everyone for listening.
00:27:50.200 -->
00:27:50.840See you later.