WEBVTT

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

00:00:04.980 --> 00:00:10.040
This is episode 225, recorded March, March 17th.

00:00:10.040 --> 00:00:11.000
I'm Brian Okken.

00:00:11.000 --> 00:00:11.900
I'm Michael Kennedy.

00:00:11.900 --> 00:00:13.380
And I'm Sebastian Bitovsky.

00:00:13.380 --> 00:00:14.660
Yay, we have a special guest.

00:00:14.660 --> 00:00:15.200
Yay.

00:00:15.200 --> 00:00:16.260
Welcome, Sebastian.

00:00:16.260 --> 00:00:18.560
Thanks. I'm excited to be here. Huge fan of the show.

00:00:18.560 --> 00:00:19.960
Thank you. Thanks so much.

00:00:19.960 --> 00:00:20.900
Should we kick it off?

00:00:20.900 --> 00:00:24.180
Yeah, yeah. I also want to say thanks to Linode for sponsoring this episode.

00:00:24.180 --> 00:00:29.240
And Brian, I've heard of people getting like smaller computers, Raspberry Pis and things like that.

00:00:29.300 --> 00:00:31.760
But you've got you're taking it to some crazy extreme here.

00:00:31.760 --> 00:00:32.400
Is that what's happening?

00:00:32.400 --> 00:00:33.040
Yeah.

00:00:33.040 --> 00:00:34.320
What's going on here? What is this thing?

00:00:34.320 --> 00:00:35.100
The Pico.

00:00:35.100 --> 00:00:38.780
So actually, I saw this announcement on Twitter.

00:00:38.780 --> 00:00:43.020
It's actually came out in January, but we haven't covered it yet.

00:00:43.020 --> 00:00:44.020
It's kind of exciting.

00:00:44.020 --> 00:00:51.320
The Pico is four bucks for and I know they have they have a five dollar little chip also or a little controller.

00:00:51.320 --> 00:00:56.340
But this is really like in microcontroller land, which is it's it's really pretty cool.

00:00:56.340 --> 00:00:58.500
It doesn't have a lot.

00:00:58.600 --> 00:01:00.500
Like there's no Wi-Fi on it.

00:01:00.500 --> 00:01:04.500
There's not a lot on it, but there's also not a lot on it.

00:01:04.500 --> 00:01:06.520
So it's very low powered.

00:01:06.520 --> 00:01:08.400
So really microcontroller size.

00:01:08.400 --> 00:01:16.680
One of the exciting things about this is this is I think this is the first the first Raspberry Pi with a chip designed by Raspberry Pi.

00:01:17.060 --> 00:01:19.960
So this is a custom Raspberry Pi chip.

00:01:19.960 --> 00:01:21.080
And what do they call it?

00:01:21.080 --> 00:01:22.960
A oh, I can't remember.

00:01:22.960 --> 00:01:27.480
R P 2040 is the chip that goes in means anything to anybody.

00:01:28.240 --> 00:01:32.220
But the low power thing is what I think is fascinating.

00:01:32.220 --> 00:01:41.240
And I is because there's some there's some things that you can even you can power like LED lights and stuff with it even.

00:01:41.440 --> 00:01:45.140
And there's there is enough power to do quite a bit with peripherals.

00:01:45.340 --> 00:01:48.980
But you also can sense it's so low power.

00:01:48.980 --> 00:01:55.360
This will be good for things like, you know, temperature sensors and other sensors that you leave alone someplace.

00:01:56.120 --> 00:02:00.960
And a microcontroller that you can like leave somewhere and then come pick up later.

00:02:00.960 --> 00:02:05.920
This is this is some that you can control with Python is something new.

00:02:05.920 --> 00:02:07.340
And that's pretty exciting.

00:02:07.340 --> 00:02:08.360
Yeah, that's super cool.

00:02:08.360 --> 00:02:10.520
And apparently it's coming coming soon.

00:02:10.520 --> 00:02:16.560
Also, is the Arduino Nano Connect, which comes with a nine axis.

00:02:16.560 --> 00:02:24.620
I'm you and a microphone and microphone, a powerful Wi-Fi and Bluetooth module and crypto chip and stuff like that.

00:02:24.700 --> 00:02:26.160
So that'd be kind of cool as well.

00:02:26.160 --> 00:02:26.420
Right.

00:02:26.420 --> 00:02:28.020
Like put this thing on Wi-Fi and whatnot.

00:02:28.020 --> 00:02:28.500
Yeah.

00:02:28.500 --> 00:02:35.500
And one of the other things I forgot to mention, this is this is the first Raspberry Pi product that has an ADC on it.

00:02:35.500 --> 00:02:40.780
So with that, you can do it isn't just like you.

00:02:40.780 --> 00:02:47.120
You can do analog input so you can, you know, more accurately hook up a temperature sensor or something.

00:02:47.120 --> 00:02:47.620
Oh, right.

00:02:47.620 --> 00:02:53.780
So if you're working with like this is your IoT thing and you want to just work with like plug in a voltage meter or whatever.

00:02:53.780 --> 00:02:54.060
Right.

00:02:54.180 --> 00:02:54.420
Yeah.

00:02:54.420 --> 00:02:54.740
OK.

00:02:54.740 --> 00:02:55.180
Yeah.

00:02:55.180 --> 00:02:56.620
So that's pretty exciting.

00:02:56.620 --> 00:03:07.260
And anything that drives people working with a combination of hardware and hardware and software together in a nice language like Python, very much appreciated.

00:03:07.260 --> 00:03:10.140
This is an exciting part of the Python world.

00:03:10.140 --> 00:03:17.320
I also want to mention the editor, Mew, that can be found at Code with Mew.

00:03:17.320 --> 00:03:25.120
And I don't have this up here, but they they released they're working on the 1.1 version and the beta two is out.

00:03:25.260 --> 00:03:32.880
And one of the things that supports is this Pika board along with some of the Lego spike products and a whole bunch of new fixes.

00:03:32.880 --> 00:03:33.880
So, oh, wow.

00:03:33.880 --> 00:03:37.600
Especially when we're working with microcontrollers and students.

00:03:37.600 --> 00:03:39.300
So that's a nice thing to have.

00:03:39.300 --> 00:03:40.400
Did you mention the price?

00:03:40.400 --> 00:03:42.160
That is $4?

00:03:42.160 --> 00:03:43.120
Yes.

00:03:43.120 --> 00:03:43.600
Yeah.

00:03:43.600 --> 00:03:43.680
Yeah.

00:03:43.680 --> 00:03:44.280
That's amazing.

00:03:44.280 --> 00:03:45.700
That is so awesome.

00:03:45.700 --> 00:03:45.920
Right.

00:03:46.160 --> 00:03:53.980
So, yeah, later on in the announcement, they've got like this picture of them like wrapped up like a whole reel of these.

00:03:53.980 --> 00:03:57.660
I think they're trying to encourage people to buy like a whole bunch of them at a time.

00:03:57.660 --> 00:04:00.700
It's like a candy wrapper, but you get a computer instead.

00:04:00.700 --> 00:04:01.420
Yeah.

00:04:01.420 --> 00:04:03.020
That's pretty great.

00:04:03.020 --> 00:04:04.060
Really good.

00:04:04.060 --> 00:04:04.440
I love it.

00:04:04.440 --> 00:04:05.480
That's as good as our jokes.

00:04:05.480 --> 00:04:06.960
Sebastian, what do you think of this thing?

00:04:06.960 --> 00:04:13.000
I never actually got into Raspberry Pi and all this hardware, programming hardware.

00:04:13.000 --> 00:04:20.960
I actually bought Raspberry Pi like years ago and it was in my drawer until one day I decided to put a pie hole on it to get rid of the ads.

00:04:20.960 --> 00:04:23.460
And it's been working flawlessly since then.

00:04:23.460 --> 00:04:28.440
So I have Raspberry Pi somewhere there, but I'm impressed to see how they are dropping the price.

00:04:28.440 --> 00:04:29.180
Like $4.

00:04:29.180 --> 00:04:31.000
It's like extremely affordable.

00:04:31.000 --> 00:04:31.600
Yeah.

00:04:31.600 --> 00:04:32.020
Yeah.

00:04:32.020 --> 00:04:33.220
That's really, really wild.

00:04:33.220 --> 00:04:33.680
That thing.

00:04:33.680 --> 00:04:34.260
Pretty awesome.

00:04:34.260 --> 00:04:35.360
Also, Brian, a comment.

00:04:35.360 --> 00:04:42.440
Paul Sanders in the live stream says, can you use Ubuntu on Pico like a regular Raspberry Pi or is it like its own thing?

00:04:42.740 --> 00:04:44.360
I'm pretty sure it's its own thing.

00:04:44.360 --> 00:04:46.600
I don't think it has a full operating system on it.

00:04:46.600 --> 00:04:47.020
Yeah.

00:04:47.020 --> 00:04:49.220
It describes itself as a microcontroller, right?

00:04:49.220 --> 00:04:49.640
Yeah.

00:04:49.640 --> 00:04:55.040
So it's more like MicroPython, Adafruit, AdacircuitPython, so on.

00:04:55.040 --> 00:04:55.220
Yeah.

00:04:55.220 --> 00:04:56.880
It would be cool, but I don't know.

00:04:56.880 --> 00:04:57.760
It's pretty small.

00:04:57.760 --> 00:04:58.060
$4.

00:04:58.060 --> 00:04:58.800
Yeah.

00:04:58.800 --> 00:05:01.020
I think it is running MicroPython, but I'm not sure.

00:05:01.020 --> 00:05:01.580
Yeah.

00:05:01.580 --> 00:05:02.020
Yeah.

00:05:02.020 --> 00:05:02.160
Yeah.

00:05:02.160 --> 00:05:02.480
Very cool.

00:05:02.480 --> 00:05:02.960
All right.

00:05:02.960 --> 00:05:06.900
Well, I want to talk about something brand new for the next item here, and that is Beanie.

00:05:07.540 --> 00:05:10.960
So I came across this yesterday, and actually, I had some other thing I was going to cover.

00:05:10.960 --> 00:05:11.600
I'm like, no, no, no.

00:05:11.600 --> 00:05:12.160
Beanie is cool.

00:05:12.160 --> 00:05:13.080
I want to talk about Beanie.

00:05:13.080 --> 00:05:13.520
Yeah.

00:05:13.520 --> 00:05:17.480
I'm pretty excited about it because I was recently talking with a friend of mine about,

00:05:17.480 --> 00:05:21.100
oh, what would you use with FastAPI and MongoDB?

00:05:21.100 --> 00:05:28.080
Well, the traditional ORMs, ODMs, they don't call them ORMs in Mongo because they don't map

00:05:28.080 --> 00:05:28.720
relations.

00:05:28.720 --> 00:05:32.420
They map documents, so they call them ODMs, object document mappers, but same idea.

00:05:32.420 --> 00:05:36.360
I was talking with him and saying, you know, it's like, well, what would you use with FastAPI?

00:05:36.360 --> 00:05:40.680
Because you really want to leverage the async and await nature of the views, which is so easy

00:05:40.680 --> 00:05:41.900
to do there and whatnot.

00:05:42.180 --> 00:05:47.620
But I started looking, all the old standbys that I like, MongoEngine and some of the others,

00:05:47.620 --> 00:05:54.240
the ORM, ODM side don't seem to be really supporting the async and await world.

00:05:54.240 --> 00:05:59.640
You start looking around, well, there's Motor, which is the official async library from MongoDB,

00:05:59.640 --> 00:06:02.300
the company, the organization, to support this.

00:06:02.300 --> 00:06:07.640
But the way you program there is I run a query as, you know, sort of almost like SQL syntax,

00:06:07.740 --> 00:06:12.180
and I get back a Python dictionary, which is okay, but I don't know, I don't really like that style.

00:06:12.180 --> 00:06:16.640
Really like getting a class back, be able to do queries with the class, have the class have like

00:06:16.640 --> 00:06:18.460
types and constraints and whatnot.

00:06:18.460 --> 00:06:21.880
Because if you're just working with dictionaries, it's so easy to like forget to set it.

00:06:21.880 --> 00:06:26.240
I know a field you didn't remember existed or something weird like that and get inconsistent data.

00:06:26.240 --> 00:06:32.440
So I ran across this thing called Beanie, which is an async friendly ODM for MongoDB.

00:06:32.440 --> 00:06:35.000
And we've talked a lot about Pydantic.

00:06:35.000 --> 00:06:36.380
Pydantic's awesome, right?

00:06:36.380 --> 00:06:36.780
Yeah.

00:06:36.780 --> 00:06:37.160
Yeah.

00:06:37.160 --> 00:06:44.500
So with Beanie, it basically takes and uses Pydantic models as the classes that map to the database.

00:06:44.500 --> 00:06:45.980
And I think that's just super cool.

00:06:45.980 --> 00:06:46.880
Yeah, very cool.

00:06:46.880 --> 00:06:47.280
Yeah.

00:06:47.280 --> 00:06:49.460
So let me see if I can pull up some examples here.

00:06:50.240 --> 00:06:54.600
So the idea is that with, you know, the document databases, you can embed stuff.

00:06:54.600 --> 00:07:01.560
So I might have one class that's containing a list of other classes I define, and that just is a record in the database.

00:07:01.560 --> 00:07:06.080
So the way it works with Beanie is you create anything that drives from base model.

00:07:06.080 --> 00:07:11.280
That means it's a Pydantic model with all the validation and loading and stuff that you get from that world.

00:07:11.280 --> 00:07:15.440
And then you have a top level document that drives from this Beanie.document,

00:07:15.440 --> 00:07:18.440
which is really just a specialization of a Pydantic model.

00:07:18.440 --> 00:07:20.500
So everything you do with Pydantic happens here.

00:07:20.500 --> 00:07:28.720
And then you actually just work with the motor async driver, which is the official, in quotes, way to talk to MongoDB asynchronously from Python.

00:07:28.720 --> 00:07:32.640
And then you can create a class, embed your objects, hit save.

00:07:32.640 --> 00:07:39.020
You can go and just go to your document, just say insert one as a class, insert many.

00:07:39.020 --> 00:07:40.400
You can do filters.

00:07:40.400 --> 00:07:45.540
You can do like get by ID, or you can say do a find query or something like that.

00:07:45.540 --> 00:07:50.480
So yeah, I think it's pretty neat that it allows you to take this sort of blended.

00:07:50.480 --> 00:07:56.360
It's like half ORM, ODM, and half sort of just working directly with the MongoDB API.

00:07:56.360 --> 00:07:57.940
And yeah, it's pretty neat.

00:07:57.940 --> 00:08:06.880
One of the big notable things that I feel like it's kind of missing is it doesn't support creating and managing indexes through this object model.

00:08:07.120 --> 00:08:11.200
But I was talking to the guy who created it, Roman Wright, on GitHub.

00:08:11.200 --> 00:08:12.220
And he's like, yeah, that's a good idea.

00:08:12.220 --> 00:08:13.940
It's like one of the next things I'm thinking about.

00:08:13.940 --> 00:08:14.980
So pretty cool.

00:08:14.980 --> 00:08:21.560
If you're doing stuff with MongoDB and you're looking and you like Pydantic, here's an exciting new project that people can check out.

00:08:21.620 --> 00:08:31.160
It even has capabilities for the aggregation model, which is like map reduce plus sort of that kind of processing, which often doesn't show up in these ODMs.

00:08:31.160 --> 00:08:32.400
So people can check it out.

00:08:32.400 --> 00:08:33.640
It's growing.

00:08:33.640 --> 00:08:35.380
It was almost brand new yesterday.

00:08:35.380 --> 00:08:36.780
Now it's up to 25 stars.

00:08:36.780 --> 00:08:41.520
So it's not super, super popular, but it's like 25 times more popular than it was yesterday.

00:08:41.520 --> 00:08:42.880
So that's pretty cool.

00:08:42.880 --> 00:08:44.080
It's on a good track.

00:08:44.520 --> 00:08:45.640
I got a question about indexes.

00:08:45.640 --> 00:08:50.820
So if you, even if it didn't support it, could you go around and just request them anyway?

00:08:50.820 --> 00:08:51.500
Yeah, no problem.

00:08:51.500 --> 00:08:53.740
You could go to like motor and do it in Python.

00:08:53.740 --> 00:09:01.000
Say create index at this, you know, like it's not create, it's ensure index, like create if does not exist index during app startup.

00:09:01.000 --> 00:09:06.060
Or you just literally could go to the database and actually use some management tool and create the indexes there.

00:09:06.060 --> 00:09:08.060
So it's not like you can't use indexes.

00:09:08.060 --> 00:09:14.120
It's just like if you're defining the whole model, it would be cool if it could just happen as part of the class definition.

00:09:14.120 --> 00:09:17.360
As many things do like SQLAlchemy does that.

00:09:17.360 --> 00:09:18.740
Mongo Engine does that, right?

00:09:18.740 --> 00:09:20.760
It's a pretty standard paradigm here.

00:09:20.760 --> 00:09:21.660
So I don't know.

00:09:21.660 --> 00:09:22.120
What do you guys think?

00:09:22.120 --> 00:09:33.340
I kind of really like the idea of having an ODM be like this hybrid model of like it's not really taking over hiding Mongo because Mongo is actually not that hard to deal with anyway.

00:09:33.340 --> 00:09:39.320
It's adding some of these class wrappers and giving you a lot of the power of Mongo at the same time.

00:09:39.320 --> 00:09:40.140
Yeah, for sure.

00:09:40.140 --> 00:09:46.940
And you can see like actually the document or the blog post that announces this rather than the GitHub repo has a few examples and they're all FastAPI.

00:09:46.940 --> 00:09:53.940
Like you have an asynchronous API endpoint and then you await note.create, which saves it.

00:09:53.940 --> 00:09:56.940
Or you can await like a query.

00:09:56.940 --> 00:09:57.720
Let me see if, yeah.

00:09:57.720 --> 00:10:01.880
Anyway, you can await queries and things like that, which is the really cool thing.

00:10:01.880 --> 00:10:04.460
So pedantic plus async and await, pretty neat.

00:10:04.460 --> 00:10:05.540
Yeah, that's pretty cool.

00:10:05.540 --> 00:10:07.640
Especially the list of features that you show.

00:10:07.640 --> 00:10:10.120
It's pretty impressive for such a new project.

00:10:10.120 --> 00:10:10.840
Yeah, yeah.

00:10:10.840 --> 00:10:17.180
This guy Roman apparently, he comments in here like this is something I've been using for myself for a while and it's really awesome.

00:10:17.180 --> 00:10:19.040
So now I'm just sort of putting it out there.

00:10:19.040 --> 00:10:20.200
Hopefully it grows from that.

00:10:20.200 --> 00:10:21.240
So that's pretty cool.

00:10:21.240 --> 00:10:24.260
So you work with async more than I have.

00:10:24.980 --> 00:10:33.440
Is this something that I could, if you want like to start playing with it, would you have to jump into the async world or could you use Beanie without async stuff?

00:10:33.440 --> 00:10:35.240
You know, I hadn't really thought about it.

00:10:35.240 --> 00:10:38.860
Looking at it, it looks like it looks like it has to be async.

00:10:38.860 --> 00:10:39.240
Okay.

00:10:39.240 --> 00:10:39.700
Right.

00:10:39.700 --> 00:10:44.260
Because the queries like the find one, create and so on, they all are awaitable.

00:10:44.260 --> 00:10:45.560
They're all being awaited.

00:10:45.560 --> 00:10:46.000
Okay.

00:10:46.240 --> 00:10:50.980
And I don't see a way just quickly glancing at it to say, don't be that.

00:10:50.980 --> 00:10:51.480
You know what I mean?

00:10:51.480 --> 00:10:53.380
Like I don't see how it's both at the same time.

00:10:53.380 --> 00:10:56.100
And if it is, you probably have to use it.

00:10:56.100 --> 00:11:02.000
So I'm guessing actually you do have to use it as an async, but I don't know for sure.

00:11:02.000 --> 00:11:03.960
I haven't tried it well enough.

00:11:03.960 --> 00:11:04.640
It's a good question.

00:11:04.640 --> 00:11:05.200
All right.

00:11:05.200 --> 00:11:11.200
Well, speaking of good stuff, something I've talked about on Python, but not on Python bytes.

00:11:11.200 --> 00:11:15.040
So Sebastian is going to tell you guys about something over there, right?

00:11:15.040 --> 00:11:16.000
That we talked about over there.

00:11:16.200 --> 00:11:16.380
Yeah.

00:11:16.380 --> 00:11:19.820
So I wanted to talk about a tool that I have been using for a long time.

00:11:19.820 --> 00:11:24.020
And I know that you, Michael, are familiar with it because you already covered.

00:11:24.020 --> 00:11:27.480
I'm a huge fan of like code quality, refactoring, all that kind of stuff.

00:11:27.480 --> 00:11:29.640
Like having your editor tell you like, this could be better.

00:11:29.640 --> 00:11:30.940
Press this button to make it happen.

00:11:30.940 --> 00:11:31.860
Yeah, exactly.

00:11:31.860 --> 00:11:38.700
That's why I absolutely love this tool because it's like one level above of, let's say, linters.

00:11:38.700 --> 00:11:43.840
Because when you're using PyLind or FlakeAid, you get like some warning saying like, look, this is wrong.

00:11:44.140 --> 00:11:47.440
And then there is Sorcery that tries to kind of make your code better.

00:11:47.440 --> 00:11:50.820
It gives you like refactoring tooltips just as you type.

00:11:50.820 --> 00:11:54.980
So for example, if you scroll a bit down there, there is some GIF showing what it can do.

00:11:55.420 --> 00:12:05.300
And for example, if you have like an if statement and both branches have the same statement, you will get a pop-up saying that, look, this can be moved outside.

00:12:05.300 --> 00:12:11.860
Or for example, when you have like a for loop, you will get a recommendation saying, hey, this can be turned into a list comprehension.

00:12:12.260 --> 00:12:14.200
So I really like it.

00:12:14.200 --> 00:12:17.600
And it integrates, I think, with PyCharm and VS Code.

00:12:17.600 --> 00:12:19.820
So I don't know about Veeam.

00:12:19.820 --> 00:12:22.780
I don't think there is any support right now for stuff like that.

00:12:22.780 --> 00:12:28.500
And it's super easy to use because you just got a pop-up and you can click, yes, I want to have this refactoring.

00:12:28.500 --> 00:12:33.720
You actually can, yeah, you can see the diff of how it will look after the refactoring.

00:12:34.140 --> 00:12:39.320
And yeah, it's also, it's free to use, at least in the code editor.

00:12:39.320 --> 00:12:50.140
I think they have like, they have the pricing tab, but I think you can pay to have like analytics for your project and set it up with like continuous integration servers and stuff like that.

00:12:50.140 --> 00:12:53.160
But for like VS Code and PyCharm, it's free to use.

00:12:53.160 --> 00:12:53.640
Yeah.

00:12:53.640 --> 00:12:59.800
It looks like you get a couple of extra refactorings and whole project analysis for money.

00:12:59.800 --> 00:13:00.240
Yeah.

00:13:00.240 --> 00:13:03.940
But like the basic refactorings that can already help you a lot.

00:13:04.020 --> 00:13:04.720
They are there for free.

00:13:04.720 --> 00:13:10.720
And at least for me, I just keep getting constant pop-ups saying like this code can be refactored.

00:13:10.720 --> 00:13:15.700
So I mean, maybe I'm a terrible programmer, but sometimes I'm like tired and I don't see something.

00:13:15.700 --> 00:13:20.700
So it's nice to just click one thing and have like three lines of code turn into one line.

00:13:20.700 --> 00:13:21.960
So that's pretty awesome.

00:13:21.960 --> 00:13:22.480
I don't know.

00:13:22.480 --> 00:13:22.820
Yeah.

00:13:22.820 --> 00:13:24.140
Brian, have you used it?

00:13:24.140 --> 00:13:25.220
Because I know that Michael have.

00:13:25.220 --> 00:13:27.760
I haven't used it yet, but I'm pretty excited.

00:13:27.760 --> 00:13:28.480
It looks pretty fun.

00:13:28.480 --> 00:13:29.520
Yeah, it looks really neat.

00:13:29.520 --> 00:13:33.160
And like I said, I did interview the guys over there on the show about what they're doing.

00:13:33.400 --> 00:13:38.100
And I believe that all the like one of the things that some people have worried about is these kinds of tools.

00:13:38.100 --> 00:13:42.540
Sometimes, you know, especially the ones that try to use like AI ML to help you.

00:13:42.540 --> 00:13:44.220
I don't think that this is one of those.

00:13:44.220 --> 00:13:46.080
They'll end up sending your code over.

00:13:46.080 --> 00:13:48.420
And I think this is all just local stuff, which is nice.

00:13:49.160 --> 00:13:50.940
Yeah, I guess that's one of my questions.

00:13:50.940 --> 00:13:57.760
I often run, you know, I often do a lot of coding on my laptop with it with no Wi-Fi connection or anything.

00:13:57.760 --> 00:14:00.140
Can I, can I use, does this help at all?

00:14:00.140 --> 00:14:00.700
I'm pretty sure.

00:14:00.700 --> 00:14:03.760
I don't think it makes any, I don't think it uses the internet to do its magic.

00:14:03.760 --> 00:14:06.000
So I think it's all just in the editor and PyCharm.

00:14:06.000 --> 00:14:06.460
Yeah, probably.

00:14:06.920 --> 00:14:08.260
Yeah, I'm pretty sure that's the case.

00:14:08.260 --> 00:14:11.700
But the one thing, so I used this for a while and I liked it.

00:14:11.700 --> 00:14:17.520
The one thing that drove me crazy and possibly it's been fixed is there's one or two recommendations.

00:14:17.520 --> 00:14:19.900
Like a lot of the recommendations it makes are great.

00:14:19.900 --> 00:14:22.020
But there's one or two that I really didn't like.

00:14:22.020 --> 00:14:25.860
I think, for example, I was using a guarding clause.

00:14:26.000 --> 00:14:30.420
So I would say, coming in method, the very first thing is like, if something's wrong, return and there's an error.

00:14:30.420 --> 00:14:32.480
And then go do the thing I was really wanting to do.

00:14:32.480 --> 00:14:33.500
So it's not indented.

00:14:33.500 --> 00:14:34.860
I really like that style.

00:14:34.860 --> 00:14:43.820
And it was suggesting that I like include, like I reverse that if so I don't have as many, as much, not cyclamatic, as many decision points.

00:14:43.820 --> 00:14:44.260
Right?

00:14:44.260 --> 00:14:46.920
There's not as many branches as going on there.

00:14:46.920 --> 00:14:47.840
And that's fine.

00:14:47.840 --> 00:14:49.220
I just don't have to accept it.

00:14:49.220 --> 00:14:50.320
It doesn't automatically do it.

00:14:50.320 --> 00:14:54.240
But it constantly was highlighting that with like squiggles as if something was wrong in my editor.

00:14:54.680 --> 00:14:56.860
And other tools like PyCharm do that.

00:14:56.860 --> 00:14:57.820
And you could just say, you know what?

00:14:57.820 --> 00:15:03.300
For this thing, please don't tell me that this is the fix because I really want this to be here for a reason X, Y, and Z.

00:15:03.300 --> 00:15:05.820
I couldn't find a way to do that in Sorcery.

00:15:05.820 --> 00:15:07.660
And it was driving me crazy.

00:15:07.660 --> 00:15:09.420
I'm like, no, this is not wrong.

00:15:09.420 --> 00:15:11.140
Please, like, stop telling me it's wrong.

00:15:11.140 --> 00:15:20.080
So I really hope, you know, if they're listening, maybe you could hint, hint, add like a hash ignore Sorcery line type of thing like all the other editors have.

00:15:20.080 --> 00:15:22.400
But yeah, no, I do think it's a cool tool.

00:15:22.740 --> 00:15:25.140
And people should check it out if it sounds interesting.

00:15:25.140 --> 00:15:27.060
Yeah, it would be nice to have this configurable.

00:15:27.060 --> 00:15:29.760
Stop complaining about this refactoring.

00:15:29.760 --> 00:15:30.460
Right.

00:15:30.460 --> 00:15:34.360
Or either I would even be happy to just say, please don't tell me about it.

00:15:34.360 --> 00:15:38.160
Because it was like very specific, like one very small suggestion.

00:15:38.160 --> 00:15:39.800
Like, just don't suggest that to me ever.

00:15:39.800 --> 00:15:41.200
Like, I don't ever want that.

00:15:41.200 --> 00:15:42.660
But everything else you do, I love you.

00:15:42.660 --> 00:15:43.060
Thank you.

00:15:44.980 --> 00:15:45.340
Nice.

00:15:45.340 --> 00:15:45.860
Yeah.

00:15:45.860 --> 00:15:48.340
John Sheehan has a comment.

00:15:48.340 --> 00:15:52.460
Some code efficiency improvements could end up obfuscating intent.

00:15:52.460 --> 00:15:53.000
Absolutely.

00:15:53.000 --> 00:15:53.600
For sure.

00:15:53.600 --> 00:15:54.700
They definitely could.

00:15:54.700 --> 00:15:58.520
I feel like a lot of what it's suggesting actually is a clarifying change.

00:15:58.520 --> 00:16:00.020
It's like, look, you're duplicating this code.

00:16:00.020 --> 00:16:01.440
Or this is overly indented.

00:16:01.440 --> 00:16:02.400
Here's how you change it.

00:16:02.400 --> 00:16:02.880
So it's not.

00:16:02.940 --> 00:16:05.300
So I feel like on that regard, Sorcery is really good.

00:16:05.300 --> 00:16:05.680
Yeah.

00:16:05.680 --> 00:16:06.120
Same.

00:16:06.120 --> 00:16:07.140
I have the same feeling.

00:16:07.140 --> 00:16:11.280
Like, it doesn't try to give you, like, very quirky refactorings.

00:16:11.280 --> 00:16:17.320
It actually tries to make your code easier by, like, removing redundant lines and stuff like that.

00:16:17.320 --> 00:16:17.660
Yeah.

00:16:17.660 --> 00:16:18.940
Very good point.

00:16:18.940 --> 00:16:22.600
But a tool like this that could make it more obfuscated.

00:16:22.600 --> 00:16:24.120
Now, there's something that we find.

00:16:24.120 --> 00:16:25.440
There's job security right there, baby.

00:16:25.440 --> 00:16:25.660
Yeah.

00:16:25.660 --> 00:16:26.900
Command Alt L.

00:16:26.900 --> 00:16:28.340
Reformat for...

00:16:28.340 --> 00:16:29.800
Reformat for Brian.

00:16:29.800 --> 00:16:30.760
Exactly.

00:16:32.080 --> 00:16:34.180
No one can work on this project, but so-and-so.

00:16:34.180 --> 00:16:37.440
Quickly reformat it to viewable, work on it, and re-encode it.

00:16:37.440 --> 00:16:37.780
Perfect.

00:16:37.780 --> 00:16:38.320
Yeah.

00:16:38.320 --> 00:16:39.340
That'd be cool.

00:16:39.340 --> 00:16:39.740
Yeah.

00:16:39.740 --> 00:16:43.200
Something else that's awesome is Linode.

00:16:43.200 --> 00:16:44.160
Thank you, Linode.

00:16:44.160 --> 00:16:45.760
Thank you for sponsoring the episode.

00:16:45.760 --> 00:16:50.940
Simplify your infrastructure and cut your cloud bills in half with Linode's Linux virtual machines.

00:16:50.940 --> 00:16:54.460
Develop, deploy, and scale your modern applications faster and easier.

00:16:54.460 --> 00:17:01.300
Whether you're developing a personal project or managing larger workloads, you deserve simple, affordable, and accessible cloud.

00:17:01.300 --> 00:17:02.420
Computing solutions.

00:17:02.420 --> 00:17:06.200
As a listener of Python Bytes, you'll get a $100 free credit.

00:17:06.200 --> 00:17:10.260
You can find all the details at pythonbytes.fm/Linode.

00:17:10.260 --> 00:17:15.860
Linode has data centers around the world with the same simple and consistent pricing regardless of location.

00:17:15.860 --> 00:17:16.580
That's cool.

00:17:16.580 --> 00:17:19.180
Choose the data center nearest to your users.

00:17:19.180 --> 00:17:25.900
You also receive 24-7, 365 human support with no tiers or handoffs regardless of your plan size.

00:17:25.900 --> 00:17:28.480
You can choose shared or dedicated compute instances.

00:17:28.480 --> 00:17:32.820
Or you can use your $100 credit on an S3 compatible object storage.

00:17:32.820 --> 00:17:34.560
Manage Kubernetes and more.

00:17:34.560 --> 00:17:37.400
If it runs on Linux, it runs on Linode.

00:17:37.400 --> 00:17:43.000
Visit pythonbytes.fm/Linode and click on the create free account button to get started.

00:17:43.000 --> 00:17:43.500
Absolutely.

00:17:43.500 --> 00:17:44.660
You know what I like about Linode?

00:17:44.660 --> 00:17:46.380
It's straightforward and simple.

00:17:46.380 --> 00:17:47.920
I go to places like AWS.

00:17:47.920 --> 00:17:49.160
I'm like, what is all this stuff?

00:17:49.160 --> 00:17:54.340
And why am I so deep in the permissions of AIMs in order to send an email over here?

00:17:54.340 --> 00:17:55.900
It's just, ah.

00:17:55.900 --> 00:17:57.200
I just want to create a server.

00:17:57.200 --> 00:17:57.860
Make it go.

00:17:57.860 --> 00:17:58.540
Let's do that.

00:17:58.540 --> 00:17:59.060
Nice.

00:18:00.120 --> 00:18:01.080
Are we there?

00:18:01.080 --> 00:18:01.840
We're there.

00:18:01.840 --> 00:18:02.480
We're there.

00:18:02.480 --> 00:18:03.160
We're there.

00:18:03.160 --> 00:18:03.680
Okay.

00:18:03.680 --> 00:18:05.300
We're onto your next item, I believe.

00:18:05.300 --> 00:18:05.760
Wait.

00:18:05.760 --> 00:18:05.940
Cool.

00:18:05.940 --> 00:18:06.700
No, we're not.

00:18:06.700 --> 00:18:07.940
I'm jumping ahead.

00:18:07.940 --> 00:18:08.920
We're onto my next item.

00:18:08.920 --> 00:18:10.820
So I'm going to feel back on that.

00:18:10.820 --> 00:18:14.140
So I'm on a database kick for some reason this week.

00:18:14.140 --> 00:18:17.620
I mean, I love databases, which is weird because when I first learned them, they seemed so challenging

00:18:17.620 --> 00:18:19.520
and odd and I struggled with them.

00:18:19.520 --> 00:18:20.380
But I don't know.

00:18:20.380 --> 00:18:24.620
I just really enjoy thinking about databases because they're like the magic of your application,

00:18:24.620 --> 00:18:24.920
right?

00:18:24.920 --> 00:18:27.660
A really slow, clunky database will just like bring it down.

00:18:27.740 --> 00:18:31.340
But a really nice polished one is like, how is that so fast and smooth?

00:18:31.340 --> 00:18:32.780
Like I really like working on this site.

00:18:32.780 --> 00:18:36.940
So one that I haven't spoken much about and honestly don't have a ton of experience with,

00:18:36.940 --> 00:18:43.700
but I do think is an interesting consideration is another branch of the NoSQL world in graph

00:18:43.700 --> 00:18:44.120
databases.

00:18:44.120 --> 00:18:49.560
So instead of modeling columns, you're really modeling entities and then their relationships.

00:18:49.560 --> 00:18:52.240
Like the relationship thing is first class thing.

00:18:52.240 --> 00:18:56.700
You can query by relationships instead of querying by data and then like joining and so on.

00:18:56.940 --> 00:18:59.760
So a popular one for this is Neo4j.

00:18:59.760 --> 00:19:03.460
And there's some nice ways to talk to it from Python.

00:19:03.460 --> 00:19:05.420
And there's this, I don't even know what to call it.

00:19:05.420 --> 00:19:06.680
OGM, I guess is the right.

00:19:06.680 --> 00:19:09.340
And so I said ODM for object document mapper.

00:19:09.340 --> 00:19:12.620
So in the graph world, it's OGM for object graph map.

00:19:12.620 --> 00:19:15.320
So there's an object graph mapper called Neo model.

00:19:15.320 --> 00:19:18.220
And I ran across this and I'm just like, oh, this is super cool.

00:19:18.220 --> 00:19:21.700
So the idea is that you can basically create these classes.

00:19:21.940 --> 00:19:29.180
And if you look at how you do it, it's if you've ever used Django ORM or Mongo engine or something like that, it's literally the same thing.

00:19:29.180 --> 00:19:38.640
So if you know, if you know Django ORM, you basically can do this, which is powerful because it gives you a whole different way to work with data and a whole different option without rethinking the world.

00:19:38.760 --> 00:19:42.860
So I could create, say, for example, a country, which is derived from structured node.

00:19:42.860 --> 00:19:48.440
And then just like Django, you would say code equals instead of string column, you would say string property.

00:19:48.440 --> 00:19:50.040
And it has an index.

00:19:50.040 --> 00:19:51.020
The index is uniqueness.

00:19:51.020 --> 00:19:51.920
The field is required.

00:19:51.920 --> 00:19:52.200
Boom.

00:19:52.200 --> 00:19:52.540
That's it.

00:19:52.540 --> 00:19:54.040
Like one line field.

00:19:54.040 --> 00:19:54.860
And it's defined.

00:19:54.860 --> 00:19:55.700
Then a person.

00:19:55.700 --> 00:19:59.080
Person might have a relationship back to a country and so on.

00:19:59.080 --> 00:20:01.720
And really, really neat the way you just sort of define this.

00:20:01.720 --> 00:20:04.580
And then you can do interesting queries on it.

00:20:04.580 --> 00:20:10.720
You can ask, like, give me the nodes where the person nodes where the name is Jim.

00:20:10.720 --> 00:20:11.980
And that's pretty simple.

00:20:11.980 --> 00:20:15.700
Or you can say, give me the nodes where the age is greater than three or whatever.

00:20:15.700 --> 00:20:19.320
But also you can ask things like, give me the country.

00:20:19.320 --> 00:20:19.780
All right.

00:20:19.780 --> 00:20:21.100
So go Jim.country.

00:20:21.100 --> 00:20:22.500
Is that connected to Germany?

00:20:22.500 --> 00:20:23.120
Yes or no.

00:20:23.120 --> 00:20:25.120
If it is, then Jim is from Germany.

00:20:25.340 --> 00:20:28.420
Or you can go to Germany and say, give me all the inhabitants.

00:20:28.420 --> 00:20:30.560
And it'll tell you all the people in there.

00:20:30.560 --> 00:20:35.160
And you can even say things like, I would like all the people in Germany whose name is Jim.

00:20:35.160 --> 00:20:37.920
So Germany.inhabitant.search name equals Jim.

00:20:37.920 --> 00:20:42.480
Like an incredibly simple programming model to work with these graph databases.

00:20:42.480 --> 00:20:51.560
So if you've got, like, really structured related data, but you want to, like, follow those relationships around, you know, maybe Postgres is not the best option for that kind of data.

00:20:51.560 --> 00:20:52.500
And this would be a good one.

00:20:52.500 --> 00:20:53.300
Cool, huh?

00:20:53.300 --> 00:20:57.020
Takes a bit of a mind bending getting used to it, but pretty neat.

00:20:57.020 --> 00:20:57.380
Yeah.

00:20:57.380 --> 00:20:57.740
Yeah.

00:20:57.740 --> 00:21:00.320
Sebastian, have you ever had to do anything with graph databases?

00:21:00.320 --> 00:21:05.400
No, but when I was looking at your code examples, I was thinking why there is Django code.

00:21:05.400 --> 00:21:07.540
And then you started saying, yeah, it looks similar to Django.

00:21:07.540 --> 00:21:08.200
And I was like, okay.

00:21:08.200 --> 00:21:09.520
Yeah, exactly.

00:21:09.520 --> 00:21:12.420
Why is there Django code in my graph database?

00:21:12.420 --> 00:21:15.480
But I think that's a huge benefit for the Python world, right?

00:21:15.520 --> 00:21:23.300
Like, a lot of people know the Django ORM model, or it's also the same as Mongo Engine, which obviously is also inspired by Django's ORM.

00:21:23.300 --> 00:21:25.860
And so a really straightforward way.

00:21:25.860 --> 00:21:29.820
Like, I think you could get up to speed in an hour if you knew Django working with this thing.

00:21:29.820 --> 00:21:30.780
It seems real straightforward.

00:21:30.780 --> 00:21:46.880
So it might be kind of cool to see, like, somebody do an example where they did the, I don't know, a toy example in a graph database, a relational and a document to see what the trade-offs and benefits and things that are.

00:21:46.880 --> 00:21:57.220
Right, we've got that, like, silly to-do app that everyone has used for JavaScript front-end frameworks to show, like, here's how you build to-do in VueJs.

00:21:57.220 --> 00:21:58.200
Here's how you build it in React.

00:21:58.200 --> 00:22:05.700
I think having, like, this canonical database represented, like, side by side, like, here's the Postgres version, here's the Neo4j version, all in Python.

00:22:05.700 --> 00:22:06.840
That would be an awesome article.

00:22:06.840 --> 00:22:08.900
Somebody had a bunch of time in Desire.

00:22:08.900 --> 00:22:09.940
Yeah.

00:22:09.940 --> 00:22:11.520
Yeah, pretty cool, pretty cool.

00:22:11.520 --> 00:22:13.680
Now you can talk about your item.

00:22:13.680 --> 00:22:15.820
I didn't mean to shoot you too far ahead there.

00:22:16.440 --> 00:22:19.920
No, so I lost my window.

00:22:19.920 --> 00:22:20.860
There it is.

00:22:20.860 --> 00:22:25.160
So I've been thinking about, I don't mock much.

00:22:25.160 --> 00:22:29.140
When I test, I try to test everything whenever I can.

00:22:29.140 --> 00:22:35.000
But I've been learning about mocks a little bit and mocking just because in some cases you kind of want to.

00:22:35.000 --> 00:22:46.740
So as I got into it, I didn't get very far before I realized that specking was, like, something that people found out about later but sounds sort of magical and I wanted to know more.

00:22:47.560 --> 00:22:57.700
And so I asked the Twitterverse, whoever follows me and stuff, if specking is something that you should do always or avoid it, is there downsides?

00:22:58.040 --> 00:23:10.500
And then one of the things that I got back was Stargirl Flowers article called my Python testing style guide, which includes this incredible section on mocking.

00:23:11.040 --> 00:23:15.620
And her section is called a mock must always have a speck.

00:23:15.620 --> 00:23:28.140
And it's just a really, if you've ever wondered about this, it's a really good discussion about mocking because it's not their evil and it's also not go run out and use them.

00:23:28.620 --> 00:23:34.080
The recommendations really are use real objects for collaborators whenever possible.

00:23:34.080 --> 00:23:37.200
But if you must mock, always use auto spec.

00:23:37.200 --> 00:23:43.520
And so the idea around specking or not specking is if I create a mock object, it can be anything.

00:23:43.520 --> 00:23:45.840
I can ask it for the date.

00:23:45.840 --> 00:23:48.440
I can ask it for the temperature of my coffee.

00:23:48.440 --> 00:23:52.180
I can ask it for anything or I can pass it anything and it'll accept it.

00:23:52.180 --> 00:23:53.580
That's kind of what mocks do.

00:23:53.580 --> 00:24:01.180
But if you say auto spec, you say, I want this thing to mock this other class and have auto spec be true.

00:24:01.180 --> 00:24:07.520
It means I can't do anything to that class, that mocked class that I couldn't do to the real thing.

00:24:07.520 --> 00:24:09.740
So all the interface is identical.

00:24:09.740 --> 00:24:12.600
You can't do, you can't do functions that aren't there.

00:24:12.600 --> 00:24:14.980
And that's where I thought, well, that seems like a good thing.

00:24:14.980 --> 00:24:16.620
And apparently I, it is.

00:24:16.620 --> 00:24:23.480
I think it's a good thing because you would like your test to at least require a thing behaves like the real thing, right?

00:24:23.480 --> 00:24:29.540
It might not give the real data back, but you shouldn't be able to call functions that don't exist or access fields that don't exist and so on.

00:24:29.540 --> 00:24:39.200
And more importantly, one of the things that's highlighted in this article is even if you could manually get it just right, later you might change the interface.

00:24:39.200 --> 00:24:46.560
You might change the API call, add a function or add a parameter that's required or remove a parameter that's not needed anymore.

00:24:46.960 --> 00:24:53.520
And your tests that use the mock that are custom built are still passing, but they shouldn't be.

00:24:53.520 --> 00:25:01.700
And with auto spec, your test will fail at that point when the interface break happens.

00:25:01.700 --> 00:25:04.000
Wait, you run your test more than once?

00:25:04.000 --> 00:25:05.960
No, of course.

00:25:05.960 --> 00:25:11.500
Obviously, this is why you, you know, one of the main values is this thing is locked down.

00:25:11.500 --> 00:25:15.060
I want to be able to make dramatic changes to it and see that it hangs together.

00:25:15.260 --> 00:25:20.160
And if things like rename a function has no effect on the test path thing, that that's not so good.

00:25:20.160 --> 00:25:20.560
Yeah.

00:25:20.560 --> 00:25:29.520
And then there's a whole bunch of other great advice that she gives around mocking talks about consider using stubs and fakes and even gives an example of what those are.

00:25:29.880 --> 00:25:35.340
And basically, it's like writing your own little tiny thing to substitute for the real thing.

00:25:35.340 --> 00:25:37.540
And spies, which are cool.

00:25:37.540 --> 00:25:40.100
Spies are like a mock wrapper around a real object.

00:25:40.100 --> 00:25:41.980
So it behaves the same as it always did.

00:25:41.980 --> 00:25:44.560
But you can interrogate like how it was called.

00:25:44.560 --> 00:25:45.620
That's kind of a neat thing.

00:25:45.620 --> 00:25:51.520
And some advice that I didn't really consider before is to the code test code is way cleaner.

00:25:51.520 --> 00:25:59.300
If you don't give the mocks special names, like a lot of people, if I wanted to mock foo, I might kind of title it mock foo.

00:25:59.500 --> 00:26:01.600
And she says, don't do that.

00:26:01.600 --> 00:26:02.560
Just name it foo.

00:26:02.560 --> 00:26:04.160
Then your code looks a lot cleaner.

00:26:04.160 --> 00:26:05.020
And I tried it out.

00:26:05.020 --> 00:26:06.080
And it does really great.

00:26:06.080 --> 00:26:06.500
Nice.

00:26:06.500 --> 00:26:07.240
It does help out.

00:26:07.240 --> 00:26:09.300
Anyway, great advice on mocking.

00:26:09.300 --> 00:26:11.420
So if you're considering mocking, go read that.

00:26:11.420 --> 00:26:19.340
And if you're doing unit testing and you want to not test all of your dependencies, basically, if you don't want to do integration tests, you probably should be doing something like this.

00:26:19.340 --> 00:26:19.680
Yeah.

00:26:19.680 --> 00:26:21.240
I mean, I hardly ever use them.

00:26:21.240 --> 00:26:25.320
I do things like rerouting my code through like any.

00:26:25.320 --> 00:26:27.680
I kind of designed it into my code if I have a chance.

00:26:27.680 --> 00:26:31.680
Like, for instance, if I need to have a...

00:26:31.680 --> 00:26:33.900
I know anything with a database.

00:26:33.900 --> 00:26:36.460
I know I'm going to have to redirect the database during testing.

00:26:36.460 --> 00:26:40.440
So that's just built into the design of the system to be able to reroute that somewhere.

00:26:40.440 --> 00:26:41.120
Yeah.

00:26:41.120 --> 00:26:42.080
Sebastian, what do you think?

00:26:42.320 --> 00:26:44.280
Yeah, that's a bunch of good advice.

00:26:44.280 --> 00:26:46.540
So that's a very good article.

00:26:46.540 --> 00:26:48.520
And I kind of agree with you.

00:26:48.520 --> 00:26:56.480
Like, I also prefer to kind of like mock a specific method of a real object, not to create a mock and then add stuff around.

00:26:56.480 --> 00:26:59.760
Although I think it's a different word for mocking a method.

00:26:59.760 --> 00:27:01.600
It's a stub or one of those words.

00:27:01.720 --> 00:27:03.760
I could never remember which one is which.

00:27:03.760 --> 00:27:05.280
Yeah, yeah, for sure.

00:27:05.280 --> 00:27:09.040
And then Robert Robertson is getting philosophical here.

00:27:09.040 --> 00:27:11.900
It says, a mock must always have a spec.

00:27:11.900 --> 00:27:13.240
Will they add that to the Xenopython?

00:27:13.240 --> 00:27:14.020
I don't know.

00:27:14.020 --> 00:27:15.720
In Python 4.0.

00:27:15.720 --> 00:27:16.720
Yeah, exactly.

00:27:16.720 --> 00:27:19.080
These are two things that are very unlikely.

00:27:19.080 --> 00:27:21.260
Xenopython is not extensible.

00:27:21.260 --> 00:27:22.900
Yeah, possibly.

00:27:23.340 --> 00:27:27.640
Oh, also, Dean was asking if the episode started, the live stream started early today.

00:27:27.640 --> 00:27:28.300
Hey, Dean.

00:27:28.300 --> 00:27:34.180
Daylight savings mismatched by a few weeks with the rest of the world, at least with Europe.

00:27:34.180 --> 00:27:35.240
Yeah, exactly.

00:27:35.240 --> 00:27:36.400
That's the story.

00:27:36.400 --> 00:27:37.000
All right.

00:27:37.000 --> 00:27:43.880
Speaking of time zones and stuff that's challenging, you know, speaking at conferences can be tricky because it's virtual.

00:27:43.880 --> 00:27:44.660
You're not actually there.

00:27:44.660 --> 00:27:45.700
So when does it really start?

00:27:45.700 --> 00:27:49.440
Well, maybe at least we can know which ones are out there and when the call for proposals are done.

00:27:49.440 --> 00:27:49.760
Sebastian.

00:27:49.760 --> 00:27:50.540
Yeah.

00:27:50.660 --> 00:27:59.420
So, yeah, as you said, since the Python call for proposal acceptance emails will be sent this week, I was thinking about conferences.

00:27:59.420 --> 00:28:06.640
And since it's 2021, most conferences are moving online, which is really cool because, well, they are cheaper.

00:28:06.640 --> 00:28:08.920
Well, first of all, tickets are cheaper.

00:28:08.920 --> 00:28:10.140
A lot of them are free.

00:28:10.140 --> 00:28:11.720
Then you don't have to pay for the accommodation.

00:28:11.720 --> 00:28:13.680
You don't have to pay for the ticket.

00:28:13.680 --> 00:28:14.900
You don't have to fly.

00:28:14.900 --> 00:28:16.060
So you don't have to take holidays.

00:28:16.060 --> 00:28:17.840
So a lot of benefits.

00:28:18.260 --> 00:28:22.860
And I was wondering, like, how do you find conferences to attend?

00:28:22.860 --> 00:28:30.540
Like there is this list at python.org that lists some conferences, but it doesn't have the smaller local events.

00:28:30.540 --> 00:28:32.420
And you also don't have dates.

00:28:32.420 --> 00:28:38.300
So you only have links to all the global, well, countrywide conferences, but you don't know when they are starting.

00:28:38.520 --> 00:28:41.040
So I found this tool called Conference Radar.

00:28:41.040 --> 00:28:44.780
And it's a PyPI package that you can install.

00:28:44.780 --> 00:28:51.480
And then you get a command line tool that you can run to get a list of upcoming conferences, which is pretty cool.

00:28:51.480 --> 00:28:54.180
Especially that you can have some parameters.

00:28:54.260 --> 00:28:59.500
Like you can get a list of conferences that have opened the call for proposals.

00:28:59.500 --> 00:29:04.100
So if you want to submit a talk, you can see which conferences are accepting those.

00:29:04.100 --> 00:29:08.060
And I really like it that you get this nice ASCII table in the terminal.

00:29:08.060 --> 00:29:12.140
Since I love CLI tools, this is really cool for me to use.

00:29:12.140 --> 00:29:12.580
Yeah.

00:29:12.580 --> 00:29:13.080
Yeah.

00:29:13.080 --> 00:29:16.280
I think it needs to integrate some rich, even like fancier tables.

00:29:16.280 --> 00:29:17.280
But yeah, it's really nice.

00:29:17.600 --> 00:29:17.780
Yeah.

00:29:17.780 --> 00:29:24.120
But the downside is that they don't have that many conferences because it's using only a few data sources.

00:29:24.120 --> 00:29:28.000
So when I was running it today, I couldn't find that many conferences.

00:29:28.000 --> 00:29:31.440
And actually, there was no call for proposal open.

00:29:31.440 --> 00:29:32.940
Like no date was there.

00:29:32.940 --> 00:29:34.820
So I hope it will improve.

00:29:34.820 --> 00:29:38.760
But so far, this is my best tool to like find upcoming conferences.

00:29:38.760 --> 00:29:39.420
Yeah.

00:29:39.420 --> 00:29:42.480
And if people are out there listening, they have a conference, they want to get the word out about it.

00:29:42.480 --> 00:29:46.400
You know, might as well go add it to the data source that these things are using.

00:29:46.400 --> 00:29:46.760
Yeah.

00:29:46.760 --> 00:29:47.640
Yeah, that would be awesome.

00:29:47.640 --> 00:29:48.080
Yeah.

00:29:48.080 --> 00:29:48.720
This thing's cool.

00:29:48.720 --> 00:29:49.620
I checked it out.

00:29:49.620 --> 00:29:57.540
One bit of confusion for me is if you look at the description, it says installation, you can simply use pip to install Conrad for conference radar.

00:29:57.540 --> 00:30:03.000
So you can use pip to install Conrad, but you cannot pip install Conrad.

00:30:03.000 --> 00:30:03.980
That will not work.

00:30:03.980 --> 00:30:04.880
It may work.

00:30:04.880 --> 00:30:08.920
If it does, you should maybe be concerned because someone heard the show and put something in.

00:30:08.920 --> 00:30:11.520
You have to pip installed conference dash radar.

00:30:11.520 --> 00:30:12.660
So I don't know.

00:30:12.660 --> 00:30:15.600
Maybe just a little clarification for people who wanted to check this out.

00:30:15.600 --> 00:30:22.460
But the command, the CLI is Conrad show, Conrad refresh, Conrad call for proposals, things like that.

00:30:22.460 --> 00:30:23.960
You can even set reminders, right?

00:30:23.960 --> 00:30:26.420
It'll like remind you when the call for proposal is closing.

00:30:26.420 --> 00:30:27.120
Oh, cool.

00:30:27.120 --> 00:30:27.880
I didn't see that.

00:30:27.880 --> 00:30:28.360
That's nice.

00:30:28.360 --> 00:30:30.120
I think there's a remind feature in here.

00:30:30.120 --> 00:30:31.880
I can't remember exactly how it works.

00:30:31.880 --> 00:30:33.420
But yeah, yeah, pretty cool.

00:30:33.420 --> 00:30:38.300
I'm glad that you mentioned that because I just tried to pip install Conrad and I'm like, it didn't work, man.

00:30:38.300 --> 00:30:39.820
It's broken.

00:30:39.820 --> 00:30:40.480
What is this thing?

00:30:40.480 --> 00:30:45.080
Yeah, I just think the documentation is like a little unclear because the CLI and the package name are not the same.

00:30:45.080 --> 00:30:47.100
At least you didn't get some malicious package.

00:30:47.100 --> 00:30:48.080
Exactly.

00:30:48.080 --> 00:30:49.700
Mining bitcoins right now.

00:30:49.700 --> 00:30:50.360
Exactly.

00:30:50.360 --> 00:30:52.260
Why is my computer hot?

00:30:52.260 --> 00:30:53.000
That's weird.

00:30:53.000 --> 00:30:53.720
Oh, well.

00:30:53.720 --> 00:30:56.400
Suddenly my camera turned on.

00:30:56.400 --> 00:30:57.960
Oh, no, we're doing a live stream.

00:30:57.960 --> 00:30:58.420
That's why.

00:30:58.420 --> 00:30:58.780
Yep.

00:30:58.780 --> 00:30:59.080
Yep.

00:30:59.340 --> 00:31:02.320
Oh, and also Dean has a quick comment for you there, Sebastian.

00:31:02.320 --> 00:31:03.280
Oh, this is perfect.

00:31:03.280 --> 00:31:05.860
And I think I maintain a Google calendar for conferences.

00:31:05.860 --> 00:31:06.680
Oh, cool.

00:31:06.680 --> 00:31:07.320
Yeah.

00:31:07.320 --> 00:31:08.940
That's a good idea.

00:31:08.940 --> 00:31:09.820
Yeah.

00:31:09.820 --> 00:31:13.800
I was looking for different sources where to get the conference information.

00:31:13.800 --> 00:31:20.760
And so far, the most reliable one is my friend Miro on Twitter, who is submitting and speaking at a lot of conferences.

00:31:20.760 --> 00:31:23.920
So I'm just following him and he's always speaking.

00:31:23.920 --> 00:31:25.180
He's always tweeting.

00:31:25.180 --> 00:31:27.480
So that's my best bet so far.

00:31:27.480 --> 00:31:29.460
I met him at PyCon Slovakia.

00:31:29.460 --> 00:31:31.440
So, yeah, I know he's at conferences often.

00:31:31.440 --> 00:31:31.940
Yeah.

00:31:31.940 --> 00:31:32.420
Awesome.

00:31:32.420 --> 00:31:33.200
Brian, is that it?

00:31:33.200 --> 00:31:34.540
That's it for me.

00:31:34.540 --> 00:31:36.200
Do you have anything you want to share?

00:31:36.200 --> 00:31:36.800
Oh, yeah.

00:31:36.800 --> 00:31:40.960
I almost have an extra, extra, extra, extra here all about it section to share, but not quite.

00:31:40.960 --> 00:31:44.520
So I'll keep it a little bit quick here, but I'll go through some things.

00:31:44.520 --> 00:31:45.840
First of all, quick announcement.

00:31:45.840 --> 00:31:51.660
Sebastian and I have been working for, as he hinted at, I don't know if this was on the recording or before we started,

00:31:51.660 --> 00:31:54.700
but for like six months on a project called Modern Python Projects,

00:31:54.700 --> 00:32:03.380
which is a follow-on sort of course version of the Modern Python Developers Toolkit thing we did over at Talk Python, episode 279, I think.

00:32:03.380 --> 00:32:11.920
So we've got this awesome course out at talkpython.fm/modern-python-projects, or just click the link in the show notes and you can check it out.

00:32:11.920 --> 00:32:14.580
That's been out for an hour and 10 minutes.

00:32:14.580 --> 00:32:15.600
So not very long.

00:32:15.600 --> 00:32:16.440
This looks really cool.

00:32:16.440 --> 00:32:17.760
I am excited about this.

00:32:17.760 --> 00:32:21.580
Yeah, a lot of neat stuff that Sebastian, this is all Sebastian's work that he put into it here.

00:32:21.580 --> 00:32:22.820
So it's really cool.

00:32:22.820 --> 00:32:23.600
Oh, you help a lot as well.

00:32:23.600 --> 00:32:23.980
Thanks.

00:32:23.980 --> 00:32:29.500
What would you like to, maybe, what do you think, quick thing to share, tell people about this course that you built?

00:32:29.500 --> 00:32:36.440
Yeah, so basically my idea was to give you an overview of everything you need to know,

00:32:36.440 --> 00:32:39.120
even if you don't have Python installed on your computer,

00:32:39.120 --> 00:32:43.580
all the way up to actually building and publishing your project.

00:32:43.580 --> 00:32:46.040
So basically we start by installing Python.

00:32:46.040 --> 00:32:47.640
I show you how to manage dependencies.

00:32:47.640 --> 00:32:51.700
I also show you how to set up VS Code for programming with Python.

00:32:51.700 --> 00:32:56.060
Then we add tests, then we add tools like linters, formatters, some static code analysis.

00:32:56.660 --> 00:32:59.020
Then we add the test documentation, obviously.

00:32:59.020 --> 00:33:01.820
We talk about continuous integration.

00:33:01.820 --> 00:33:05.420
There are like three sections where we build different projects,

00:33:05.420 --> 00:33:08.480
and actually each of them is done in a different manner.

00:33:08.480 --> 00:33:10.100
So for one, I use Poetry.

00:33:10.100 --> 00:33:11.580
For the other one, I don't use Poetry.

00:33:11.580 --> 00:33:12.480
So we have a comparison.

00:33:12.480 --> 00:33:16.520
And all the way up to deploying, where I show you how to deploy, for example, to Heroku,

00:33:16.520 --> 00:33:18.160
and how to create a Docker image.

00:33:18.160 --> 00:33:20.260
And yeah, all Spectrum.

00:33:20.260 --> 00:33:21.000
Yeah, that's cool.

00:33:21.000 --> 00:33:21.720
I definitely like it.

00:33:21.720 --> 00:33:22.980
So people can check that out.

00:33:22.980 --> 00:33:25.880
That's a quick item there, just that we launched that recently.

00:33:26.240 --> 00:33:30.140
And also, Brian, our pythonbytes.fm looks very bright right now.

00:33:30.140 --> 00:33:30.600
What do you think?

00:33:30.600 --> 00:33:31.620
Yeah, neat.

00:33:31.620 --> 00:33:36.180
So one thing I wanted to do, you know, people have been contacting us and saying,

00:33:36.180 --> 00:33:39.700
hey, I heard you mentioned like, oh, we just mentioned Dean's name on the live stream.

00:33:39.700 --> 00:33:40.500
What is this live stream?

00:33:40.500 --> 00:33:41.040
When is it?

00:33:41.040 --> 00:33:41.720
How do I find it?

00:33:41.720 --> 00:33:46.300
So what I've done is I've updated the Python Bytes website and Talk Python for its live stream.

00:33:46.300 --> 00:33:51.260
But for Python Bytes, if you go to pythonbytes.fm, if we're live streaming at that very moment,

00:33:51.260 --> 00:33:52.960
there's like a big red banner across the top.

00:33:52.960 --> 00:33:54.140
Like we're live streaming right now.

00:33:54.140 --> 00:33:55.000
Come be part of the show.

00:33:55.320 --> 00:33:59.620
And then there's also a live stream menu item that'll take you over and show you like the

00:33:59.620 --> 00:34:00.920
live stuff that's happening.

00:34:00.920 --> 00:34:03.200
And it'll basically show you the live playing stream.

00:34:03.200 --> 00:34:06.280
But you can open that up on YouTube to be part of the live chat and so on.

00:34:06.280 --> 00:34:08.540
So live stream now on the podcast page.

00:34:08.540 --> 00:34:11.740
If it's a podcast site, if you visit it and it's all bright, you know, and you got a moment,

00:34:11.740 --> 00:34:12.580
go check out the live stream.

00:34:12.580 --> 00:34:12.960
Yeah.

00:34:13.040 --> 00:34:19.200
And then also, if Michael's up to date on it, which he does all the work on this, I appreciate

00:34:19.200 --> 00:34:19.540
that.

00:34:21.180 --> 00:34:23.280
We announced when the next one's going to be.

00:34:23.280 --> 00:34:25.680
So if you're not sure, you can just check it out anyway.

00:34:25.680 --> 00:34:28.500
And there should be a link there to say when.

00:34:28.500 --> 00:34:29.260
Yeah, that's right.

00:34:29.360 --> 00:34:33.240
So normally what I try to do is schedule the next one when we're done with this one.

00:34:33.240 --> 00:34:36.840
So if people go there, they'll see the like, here's the next live streaming and YouTube as

00:34:36.840 --> 00:34:37.920
a button to say, set a reminder.

00:34:37.920 --> 00:34:38.680
Tell me what's happening.

00:34:38.680 --> 00:34:39.060
Yeah.

00:34:39.420 --> 00:34:42.420
Last time, I think I said, is Python on Mars?

00:34:42.420 --> 00:34:43.220
Question mark.

00:34:43.220 --> 00:34:48.960
Because that F plane, F that that flight overview system, it was using Python to train the models,

00:34:48.960 --> 00:34:51.680
but I think it's using C++ to fly the little helicopter thing.

00:34:51.680 --> 00:34:56.560
And I just mentioned, if anybody knows Python's on Mars, that would be awesome because this

00:34:56.560 --> 00:34:59.680
this is really cool and related, but it's not the same as Python on Mars.

00:34:59.680 --> 00:35:06.160
So Bojack Norseman sent a tweet over and said, hey, Python Bytes, you guys asked for a confirmation.

00:35:06.160 --> 00:35:12.440
Linux Unplugged, the Linux podcast, has an interview with Tim Canham at JPL, where he

00:35:12.440 --> 00:35:15.480
talks about running various machines and mentions Python.

00:35:15.480 --> 00:35:21.460
So the thing that he talks about is, remember when the thing was landing and there was the

00:35:21.460 --> 00:35:25.680
sky crane that like lowered Perseverance and there were all these different camera views.

00:35:25.680 --> 00:35:27.080
You could see the bottom flying away.

00:35:27.080 --> 00:35:29.180
You could see it like shooting off dust and coming down.

00:35:29.180 --> 00:35:31.460
There's all these views like these onboard cameras.

00:35:31.460 --> 00:35:35.780
Apparently all those were controlled and collected and like processed with Python on Mars.

00:35:35.900 --> 00:35:36.940
So yes, Python is on Mars.

00:35:36.940 --> 00:35:37.660
That's sweet.

00:35:37.660 --> 00:35:38.160
Nice.

00:35:38.160 --> 00:35:43.740
Following up on your item, Sebastian Gita Van Rossum has sent out, it said that signups

00:35:43.740 --> 00:35:47.280
for the Python Language Summit at PyCon online only are now open.

00:35:47.280 --> 00:35:52.180
If you represent a third party package and want to have a say in Python's future, please sign

00:35:52.180 --> 00:35:52.360
up.

00:35:52.360 --> 00:35:55.860
So if you have a third party package and you want to be part of this, please sign up.

00:35:55.860 --> 00:35:56.840
I'll put the link in the show notes.

00:35:56.840 --> 00:35:57.460
Oh, wait.

00:35:57.460 --> 00:36:02.440
Does a single developer package qualify as a third party package?

00:36:02.700 --> 00:36:05.380
Do you want to have a say in Python's future?

00:36:05.380 --> 00:36:06.900
They might not listen to you.

00:36:06.900 --> 00:36:09.000
They're like, well, I'm going to talk to the guys that do Flask and Django.

00:36:09.000 --> 00:36:10.420
You can go get a seat in the corner.

00:36:10.420 --> 00:36:12.480
I don't think people should listen to me.

00:36:14.260 --> 00:36:16.440
Robert Robertson has a very nice meme.

00:36:16.440 --> 00:36:17.680
The snake has landed.

00:36:17.680 --> 00:36:18.560
Instead of the eagle.

00:36:18.560 --> 00:36:19.040
Right.

00:36:19.040 --> 00:36:19.920
The snake has landed.

00:36:19.920 --> 00:36:20.300
Beautiful.

00:36:20.300 --> 00:36:21.180
For the Python thing.

00:36:21.180 --> 00:36:21.700
All right.

00:36:21.700 --> 00:36:23.420
Sebastian, anything else you want to throw out there real quick?

00:36:23.420 --> 00:36:23.800
Yeah.

00:36:23.880 --> 00:36:29.400
I have a kind of a curiosity because I started using VS Code in a browser recently.

00:36:29.400 --> 00:36:32.960
I started a new project and everyone on the team is using VS Code in the browser.

00:36:32.960 --> 00:36:36.100
And it's working surprisingly well.

00:36:36.100 --> 00:36:39.720
I would never try to use a code editor in a browser.

00:36:39.720 --> 00:36:41.940
Like, out of myself, never.

00:36:41.940 --> 00:36:44.080
Because I need to have everything installed locally.

00:36:44.080 --> 00:36:46.820
But now that I have to use it, I'm like super impressed.

00:36:46.820 --> 00:36:47.940
Everything works smoothly.

00:36:48.380 --> 00:36:49.740
And my experience is amazing.

00:36:49.740 --> 00:36:53.800
So it made me think, like, well, is this the future of programming?

00:36:53.800 --> 00:37:01.460
It's definitely nice to have everything on the same page because it's, like, super easy to set up the same plugins, the same configuration for the whole team.

00:37:01.460 --> 00:37:02.800
People don't have to install anything.

00:37:02.800 --> 00:37:06.600
So, yeah, I'm wondering to see in which direction it will go.

00:37:06.600 --> 00:37:07.720
Yeah, it's super interesting.

00:37:07.720 --> 00:37:13.200
You know, I haven't done a lot of it, but it's probably using that thing where they said, well, this is an Electron app.

00:37:13.420 --> 00:37:18.420
Let's take the UI bit and just move the backend farther away and put that in a Docker container or something.

00:37:18.420 --> 00:37:20.480
I'm guessing that's how it ran, right?

00:37:20.480 --> 00:37:22.080
It wasn't pure all JavaScript.

00:37:22.080 --> 00:37:22.960
Yeah, I think so.

00:37:22.960 --> 00:37:25.840
But I was expecting some latency and nothing like that.

00:37:25.840 --> 00:37:30.340
I mean, my only concern is that the browser is interrupting some keyboard shortcuts.

00:37:30.340 --> 00:37:36.240
So whenever I want to close a tab in the VS Code, I'm closing the browser window because that's the same combination.

00:37:36.240 --> 00:37:39.700
That drives me crazy about the browser editors.

00:37:39.700 --> 00:37:40.820
It's like, I'm editing, I'm editing.

00:37:40.820 --> 00:37:42.160
I want to make this tab go away.

00:37:42.280 --> 00:37:43.480
Why is the whole thing gone again?

00:37:43.480 --> 00:37:44.560
Yeah.

00:37:44.560 --> 00:37:45.840
Yeah, I didn't know what to do about that.

00:37:45.840 --> 00:37:47.180
Yeah, I know that's really cool.

00:37:47.180 --> 00:37:51.560
And, you know, it's really applicable for, like, if you've got a class full of students and they have Chromebooks,

00:37:51.560 --> 00:37:55.360
they can't install Python and VS Code on their Chromebook, but they have Chrome.

00:37:55.360 --> 00:37:56.100
They're good.

00:37:56.100 --> 00:37:57.020
They're good to go, right?

00:37:57.020 --> 00:37:58.500
Or things like that.

00:37:58.500 --> 00:38:00.160
Or an iPad that doesn't allow it.

00:38:00.160 --> 00:38:02.780
So you really need possibilities there.

00:38:02.780 --> 00:38:03.280
Exactly.

00:38:03.280 --> 00:38:07.220
We have some custom libraries and they are already available on those virtual machines with VS Code.

00:38:07.220 --> 00:38:08.900
So that's super easy to use.

00:38:08.900 --> 00:38:09.860
Yeah, absolutely.

00:38:09.860 --> 00:38:14.080
So, Brian, I put together a joke for us, but we'll have to clean it up just a little bit for the air.

00:38:14.080 --> 00:38:14.900
Okay.

00:38:14.900 --> 00:38:15.820
I'm not reading it.

00:38:15.820 --> 00:38:17.200
I'll read it.

00:38:17.200 --> 00:38:17.560
I'll read it.

00:38:17.560 --> 00:38:17.940
I'll read it.

00:38:17.940 --> 00:38:19.780
So I'll put it up here.

00:38:20.140 --> 00:38:23.460
So it's a picture of some birds on a power line, right?

00:38:23.460 --> 00:38:26.840
And, you know, they sort of often sit together in little groups.

00:38:26.840 --> 00:38:27.700
Like, I don't know why.

00:38:27.700 --> 00:38:28.900
They're hanging out on the power line.

00:38:28.900 --> 00:38:30.160
They've got, like, incredible balance.

00:38:30.160 --> 00:38:31.160
And they're all just sitting there.

00:38:31.160 --> 00:38:34.580
And there's one bird that's, like, outside of the power line.

00:38:34.580 --> 00:38:36.360
It's like where the power line stops and goes down.

00:38:36.360 --> 00:38:38.360
The bird's just sitting there floating in midair.

00:38:38.360 --> 00:38:42.180
And the other birds are looking at each other like, how is he just, his wings aren't flapping.

00:38:42.180 --> 00:38:43.560
How is he just sitting there in midair?

00:38:43.560 --> 00:38:44.800
And they go, oh, he has Wi-Fi.

00:38:44.800 --> 00:38:47.820
But then the bird comes crashing down.

00:38:47.820 --> 00:38:51.500
And he goes, the falling bird screams, oh, darn router.

00:38:51.500 --> 00:38:53.440
I love it.

00:38:53.440 --> 00:38:54.100
I thought it was good.

00:38:54.100 --> 00:38:56.240
It might not be totally safe at work, but it's good.

00:38:56.240 --> 00:38:59.920
Yeah, there's a lot of routers that aren't properly tested with Rurion Schwartz equipment.

00:38:59.920 --> 00:39:00.700
Yeah.

00:39:00.700 --> 00:39:01.160
Yeah.

00:39:01.220 --> 00:39:05.120
I mean, if you were floating suspended in midair by your Wi-Fi, then it stops.

00:39:05.120 --> 00:39:05.900
That's a little risky.

00:39:05.900 --> 00:39:07.600
That's good.

00:39:07.600 --> 00:39:10.720
Well, thanks, Sebastian, for stopping by and doing the show with us.

00:39:10.720 --> 00:39:11.740
Thank you for having me.

00:39:11.740 --> 00:39:12.660
Quite a lot of fun.

00:39:12.660 --> 00:39:13.120
Yeah.

00:39:13.120 --> 00:39:13.700
It was fun.

00:39:13.700 --> 00:39:14.660
Thanks for coming.

00:39:14.660 --> 00:39:15.340
Thanks, Brian.

00:39:15.340 --> 00:39:15.980
Thanks for being here.

00:39:15.980 --> 00:39:16.820
Thank you.

00:39:16.820 --> 00:39:17.500
Bye, everyone.

